Can someone explain how "analysis" is used on this mapping?

This is my mapping. I can't understand what is "analysis" under settings object. The filters and analyzers specified under analysis are used against "my-field-id property"?

 {
      "my-id" : {
    "aliases" : {
      "alias-1" : { },
      "alias-2" : { },
      "alias-3" : { },
      "alias-4" : { }
    },
    "mappings" : {
      "properties" : {
        "my-field-id" : {
          "type" : "text",
          "fields" : {
            "not_analyzed" : {
              "type" : "keyword"
            }
          },
          "analyzer" : "autocomplete",
          "search_analyzer" : "search_autocomplete"
        }
      }
    },
    "settings" : {
      "index" : {
        "number_of_shards" : "1",
        "provided_name" : "my-id",
        "creation_date" : "1588792793202",
        "analysis" : {
          "filter" : {
            "word_delimeter" : {
              "type" : "word_delimiter",
              "preserve_original" : "true",
              "split_on_numerics" : "false"
            },
            "autocomplete_filter" : {
              "type" : "edge_ngram",
              "min_gram" : "1",
              "max_gram" : "500"
            }
          },
          "analyzer" : {
            "search_autocomplete" : {
              "filter" : [
                "lowercase",
                "unique"
              ],
              "char_filter" : [
                "char_normalizer"
              ],
              "tokenizer" : "whitespace"
            },
            "autocomplete" : {
              "filter" : [
                "lowercase",
                "autocomplete_filter"
              ],
              "char_filter" : [
                "char_normalizer"
              ],
              "type" : "custom",
              "tokenizer" : "whitespace"
            }
          },
          "char_filter" : {
            "char_normalizer" : {
              "type" : "mapping",
              "mappings" : [
                "-=>\\u0020"
              ]
            }
          }
        },
        "number_of_replicas" : "1",
        "uuid" : "my-uuid",
        "version" : {
          "created" : "7071200"
        }
      }
    }
      }
    }

In your mapping you referenced two analyzers:

"analyzer" : "autocomplete",
"search_analyzer" : "search_autocomplete"

You defined them in the analysis part of the settings.

Was that your question?

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