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.

http:
//localhost:9200/sampleindex/_search?search_type=scan&scroll=60m&size=1000

{
"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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/6bf71a02-6be2-409c-97a7-45dc03d6f5d1%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #2