0
votes

I didn't found any change in my search result even after updating some fields in my index[_mapping]. so i want to know that "Will updating "_mappings" reflect re-indexing data in Elastic search" [or] "only data inserted after updation will effect with those index parameters[settings n mappings]"

EX:

Initially i've created my index fields as following

           "fname":{  
                 "type":"string",
                 "boost":5
              }
          "lname":{  
                 "type":"string",
                 "boost":1
              }

then i inserted some data. its working fine.

After updating my index mapping as following,

          "fname":{  
                 "type":"string",
                 "boost":1
              }
          "lname":{  
                 "type":"string",
                 "boost":5
              }

Still after updating boost values in index, also i'm getting same result.... why?

     1: after each and every updation of index [settings n mapping], will elastic-search re-index the data again?
     2: do we have different indexed data in same item-type?

Plz clarify this.

1
:-) no, you need to re-index everything to see the changes for the old data: elastic.co/guide/en/elasticsearch/guide/current/reindex.htmlAndrei Stefan
First of all Thank you very much for your response Mr. Andrei Stefan. So we have to do re-index for each and every updation on index...am i correct?Pavan Kumar Varma
Not quite all changes to mappings. You can add new types to an index, or add new fields to a type.Andrei Stefan
Understood...could you please suggest any smarter way to do reindexing..@Andrei StefanPavan Kumar Varma
elastic.co/guide/en/elasticsearch/guide/current/… and, also, the already provided link.Andrei Stefan

1 Answers

-1
votes

While you can add fields to the mappings of an index, any other change to already existing fields will either only operate on new documents or fail.

As mentioned in the comments to the question, there is an interesting article about zero-downtime index switching and there is a whole section about index management in the definitive guide.