Support > Repository > Search control > Full text search
ja | en

You can specify full text search function in the model. Because it uses a dedicated search index, the search speed is greatly improved. R7.2

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.

  • Search a large amount of character information at high speed.
  • Search contents of attached files at high speed.

Example of operation

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 1 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 2 Full text search tab

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).

Fig. 3 List display of full text search

Setting method

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.

Figure 4 Full-Text Search Settings

Other settings related to full text search are as follows.

Use as the title of the search result

Among the items used for full-text searchIn one of themPlease apply this setting.It is used as the title when displaying search results.

String matching method

Simultaneous display number of candidate list

These two are used in the setting of the suggestion.

Search contents of file

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.

Figure 5 Full text search of PDF file

When you press the "+" button on the screen, details of the file contents are displayed.The button changes to "-".(FIG. 6)

Figure 6 Contents (partial) of the PDF file are displayed

Item setting

Prepare a file type item and search for it.Enable full text search and enable "Search file contents" at the same time.

Figure 7 Setting to search the contents of the file

Open the "Environment> Application" tab.Specify "Tika" for "Full text search> character extraction program".

Apache Tika is an open source text string extraction library.It is bundled with Wagby as standard.

Figure 8 Setting of character extraction program

Maximum number of characters that can be stored in one data item

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.

  • It is said that the morning paper of the newspaper is around 40 - 500 thousand letters.(The standard value corresponds approximately to the morning edition of 7 days.)
  • If you define a model that allows files to be attached to repeating containers, it is the upper limit of the total number of characters of multiple files.

Search rule input rule

The search keyword input rules on the full-text search tab are as follows.

rule Description An example
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
  • To specify multiple keywords, separate them with "one-byte space" or "double-byte space".
  • To search for double-byte space itself, enclose it in double quotation marks.
  • Please use one-byte characters for "OR".Uppercase and lowercase letters are not distinguished.
  • Keywords are2 characters or moreIs required.You can not search with one-character keywords.

order of display

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 that can be specified

Items subject to the full-text search function are as follows.

Item form Item type
(Not recurring) single item String, filename
Repeat item String
Items in the repeating container String, filename

In addition, the following conditions must be satisfied.

  • Reference authority (conditional) is not set.
  • It must not be set as a hidden item on the list display screen.

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.)

Detail screen required

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.

Considerations in Java customization

For models with full-text search or suggestion enabled, the format of the generated source code will vary greatly.

Where the index file is stored

Search index files used for full-text search are stored in the following places.

Wagbyapp \ webapps \ wagby \ WEB-INF \ idxdir \ model name

When the index file is changed

The index file is changed at the following timing.

  • Change data (new registration, update, delete)
  • Import processing
  • Index optimization processing

Index size

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.

Index size (bytes) = Number of data items × Average registration target size × 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.

The size of the index file is larger than the size of the data to be handled. Especially when you enable full-text search function of attached file index size becomes huge. Make sure that enough disk space for indexes is secured as well as disk space for data pacing.

Index generation rule

An index file to be used for full-text search and an index file to be used in a suggestion are prepared separately.

Full text search

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.

  • "East" will not hit.
  • It will hit in "Tokyo".
  • It does not hit in "Kyo".
  • "Kyoto" will hit.
  • It hits in "Tokyo".

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.

Suggest

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.

Index optimization processing

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.

Recreate the index file manually

If the index file is corrupted for some reason, you can recreate it with the following procedure.

Since the index file is a file for searching, data will not be corrupted even if it is damaged.
  1. Stop the web application.
  2. Delete the index file.

    When optimizing the index of a specific model, for example, to optimize the index of the sample model, delete the following folder.

    wagbyapp\webapps\wagby\WEB-INF\idxdir\sample

    Also, when optimizing the entire index, delete the entire following folder.

    wagbyapp\webapps\wagby\WEB-INF\idxdir
  3. Launch the web application.The index is optimized after index creation during initialization processing.

There is "Suggest search" as an application example of full-text search.For details, refer to "Other models" SuggestPlease read.