Function score - random score and Scan query?

(Mark Conlin) #1

I am attempting to read N random docs from an index. To do this I was using
function_score query with a match all query and a random_score.

For a non scan search this works great. I get a different random set of
docs each time.

For a scan search (lets say N is really big), this doesn't appear to work.
Subsequent calls using the scroll ids returned are always the same order.


"query": {
"function_score": {
"query": {
"match_all": {}
"random_score": {}

I have tried setting random seeds, but that did not make the scan query
return docs in a random order.
'random_score': {'seed': 11819}

Any thoughts?

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
To view this discussion on the web visit
For more options, visit

(system) #2