ElasticSearch Nested Search Analyzer not working

12 Views Asked by At

Index Creation

I'm creating index with nested property and assigning analyzers to it both index and search time as follows.

PUT /test_index_pasu
{
  "settings": {
    "analysis": {
      "analyzer": {
        "keyword_analyzer": {
          "tokenizer": "keyword",
          "filter": [
            "lowercase",
            "asciifolding"
          ]
        }
      }
    }
  },
  "mappings": {
    "properties": {
      "groups": {
        "type": "nested",
        "properties": {
          "key": {
            "type": "keyword"
          },
          "values": {
            "type": "text",
            "analyzer": "keyword_analyzer",
            "search_analyzer": "keyword_analyzer",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          }
        }
      }
    }
  }
}

When I try to query (search filter) search time analyzer wasn't honored. I tried to check the GET mapping, it is missing search_analyzer anything specific needs to be done for nested search analyzer.?

Get Mapping Index

{
  "test_index_pasu": {
    "mappings": {
      "properties": {
        "groups": {
          "type": "nested",
          "properties": {
            "key": {
              "type": "keyword"
            },
            "values": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword"
                }
              },
              "analyzer": "keyword_analyzer"
            }
          }
        }
      }
    }
  }
}
0

There are 0 best solutions below