analyzer clause

更新时间:
复制 MD 格式

Use the analyzer clause to control which analyzer the query engine applies to each field at query time. The system converts field values to terms using the analyzers you specify, overriding any schema-level defaults on a per-field basis.

The analyzer clause is optional. Omit it to use the analyzers defined in the index schema.

Syntax

{
  "analyzer": {
  }
}

Each key inside analyzer is an index field name; the value is the analyzer assigned to that field.

Parameters

ParameterDescription
no_tokenize_indexesFields whose values the query engine should not convert to terms. Other text processing — such as normalization and stop word filtering — still applies. Use this parameter for all analyzers except keyword.
specific_index_analyzerA per-field analyzer override. Takes higher priority than the analyzer defined in the index schema. Analyzers specified here must be defined in analyzer.json. Use this parameter to assign the keyword analyzer to a field.

Example

The following example assigns a different analyzer to each field in the query:

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