elasticsearch - Multi-fields in elasticsearch - elastic - elastic search - elasticsearch tutorial - elasticsearch docker



Multi-fields in elasticsearch

Sometimes it maybe useful to have multiple distinct indexes of a field with different Analyzers. You can use the multi-fields capability to do so.

PUT my_index 
{
  "mappings": {
    "user": {
      "properties": {
        "name": {
          "type": "string"
          "analyzer": "standard",
          "fields": {
            "special": {
               "type": "string",
               "analyzer": "my_user_name_analyzer"
            },
            "unanalyzed": {
              "type": "string",
              "index": "not_analyzed"
            }
          }
        }
      }
    }
  }
}
Clicking "Copy Code" button will copy the code into the clipboard - memory. Please paste(Ctrl+V) it in your destination. The code will get pasted. Happy coding from Wikitechy - elasticsearch - elasticsearch tutorial - elastic - elastic search - elasticsearch docker team

When querying, instead of simply using "user.name" (which in this case would still use the stanard Analyzer) you can use "user.name.special" or "user.name.unanalyzed". Note that the document will remain unchanged, this only affects indexing.


This elasticsearch tutorial provides fllowing articles and keypoints on hosted elasticsearch , elasticsearch monitoring , elasticsearch service , aws elastic search , elk elasticsearch , amazon elasticsearch , azure elasticsearch , aws elasticsearch , elastic , elastic search , elasticsearch logstash kibana , elasticsearch security , elasticsearch pricing , elasticsearch alternatives , elasticsearch hadoop , elasticsearch documentation , elasticsearch kibana , elastic co , elasticsearch , elasticsearch download , logstash elasticsearch , what is elasticsearch , elasticsearch vs mongodb , elasticsearch architecture , elasticsearch database , install elasticsearch , elasticsearch mongodb , elasticsearch document , elasticsearch marvel , elasticsearch shield , elasticsearch sense , elasticsearch analyzer , elasticsearch getting started , elasticsearch bulk , elasticsearch 5 , elasticsearch gui , elasticsearch tutorial

Related Searches to Multi-fields in elasticsearch