Custom analyzer for search and indexing

Hello, when creating an index I specifically created a custom analyzer which should be used for indexing and searching (see the example code below)

  "settings": {
     "analysis": {
      "analyzer": {
        "custom_name_analyzer": {
          "type": "custom",
          "tokenizer": "keyword",
          "filter": [
            "lowercase",
            "asciifolding",
            "word_delimiter"
          ]
        }
      }
    }
  }

It is used for a name field in a document like this:

  "mappings": {
    "dynamic": "false",
    "properties": {
      "name": {
        "properties": {
          "cs": { "type": "text",
                  "analyzer":  "custom_name_analyzer",
                  "search_analyzer": "custom_name_analyzer"
          }
        }
      }

However, when I do GET <index-name>/_mapping, I do not see the search_analyzer being provided.
What is the reason for it?
How can I determine which analyzer is used for searching in this case?

If you just specify an analyzer, this will be used for both indexing and search. In your case you therefore do not need to specify the search_analyzer as it is not different from the analyzer. If you in the mapping see the analyzer correctly set and no search_analyzer specified, I suspect it is possible Elasticsearch has rationalised this as they are the same and that would be the standard way of configuring it.

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