matchID-project / validation

STANDALONE APP :eye: User Interface for validation of matchID's matches :couple: :two_men_holding_hands: :two_women_holding_hands:
3 stars 2 forks source link

More elegant query for random documents in ES ? #8

Closed tainmar closed 7 years ago

tainmar commented 7 years ago

This query should pick random documents in ES :

{ 
  "query": {
    "function_score": {
      "query": {
        "match_all": {}
      },
      "functions": [
        {
          "random_score": {}
        }
      ]
    }
  }
}
tainmar commented 7 years ago

https://www.elastic.co/guide/en/elasticsearch/guide/current/random-scoring.html