0

I have the following elasticsearch _settings below, is my assumption correct that the 'analysis' under 'settings' are not yet activated unless it is explicitly mapped on any 'person' field? If it is not explicitly mapped to any person field, it is not affecting in anyway how the searches are done. Is my assumption correct?

{
    "person": {
        "settings": {
            "index": {
                "number_of_shards": "1",
                "analysis": {
                    "filter": {
                        "whitespace_remove": {
                            "pattern": "\\s",
                            "type": "pattern_replace",
                            "replacement": ""
                        },
                        "name_ngrams_front": {
                            "min_gram": "2",
                            "side": "front",
                            "type": "edge_ngram",
                            "max_gram": "16"
                        },
                        "name_ngrams_back": {
                            "min_gram": "2",
                            "side": "back",
                            "type": "edge_ngram",
                            "max_gram": "16"
                        }
                    },
                    "analyzer": {
                        "name_analyzer": {
                            "filter": [
                                "lowercase",
                                "asciifolding",
                                "german_normalization",
                                "name_ngrams_front"
                            ],
                            "type": "custom",
                            "tokenizer": "whitespace"
                        },
                        "ignore_case_and_whitespace_analyzer": {
                            "filter": [
                                "lowercase",
                                "whitespace_remove"
                            ],
                            "type": "custom",
                            "tokenizer": "standard"
                        },
                        "ik_max_word": {
                            "filter": [
                                "lowercase",
                                "asciifolding",
                                "german_normalization",
                                "name_ngrams_front"
                            ],
                            "type": "custom",
                            "tokenizer": "whitespace"
                        },
                        "ik_smart": {
                            "filter": [
                                "lowercase",
                                "asciifolding",
                                "german_normalization",
                                "name_ngrams_front"
                            ],
                            "type": "custom",
                            "tokenizer": "whitespace"
                        }
                    },
                    "tokenizer": {
                        "name_ngrams_tokenizer": {
                            "type": "edge_ngram",
                            "min_gram": "2",
                            "max_gram": "16"
                        }
                    }
                },
                "number_of_replicas": "1",
            }
        }
    }
}

Thanks in advance--------------------------------------

P.J.Meisch
  • 18,013
  • 6
  • 50
  • 66
Java2Avaj
  • 23
  • 4

1 Answers1

0

Yes, your understanding is correct. You have just defined the Analyzer and it will impact only when you assign it to specific field otherwise it is not imapct your search or indexing process.

You can assign customer analzyer as shown below to specific field.

PUT my-index-000001
{
   "mappings":{
       "properties":{
          "title": {
             "type":"text",
             "analyzer":"name_analyzer"
         }
      }
   }
}
Sagar Patel
  • 4,993
  • 1
  • 8
  • 19