According to the documentation, you know when you have reached the end of the scroll results when you receive zero hits in the response. However, if your SearchType is SCAN, then you receive zero hits in the *first* result, The question is how to avoid this ambiguity.
My code that handles the scrolling results doesn't know what the SearchType is - so it doesn't know how to differentiate between the two scenarios of in which we receive zero hits. Can the end of the results not be signalled through the scrollId? I kind of expected the scrollId to be null when we reached the end of the results (but I can see its not). That said, I do notice that when the end of the results are reached, the scrollId stops changing - and its also a lot shorter - and also it seems to always be the same value (c2NhbjswOzE7dG90YWxfaGl0czoxOw==) -- You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/6a9da841-1c70-4179-a0ba-b6f145363e23%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
