I have a problem when i have to update a same document with tow different thread ,
for example : there is a document like this:
{id = 1 , ware_sku=1 ,ware _ware= 2 , ……..},
but i know that the Partial Updates to Documents will have three step , retrieve - delete - reindex .
so there is a question : thread2 send update request which the source is “{ware_sku = 3} , the document will be delete ,and reindex, on the same time , the thread 1 send update request ({ware_ware= 3}) too , now thread1 maybe not retreive this document because thread2 delete it ?
is there has this problem? or I understand something wrong ?
I got it, and I set retryOnConflict parameter as 10 on a updating, and it seems all right .
But there is another question , any thread wouldn't ever see the index in between those two steps?
if the thread1 is scrolling some documents and maybe do something for them (like update . delete etc.), and thread 2 is updating a document which should be fetch by thread1 , then can the thread 1 see this document in between the "delete" and "reindex" steps?
thread1 will see a point-in-time view of the index (assuming you're using scan/scroll), and so it will not see any of the changes thread2 is making, and certainly not in between the delete + add of a single document that you are updating since that's atomic to Lucene.
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.