增强的全局搜索

名称:增强的全局搜索

描述:使用更快,更相关的全局搜索,以及易于实现的过滤器结果

版本:1.0.13

发布:2020-06-29

itop-version-min:2.5.0

下载:https://store.itophub.io/en_US/products/combodo-fulltext-search

代码:combodo-fulltext-search

状态:稳定

diffusion:Client Store, iTop Hub

此扩展程序用更快,更准确的搜索代替了标准全局搜索。

特征

  • 用户可以通过指定必需的,可选的和拒绝的字词来改进得出结果准确性。
  • 它使用MySQL全文本特性执行全局搜索。
  • 可以使用参数配置修改结果列表相关性,以定义单词,字符串或对象类别的优先级。

修订记录

发布日期版本注释
2019-01-091.0.10-修正好记的名称限制
-修复计划任务
-修正测试中的类别名称
-添加Combodo许可证
2019-01-091.0.9-修复内存限制
-修复案例日志索引
-修复发送邮件搜索
-限制friendlyname大小以适合数据库
2018-07-311.0.8-更好的索引
-更好的搜索
-仅支持InnoDB和BOOLEAN模式
-在搜索上显示相关对象
-显示匹配字段
-管理页面:用于重新编制索引
-班级下钻
- 调试模式
2018-01-190.0.3-更新数据时更好的索引编制
-'populate_search.php'使用配置作为要创建的表的类型(MyISAM或InnoDB)
-MySQL上没有约束(在5.6之前的版本中必须使用MyISAM)
2018-01-090.0.2-更好的错误管理。
-安装时无索引(性能问题)。
-必须使用“ populate_search.php”来创建InnoDB全文索引。
- MySQL >= 5.6
2017-12-140.0.1-首次进行版本实验。

局限性

  • 此扩展依赖于MySQL全文本特性。
  • 它使用为iTop配置的主要数据库。

要求

  • MySQL 5.6.
  • Mariadb 10.0.5或更高版本
  • iTop 2.5.0或以上

安装

与其他任何扩展一样。将扩展名放在“扩展”文件夹中,然后再次运行安装程序。

如果数据库很大,则索引的创建可以运行很长时间。可以通过调用以下页面来填充全文本索引:

<itop_url>/env-production/combodo-fulltext-search/populate-search-index.cli.php

配置

参数类型描述默认价值
object_weight_因素数组权重因素以申请给定的对象名称(格式:“类名”⇒“价值”),该值通常在0到10之间变化(0表示该类没有结果)。对于未指定的每个类,默认值为1。对该参数需求的修改是对数据库的完全重新索引。 
array(
  'Organization' => 2.0,
  'Person' => 1.5,
  'Location' => 1.2,
  'SLT' => 0.8,
)
句子_重量_因素浮动权重因素,以使多个单词的搜索与该列表中的单词列表完全匹配。10
required_weight_因素浮动对因素进行加权,以使搜索的所有单词至少匹配一次。2.0
start_with_weight_因素浮动权重因素,以使一个单词与开头匹配。0.5
max_interactive_索引_update_time_in_sec整数变更上直接索引更新允许的时间(以秒为单位)。5
后台_索引_refresh_period_in_min整数后台索引编制的时间(以分钟为单位)。5
后台_max_indexation_time_in_min整数后台索引的执行时间限制(以分钟为单位)。5
后台_索引_full_rebuild_enabled布尔值允许每天重建索引。true
后台_索引_full_rebuild_time小时全面重建索引的开始时间。'01:30'

从您的用户那里获得有关他们所做搜索的反馈,这些反馈不会返回前5名,这是每个用户都希望获得的。
然后,在那些采样搜索中使用调试模式对调优的上述参数进行优化。

后台行为

索一个单词当搜索单个单词(例如:demo)时,将进行以下研究:

  1. 这个词:演示
  2. 以搜索开头的单词:demo *

搜索多个单词

搜索多个单词时(例如:用户级锁),将进行以下研究:

  1. 输入的确切句子是:“用户_level lock”
  2. 所有单词都存在:+用户_level + lock
  3. 存在至少一个单词:用户_level lock

由于-是排除单词的关键字,因此被_代替,_是表示任何单个字符的另一个关键字

计算权重

每个搜索都带来由MySQL全文搜索计算的分数,然后将其与搜索集进行加权。

原始重量由MySQL提供。参数只是MySQL权重的乘数。您不能影响iTop中的原始重量。

管理员只能访问:

为了确保在iTop中进行有效的搜索,管理员用户可以执行以下其他操作:

  • 局搜索管理菜单,允许在配置参数的变更之后重建索引:对象_weight_因素。
  • 试菜单,根据重量显示有关如何生成结果排序的详细信息。

