The analyzer clause

更新时间:
复制 MD 格式

Clause description

The analyzer clause specifies how to tokenize a query string. You can use this clause to define the tokenization method for specific indexes or to disable tokenization for certain indexes.

Clause syntax

{
  "analyzer" : {
  }
}

The analyzer clause is optional. In this clause, each index_name corresponds to an analyzer. All analyzers are of the no_tokenize_indexes type, except for the keyword analyzer, which is a specific_index_analyzer.

Analyzer type

Description

no_tokenize_indexes

Disables tokenization for specified indexes in a query. Other processes, such as normalization and stop word removal, still run as normal.

specific_index_analyzer

Uses a different tokenizer for a specified index in a query. This tokenizer overwrites the schema's tokenizer. The specified value must be configured in the analyzer.json file.

Example:

{
  "analyzer" : {
    "title" : "chn_standard",
    "description" : "single",
    "category" : "fuzzy",
    "uid" : "keyword"
}