Recently, I need to build a new project to replace the old one which is based on Lucene.
But in my experiment, I have found that there is a serious restriction about updating field mapping. From this address (https://www.elastic.co/guide/en/elasticsearch/reference/6.3/indices-put-mapping.html), I see that I cannot add a new filed mapping to the existing index mapping, for example, I have a text filed called "title", but I can't append another text filed, such as "summary". The only way is to reindex the current documents.
But when I used the dynamic mapping function in Elasticsearch, it seems different. First, I create a document, which has only one field, "title", afterward, I create another document that has title and summary two filed. Now the mapping of the index has included two mapping fields.
Here are my questions:
- Is there any difference between the strict mapping declaration and dynamic mapping? Why I cannot append a new type filed to the existing index mapping, I wonder that it seems no conflict in appending operation.
- If I may append the new fields, but not modify the existing fields in a foreseeable future, what is the best way to achieve it? Since there are about 10 million documents in each index, reindex may be a heavy operation. Should I close the dynamic mapping function in the production environment, is this a more common usage?