https://www.itophub.io/wiki/media?media=extensions%3Aglobalsearchdebug.png

user_level锁具有MySQL提供的权重,

“ user_level锁”具有上述权重* sentence_weight_factor

因子总得分是各个得分的总和* object_weight_factor

从用户那里获取对您的真实数据进行“抽样搜索”的结果,该对象应该位于前5个结果中。然后更改各种参数,对那些“采样搜索”使用“调试”操作检查结果。

用法

只需在全局搜索字段中输入单词,然后输入或单击放大镜图标即可得到结果:

https://www.itophub.io/wiki/media?media=extensions%3Aglobalsearch-overviewuser.png

完善调优您的搜索的提示

在所需单词的开头添加+

用户请求:+ PHP错误

用户的请求将包含搜索,其中包含强制性的“ PHP”以及可能包含“错误”的请求

加-禁止字首

用户请求:PHP -已关闭

对于包含“ PHP”但不包含“已关闭”的用户请求,将为搜索(这不包括带有状况=已关闭的所有UserRequest)

在不完整单词的末尾添加*

组织:组合*

组织的搜索将包含以'Combo'开头的单词

将搜索限制为类

默认情况下,搜索在所有可搜索类别的类上进行搜索,包括抽象类,例如工单,联系人或FunctionalCI。

在搜索模式的开头添加<class-name>:以将搜索限制为该类或其后代之一的对象

https://www.itophub.io/wiki/media?media=extensions%3Aglobalsearch-restrictsearch.pnghttps://www.itophub.io/wiki/media?media=extensions%3Aglobalsearch-expendsearch.png

FunctionalCI:combodo

对于任何包含“ combodo”的FunctionalCI,将使用搜索,因此返回的对象可以是服务器,PC,机箱等。

类名可以是使用的当前语言(例如配置项fonctionnel)的显示名称的内部名称(例如FunctionalCI)。

显示匹配词

菜单允许显示一些与请求的模式匹配的字段

https://www.itophub.io/wiki/media?w=600&tok=0fe437&media=extensions%3Aglobalsearch-matching-fields.png

显示相关对象

在每个返回的对象上,您可以请求相关对象:

https://www.itophub.io/wiki/media?w=600&tok=24299c&media=extensions%3Aglobalsearch-relatedobject.png

原文:https://www.itophub.io/wiki/page?id=extensions%3Acombodo-fulltext-search


Enhanced global search

name:
Enhanced global search
description:
Use a faster and more relevant global search with easy-to-filter results
version:
1.0.13
release:
2020-06-29
itop-version-min:
2.5.0
code:
combodo-fulltext-search
state:
stable
diffusion:
Client Store, iTop Hub

This extension replace the standard global search with a faster and more accurate search.

This extension requires Index FullText, so MySQL 5.6+ or Mariadb 10.0.5+

Features

  • Users can improve results accuracy by specifying required, optional and denied words.

  • Administrator can fine-tune the results relevance, by changing configuration parameters.

  • It uses MySQL fulltext feature to perform the global search.

Revision History

Release DateVersionComments
2020-06-291.0.13- Compatibility iTop 2.7
- Fix searches with some reserved characters
- Search admin menu
2019-02-041.0.11- Fix broken related link
2019-01-091.0.10- Fix the friendly name limit
- Fix Scheduled task
- Fix class name in tests
- Add Combodo license
2019-01-091.0.9- Fix memory limit
- Fix Case log indexation
- Fix email search
- Limit the friendlyname size to fit in the DB
2018-07-311.0.8- Better indexation
- Better search
- Support only InnoDB and BOOLEAN mode
- Display related objects on search
- Display matching fields
- Admin page : for re-indexation
- Class drill-down
- Debug mode
2018-01-190.0.3- Better indexation when updating data
- 'populate_search.php' uses the configuration for the type of table to create (MyISAM or InnoDB)
- No constraint on MySQL (MyISAM must be used in version before 5.6)
2018-01-090.0.2- Better error management.
- No indexation at setup (performance issues).
- 'populate_search.php' have to be used to create an InnoDB fulltext index.
- MySQL >= 5.6
2017-12-140.0.1- First version experimental.

Limitations

  • This extension relies on MySQL full-text feature.

  • It uses the main database configured for iTop.

Requirements

  • MySQL 5.6 or above

  • Mariadb 10.0.5 or above

  • iTop 2.5.0 or above

Installation

Use the Standard installation process for this extension.

If the database is big, the index creation can run for a long time. It is possible to populate the full-text index by calling the following page:

<itop_url>/env-production/combodo-fulltext-search/populate-search-index.cli.php

Configuration

