Same query retrieves different results

(Eduardo Patron) #1

I got some strange behavior that I don't know if I need to do some configuration or is elasticsearch nature.

If I use a query multiple times, sometimes I get different results.

For example, on the first run I could get [1, 2, 3, 4, 5, 6 ,7, 8, 9, 10]

then I may get [10, 1, 2, 3, 4, 5, 6, 7, 8, 9]

or [1, 2, 3, 4, 5, 6, 7, 8, 9, 11]

This inconsistency in results for the same query is causing me problems.

Is there a way to avoid this?

I use localhost:9200/myIndex/myType/_search?search_type=dfs_query_then_fetch

(David Pilato) #2

What kind of problem this is causing ?

(Eduardo Patron) #3

I need consistency in the results. I need go through the entire index to generate a file with the results (like a catalog). Getting different results causes that sometimes I get repeated results or sometimes some documents are omitted.

(David Pilato) #4

If you want to extract data, use scroll API.
But I'm not sure I understood the use case.

Could you share two different resultset and also the query you are running?

(system) #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.