Running a search against a single index for a 'post' with a given id we get
2 hits. We use _parent and use a
'userId' for the parent. The following result happens after trying reassign
the post to a different user and
reindex the post. Is _parent somehow used in the _uid?
Running a search against a single index for a 'post' with a given id
we get 2 hits. We use _parent and use a
'userId' for the parent. The following result happens after trying
reassign the post to a different user and
reindex the post. Is _parent somehow used in the _uid?
A unique ID really depends on index/type/id/routing. The routing, by
default, is derived from the ID. But if you use parent-child
relationships, it is derived from the parent.
So if you change the parent and reindex, it may or may not end up on the
same shard. If it is on a different shard, then the old doc will not be
removed.
So if you're going to change the parent, you should delete the old doc
before indexing the new doc
Running a search against a single index for a 'post' with a given id
we get 2 hits. We use _parent and use a
'userId' for the parent. The following result happens after trying
reassign the post to a different user and
reindex the post. Is _parent somehow used in the _uid?
A unique ID really depends on index/type/id/routing. The routing, by
default, is derived from the ID. But if you use parent-child
relationships, it is derived from the parent.
So if you change the parent and reindex, it may or may not end up on the
same shard. If it is on a different shard, then the old doc will not be
removed.
So if you're going to change the parent, you should delete the old doc
before indexing the new doc
Thank you Clint. That makes sense. Just wish the doc on _uid would
mention that _routing is derived from _parent when present:
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.