ParameterTypeDescriptionDefault value
object_weight_factorarrayWeight factor to apply for a given object name (format: 'classname' ⇒ 'value') the values can vary from 0 to 10 generally (0 means no results for this class). The default is 1 for every class not specified. The modification of this parameter needs a complete re-indexation of the database. 
array(
  'Organization' => 2.0,
  'Person' => 1.5,
  'Location' => 1.2,
  'SLT' => 0.8,
)
sentence_weight_factorfloatWeight factor for searches with multiple words matching exactly the list of words in that order.10.0
mandatory_weight_factorfloatWeight factor for searches with all the words of the search matching at least once.2.0
start_with_weight_factorfloatWeight factor for searches with one word matching the beginning.0.5
max_interactive_index_update_time_in_secintegerTime in seconds allowed for direct indexation update on change.5
background_index_refresh_period_in_minintegerPeriod in minutes for background indexation.5
background_max_indexation_time_in_minintegerExecution time limit in minutes for background indexation.5
background_index_full_rebuild_enabledbooleanAllow daily rebuild of the index.true
background_index_full_rebuild_timehourStarting hour of the full rebuild of the index.'01:30'

Background behavior

Searching for one word When searching for a single word (example: demo) the following searches are done:

  1. The word: demo

  2. The words starting with the search: demo*

Searching for multiple words

When searching for multiple words, (example: user-level lock) the following searches are done:

  1. The exact sentence entered: “user_level lock”

  2. All the words are present: +user_level +lock

  3. At least one word is present: user_level lock

As - is a keyword to exclude a word, it is replaced by _ which is another keyword to represent any single character.

Computing weight

Each search is bringing points calculated by MySQL fulltext search, which are then weighted with the configuration parameters set.

Raw weight is provided by MySQL. Parameters are just a multiplier factor of the MySQL weight. You cannot influence the raw weight within iTop.

What values to set

To ensure that the search will be efficient within your iTop, there are additional actions for Administrator users:

  • Global search management action which allow to rebuild the indexes after a change of configuration parameter: object_weight_factor.

  • Debug action which display details on how the result ordering is generated, based on weight.

https://www.itophub.io/wiki/media?media=extensions%3Aglobalsearchdebug.pnghttps://www.itophub.io/wiki/media?media=extensions%3Aglobalsearch-expend-search.png
  • user_level lock has a MySQL provided weight

  • “user_level lock” has the above weight * sentence_weight_factor

  • Total Score is the sum of the various scores * object_weight_factor

Get from your users “sampling searches” on your real data, with the object expected to be in the top 5 results. Then change the various parameters, checking the result using the Debug action on those “sampling searches”.

Usage

Just type the words in the global search field, then enter or click on the magnifier icon to get the result :

https://www.itophub.io/wiki/media?media=extensions%3Aglobalsearch-overviewuser.png

Tips to specify your search

Add + at the beginning of required word

UserRequest:+PHP error 

will search for User Requests which contain mandatorily 'PHP' and maybe 'error'

Add - at the beginning of excluded word

UserRequest:PHP -closed 

will search for User Requests which contain 'PHP' but not 'closed' (this exclude all UserRequest with status=closed)

Add * at the end of an incomplete word

Organization:Combo* Grenoble

will search for Organization which contain a word starting with 'Combo' and the exact word 'Grenoble'. This is useless in single word search, as it does it automatically.

Restricting the search to a class

By default the search searchs on all Classes with category searchable, including abstract classes, such as Ticket, Contact or FunctionalCI.

Restrict previous search to a single classExpend back to all classes
https://www.itophub.io/wiki/media?media=extensions%3Aglobalsearch-restrictsearch.pnghttps://www.itophub.io/wiki/media?media=extensions%3Aglobalsearch-classsearch.png
https://www.itophub.io/wiki/media?media=extensions%3Aglobalsearch-expendsearch.png

Add <class-name>: at the beginning of a search pattern to limit the search to objects of this classe or one of its descendants

FunctionalCI:combodo

will search for any FunctionalCI which contains “combodo”, so the returned objects can be Server, PC, Enclosure,…

The class name can be the internal name (like FunctionalCI) of the display name in the current language used (like CI fonctionnel).

Displaying matching words

A menu allow to display some of the fields which have matched the requested pattern

https://www.itophub.io/wiki/media?w=600&tok=0fe437&media=extensions%3Aglobalsearch-matching-fields.png

Displaying related objects

On each returned object, you can request related objects: https://www.itophub.io/wiki/media?w=600&tok=24299c&media=extensions%3Aglobalsearch-relatedobject.png

标签:
由 superadmin 在 2020/08/27, 16:07 创建
    

需要帮助?

如果您需要有关XWiki的帮助,可以联系:

深圳市艾拓先锋企业管理咨询有限公司