I'm trying to use polling on an index in order to retrieve the latest state (my document contain state) per managed entity.
I can't use the timestamp since the same timestamp can be used for multiple documents. In addition, since documents are indexed in parallel, it may be that a later document is indexed before earlier document.
I tried to use the search_after feature but it is not working as expected - for example, having the following doc:
doc1, t1, _id1
doc2, t1, _id2
doc3, t2, _id3
doc4, t2, _id3
when using the search_after with t1, _id2 - i don't get doc3 and doc4.