>>-+----------------------+--+-------------------------+--------> '-RESULT LIMIT--number-' '-EXPANSION LIMIT--number-' >--+------------------------------------------+-----------------> '-STOP SEARCH AFTER--number--+-DOCUMENT--+-' '-DOCUMENTS-' >--+-| boolean-search-expression |-+--------------------------->< '-| freetext-argument |---------' Boolean-search-expression |--+-| search-term |-------------------------------------------------+--| '-| boolean-search-expression |--| operator-or |--| search-term |-' search-term |--+-| search-factor |-----------------------------------------------+--| +-| search-term |--| operator-and |--| search-factor |------------+ +-| search-term |--| operator-accum |--| search-factor |----------+ '-| search-term |--| operator-minus |--| positive-search-factor |-' Search-factor |--+-----+--| positive-search-factor |--------------------------| '-NOT-' Positive-search-factor |--+-+------------------------------------------------------------+--| search-primary |-+--| | | .-,----------------------------------. | | | | V | | | | '-+-SECTION--+--(----"section-name"--+----------------+-+--)-' | | '-SECTIONS-' '-WEIGHT--number-' | '-attribute-factor-------------------------------------------------------------------' Search-primary |--+-| text-literal |-------------------+-----------------------| +-| context-condition |--------------+ +-| thesaurus-invocation |-----------+ +-(--| boolean-seach-expression |--)-+ '-(--| text-literal-list |--)--------' Operator-and |--&------------------------------------------------------------| Operator-or |--|------------------------------------------------------------| Operator-accum |--ACCUM--------------------------------------------------------| Operator-minus |--MINUS--------------------------------------------------------| Context-condition |----| context-argument |--| IN-SAME |--| context-unit |--| AS |--| context-argument |----> >--+-------------------------------+----------------------------| | .---------------------------. | | V | | '---AND--| Context-argument |-+-' Context-argument |--+-| text-literal |------------+------------------------------| +-(--| text-literal-list |--)-+ '-| thesaurus-invocation |----' Text-literal-list .-,------------. V | |----text-literal-+---------------------------------------------| Context-unit |--+-PARAGRAPH-+------------------------------------------------| '-SENTENCE--' Text-literal |--+--------------------------------+--+----------------+-------> +-PRECISE-FORM-OF----------------+ '-WEIGHT--number-' +-STEMMED-FORM-OF----------------+ '-FUZZY-FORM-OF--+-------------+-' '-match-level-' >--"word-or-phrase"--+----------------------------+-------------| '-ESCAPE--"escape-character"-' thesaurus-invocation |--THESAURUS--"thesaurus-name"--EXPAND--------------------------> >--+-+-SYNONYM------------+--TERM OF--| text-literal |-------------------+--| | +-RELATED------------+ | | '-RELATION--(number)-' | '-+-BROADER--+--TERM OF--| text-literal |--+------------------------+-' '-NARROWER-' '-FOR--count--+-LEVEL--+-' '-LEVELS-' Attribute-factor |--ATTRIBUTE--"attribute-name"----------------------------------> >--+-BETWEEN--valueFrom AND valueTo-+---------------------------| +->--valueFROM-------------------+ '-<--valueTO---------------------' freetext-argument |--IS-ABOUT--+----------+--"word-or-phrase"---------------------> '-language-' >--+----------------------------+-------------------------------| '-ESCAPE--"escape-character"-'
Examples
Examples are given in Specifying SQL search arguments.
Search parameters
The RESULT LIMIT should be used together with the SCORE function to ensure that the returned results are scored and only the best results are processed.
Note that there is no default value and the number value must be a positive integer.
"Pilot" MINUS "passenger" & "vehicle" | "transport" & "public"
is evaluated as:
(("Pilot" MINUS "passenger") & ("vehicle")) | ("transport" & "public")
The operator ACCUM evaluates to true, if one of the boolean arguments evaluates to true (which is comparable to the OR operator). The rank value is computed by accumulating rank values from both operands. The ACCUM operator has the same binding (precedence) as AND. The operator MINUS evaluates to true, if the left operand evaluates to true. The rank value is computed by taking the rank value for the left operand and subtracting a penalty, if the right operand evaluates to true.
A keyword specifying one or more sections in a structured document that the search is to be restricted to. The section name must be specified in a model file specified at index creation time, see CREATE INDEX.
Section names are case sensitive. Ensure that the section name in the model file and query is identical.
This model describes the structure of documents that contain identifiable sections, so the content of these sections can be individually searched. Section names cannot be masked using masking characters. The positive-search-factor using the SECTION clause evaluates to true, if the search primary is found in one of the sections.
The condition evaluates to true, if there is a context-unit (paragraph respectively sentence) in the document, which contains at least one of the text-literals of each expanded context-argument. This can be seen in the following example:
("a","b") IN SAME PARAGRAPH AS ("c","d") AND THESAURUS "t1" EXPAND SYNONYM TERM OF "e".
Assuming e1, e2 as synonyms of e, the following paragraphs would match:
".. a c e .." , ".. a c e1..", "a c e2..", ".. a d e .." , ".. a d e1..", "a d e2..", ".. b c e .." , ".. b c e1..", "b c e2..", ".. b d e .." , ".. b d e1..", "b d e2..".
The way in which words are reduced to their stem form is language-dependent. Currently, only English is supported and the word must follow regular inflection endings.
To search for a character string that contains double quotation marks, type the double quotation marks twice. For example, to search for the text "wildcard" character, use:
"""wildcard"" character"
Note that in the example, it is only possible to search for one set of quotation marks. You cannot search for two quotation marks in a sequence. There is also a maximum length of 128 bytes for each word or phrase.
For user-defined relations, use RELATION(number), that corresponds to the relation definition in DB2TEXTTH.
The text-literal, to which other search terms are to be added from the thesaurus.
A keyword used to specify the number of levels (the depth) of terms in the thesaurus that are to be used to expand the search term for the given relation. If you do not specify this keyword, a count of 1 is assumed. The value of depth must be a positive integer value.
The attribute-factor is allowed for attributes of type double only. The precision of the value is guaranteed for 15 digits. Numbers of 16 characters and above are rounded. Usage of masking characters is not allowed in attribute-name, valueFrom and, valueTo. For an explanation, see the following:
If the attribute name in the CREATE INDEX command is specified with quotes, or is defined in a model file, the specified attribute name must match exactly. Whereas, if no quotes are specified in the CREATE INDEX command, the attribute name must be in uppercase.
The values allowed for language are described in Appendix E, Supported languages, and are only relevant for the Thai language. If not specified, the language en_US is used as default. The language is used only for tokenization of the word-or-phrase.
Note that IS ABOUT is useful only if the score values are requested and the search results are ordered by score values.