Hi there,
I need to get N random documents that have a given term in a string field.
I tried something like the following, but it is still giving me the documents in asc order.
curl -XPOST 'localhost:9200/_search?pretty' -d '{
"query": {
"function_score" : {
"query" : {"match": {"body": "happy"}},
"random_score" : { "seed" : 1234 }
}
}
}'
any idea, how to get random N documents.