You can specify full text search function in the model. Because it uses a dedicated search index, the search speed is greatly improved.
The full-text search function is a relational database to useSeparatelyWe will use an index file dedicated to searching.It is suitable for the following applications.
This is an example of full text search applied to "name" "remarks" item of customer model.Two tabs are prepared for the search screen: "normal search" and "full text search".
Figure 2 shows the full-text search tab opened.There is only one input field.With this, you can select items in the model (specify full text search)Across the boardSearch.
Figure 3 shows the search result list display screen.In full-text search, the list display method is different.The contents of the item that is the target of the full-text search are displayed, and the keyword part is highlighted (bold).
The item "name" is used for search conditions.
In this state, "Enable Full Text Search" in "Model Item Detail Definition> Search Control> Full Text Search" is enabled.
Other settings related to full text search are as follows.
Among the items used for full-text searchIn one of themPlease apply this setting.It is used as the title when displaying search results.
These two are used in the setting of the suggestion.
It is explained in the next section.
The contents of attached files can also be subject to full-text search.It supports binary files such as Word, Excel, PowerPoint, PDF and text files such as TEXT, HTML, RTF and XML.
An example of searching with a character string included in a PDF file is shown in Fig.
When you press the "+" button on the screen, details of the file contents are displayed.The button changes to "-".(FIG. 6)
Prepare a file type item and search for it.Enable full text search and enable "Search file contents" at the same time.
Open the "Environment> Application" tab.Specify "Tika" for "Full text search> character extraction program".
You can specify "maximum number of characters that can be stored in one data item".When not specified3.3 million characters. Characters exceeding this value are not searched because they are not subject to index creation.
If you specify too large number of characters, it will take time to create the index, possibly resulting in memory shortage. Please set the number according to business requirements.Below are the guidelines for setting.
The search keyword input rules on the full-text search tab are as follows.
|AND search||Search data that contains all of the multiple keywords.||Tokyo New York London|
|OR search||Search for data that contains all of the keywords.Specify OR at the beginning.||OR Tokyo New York London|
When using the full-text search function, a list of search results is displayed based on "height of match degree of search words". Unlike ordinary Wagby list display, the item sort function does not work.
Items subject to the full-text search function are as follows.
|Item form||Item type|
|(Not recurring) single item||String, filename|
|Items in the repeating container||String, filename|
In addition, the following conditions must be satisfied.
Items that do not satisfy this condition can not be subject to the full-text search function.(Even if "Enable full text search function" is enabled, it will be ignored.)
For models that have full text search enabled, please make detailed screens.A link from the list display to the detailed display screen is always prepared.
For models with full-text search or suggestion enabled, the format of the generated source code will vary greatly.
Search index files used for full-text search are stored in the following places.
The index file is changed at the following timing.
When data is registered in the index, the size used for one data item is about 7.2 times the maximum size of the registration target. From this, the index size used in one model can be estimated as follows.
インデックスサイズ(バイト) = データ件数 × 平均登録対象サイズ × 7.2
Please give approximate numerical values from the number of character strings stored in the item to be subjected to full text search and the number of text character strings included in the attached document for the average registration target size.
An index file to be used for full-text search and an index file to be used in a suggestion are prepared separately.
N-gram index method is adopted.The value of N uses 2 (bigram).
This is to register two characters at a time while shifting each character one by one from the beginning of the string as a search word.
For example, "Tokyo" in the case of the character string "Tokyo" "Kyoto" is the search term.The concrete search operation is as follows.
For single-byte alphabet letters, however, it is necessary to register a division by a delimiter such as space.
For example, in the case of "orange pineapple banana", divide it into "orange", "pineapple", "banana" and register each as a search word.For this reason, if "apple" is entered as a search word, it will not hit, but "pine" will hit.
Register the character string as it is without dividing it as it is. If the character string exceeds 64 characters, register 64 characters from the beginning.
For Suggest, it will be a match search from the beginning.For example, "North" hits against the string "Kitakyushu", but "Kyushu" does not hit.
The index file can be kept constant by performing the optimization processing on a regular basis. Wagby performs optimization processing at the following timing.
To run the application without stopping, set the index optimization job.
If the index file is corrupted for some reason, you can recreate it with the following procedure.
When optimizing the index of a specific model, for example, to optimize the index of the sample model, delete the following folder.
Also, when optimizing the entire index, delete the entire following folder.
There is "Suggest search" as an application example of full-text search. For details, please read "Reference other models> Suggest".