# ElasticSearch Nested Search Analyzer not working

**URL:** <https://discuss.elastic.co/t/elasticsearch-nested-search-analyzer-not-working/350256>\
**Category:** Elasticsearch\
**Created:** [January 2, 2024, 4:30pm UTC](https://discuss.elastic.co/t/elasticsearch-nested-search-analyzer-not-working/350256 "2024-01-02T16:30:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pasupathi-raja](https://avatars.discourse-cdn.com/v4/letter/p/c68b51/32.png) [@pasupathi-raja](https://discuss.elastic.co/u/pasupathi-raja)\
**Post date:** [January 2, 2024, 4:30pm UTC](https://discuss.elastic.co/t/elasticsearch-nested-search-analyzer-not-working/350256/1 "2024-01-02T16:30:56Z")

</div>

**Index Creation**

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

```auto
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**

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

```

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [January 2, 2024, 4:54pm UTC](https://discuss.elastic.co/t/elasticsearch-nested-search-analyzer-not-working/350256/2 "2024-01-02T16:54:16Z")

</div>

HI @pasupathi-raja

What type of problem are you facing with search\_analyzer? Do you have any example?

> Usually, the same [analyzer](https://www.elastic.co/guide/en/elasticsearch/reference/current/analyzer.html) should be applied at index time and at search time, to ensure that the terms in the query are in the same format as the terms in the inverted index.

---

<div class="post-metadata">

**Author:** ![pasupathi-raja](https://avatars.discourse-cdn.com/v4/letter/p/c68b51/32.png) [@pasupathi-raja](https://discuss.elastic.co/u/pasupathi-raja)\
**Post date:** [January 2, 2024, 4:57pm UTC](https://discuss.elastic.co/t/elasticsearch-nested-search-analyzer-not-working/350256/3 "2024-01-02T16:57:25Z")

</div>

The issue is, if you check the `Get Mapping Index` response json, `test_index_pasu.mappings.properties.groups.properties.values` missing `search_analyzer` but when I create index, I added it at `mappings.properties.groups.properties.values.search_analyzer`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 30, 2024, 4:57pm UTC](https://discuss.elastic.co/t/elasticsearch-nested-search-analyzer-not-working/350256/4 "2024-01-30T16:57:53Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
