Hi,
I recently used a custom document_id to avoid duplicate in ES. However, I found that the same document can be indexed in different indices. Is there a way to make sure the document itself is unique in ES? Thank you very much.
Hi,
I recently used a custom document_id to avoid duplicate in ES. However, I found that the same document can be indexed in different indices. Is there a way to make sure the document itself is unique in ES? Thank you very much.
Hey,
no, this needs to be done on the client side. Adding the index name to the id might be sufficient already there.
--Alex
Hi Alex,
Thanks for your reply. Actually I have a custom id as a combination of several fields from the log. My problem is, in the same index, the id will avoid duplicate. However, if the same message gets indexed in different indices, then two identical logs will exist. Is there a way to make sure that, with the unique id, there will only be one record in ES, among indices? Thank you so much.
--Tao
Hey,
no, there is no guarantee for that within ES.
--Alex
Hi Alex,
Thanks for your reply. Does it mean that with the default routing value (as document id), ES can only ensure the document id is unique in the same index?
--Tao
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
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.