ElasticSearchの標準分詞器とキーワード分詞器

1538 ワード

ひょうじゅんぶんき
分詞器が指定されていない場合、標準分詞器standardがデフォルトの分詞器として使用される.
POST _analyze
{
  "analyzer": "standard",
  "text": "The 2 QUICK Brown-Foxes jumped over the lazy dog's bone."
}
[ the, 2, quick, brown, foxes, jumped, over, the, lazy, dog's, bone ]

ひょうじゅんぶんきせってい
  • max_token_length:最大タグ長.マークがこの長さを超える場合は、この長さを間隔として、デフォルト255です.
  • stopwords:_english_などの予め定義された停止語または停止語を含む配列.デフォルト_none_.
  • stopwords_path:停止語のファイルパス.

  • 使用例の構成
    PUT my-index-000001
    {
      "settings": {
        "analysis": {
          "analyzer": {
            "my_english_analyzer": {
              "type": "standard",
              "max_token_length": 5,
              "stopwords": "_english_"
            }
          }
        }
      }
    }
    POST my-index-000001/_analyze
    {
      "analyzer": "my_english_analyzer",
      "text": "The 2 QUICK Brown-Foxes jumped over the lazy dog's bone."
    }
    [ 2, quick, brown, foxes, jumpe, d, over, lazy, dog's, bone ]

    キーワード分詞器keyword分詞器は、入力された文字列を単一のタグとしてそのまま返す「空転」分詞器である.
    POST _analyze
    {
      "analyzer": "keyword",
      "text": "The 2 QUICK Brown-Foxes jumped over the lazy dog's bone."
    }
    [ The 2 QUICK Brown-Foxes jumped over the lazy dog's bone. ]