Hello, thank you for your responses, it is really helpful.
I have a question but may be it is similar to other. I have one index with a lot of types with different mapping. At some moment i need to delete one field only from one type, as I understand I have to reindex whole index but how to do it correctly?
I see this way:
get mapping from existing index type and copy it without field to delete; (mapping is created dynamically so I don't know exactly about it and have to ask it for each type)
create new index with types and put this new mapping
scroll all documents of existing index types
index them without deleted field with bulk into new index
drop old index
set alias to new index (i need the same name for index) - there is no way to rename index except to reindex everything again
I suppose this issue is usual. This way seems me very heavy. May be I lost something and my issue may be solved by script or reindex plugin or something else???
get mapping from existing index type and copy it without field to delete; (mapping is created dynamically so I don't know exactly about it and have to ask it for each type)
create new index with types and put this new mapping
If all your mappings are dynamic then you can skip this step altogether, and just rely on dynamic mappings.
If you want to create mappings yourself, you can just do GET {index}/_mapping to get all the mappings or GET {index} to get all the mapping, settings, and aliases in one step. You can use this response as a basis for creating your new index. (You'll need to delete some index settings like created_date, version.*, uuid).
scroll all documents of existing index types
index them without deleted field with bulk into new index
You can do this with the reindex API and a script, eg:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.