Keyword analyzer

The Keyword analyzer converts input text into a single token without alteration.

The Keyword analyzer is useful if you want to index single words exactly as they are, however, any type of input text is indexed. You cannot search a range or specify a thesaurus on text indexed by the Keyword analyzer.

The Keyword analyzer processes text characters in the following ways:

  • Stopword lists are ignored. All words are indexed.
  • Alphabetic characters are not converted to lowercase.
  • Numeric and special characters are indexed.
  • White spaces are indexed. Queries for text that includes white spaces must escape each white space by a backslash (\) character.
  • If the analyzer name is keyword.rt, removes trailing white spaces during indexing and querying.
  • If the analyzer name is keyword, indexes trailing white spaces.
    • For indexed columns that have fixed-length data types, the keyword analyzer adds white spaces as necessary to reach the column length. For example, if the text column is of type CHAR(6) and a string has three characters, abc, the string is indexed with three trailing white spaces, regardless of whether the string included one or more trailing white spaces: abc . Queries require the correct number of escaped trailing white spaces: for example, abc\ \ \ .
    • For indexed columns that have variable-length data types, any trailing white spaces that are included in the string are indexed. For example, if the text column is of type LVARCHAR, the string abc with one trailing white space is indexed as a different token from the string abc with two trailing white spaces. Queries require the correct number of escaped trailing white spaces: for example, abc\ or abc\ \ .

Examples

In these examples, the input string is shown on the first line and the resulting tokens are shown on the second line, each surrounded by square brackets. The following examples show that the entire input string is preserved exactly as is:

The Quick Brown Fox Jumped Over The Lazy Dog
[The Quick Brown Fox Jumped Over The Lazy Dog]

-12 -.345 -898.2 -56. -
[-12 -.345 -898.2 -56. -]

XY&Z Corporation 
[XY&Z Corporation] 

xyz@example.com 
[xyz@example.com]

The following query string searches for the string The Quick Brown Fox Jumped Over The Lazy Dog:

'The\ Quick\ Brown\ Fox\ Jumped\ Over\ The\ Lazy\ Dog'