0

まず第一に、私はESに完全に慣れていません。正常に機能するアイテムを検索するために、以下の ES 検索条件を作成しましたが、今必要なのは、makeフィールドを大文字と小文字を区別しないようにして、検索結果が 、 などで同じになるhelloようHeLloHELLOすることです。

以下の記事を読んだことがありますが、知識が非常に限られているため、以下の例には静かに適用できませんでした。

makenot_analyzedから削除しても役に立ちません。

'indexes' => [
    'my_project' => [
        'client' => 'default',
        'index_name' => 'hello',
        'settings' => [
            'index' => [
                'analysis' => [
                    'analyzer' => [
                        'snowball_analyzer' => [
                            'type' => 'snowball',
                            'language' => 'English',
                        ],
                    ],
                ],
            ],
        ],
        'types' => [
            'item' => [
                'mappings' => [
                    'uuid' => ['type' => 'string', 'index' => 'not_analyzed'],
                    'name' => ['type' => 'string', 'boost' => 8, 'analyzer' => 'snowball_analyzer'],
                    'make' => ['type' => 'string', 'index' => 'not_analyzed'],
                ]
            ],
        ],
    ],
],

これらは私が作成したクエリです:

1

{
  "query": {
    "filtered": {
      "query": {
        "bool": {
          "must": [
            {
              "term": {
                "make": "HeLlo"
              }
            }
          ]
        }
      }
    }
  }
}
4

2 に答える 2