trenpixster
trenpixster

Reputation: 390

Elastic Search truncating hits.total via score

Is it possible to execute a query and filter it so that only elements with score > 1.0 are considered in the hits.total response?

Upvotes: 1

Views: 326

Answers (1)

James Addison
James Addison

Reputation: 3094

I believe you can use min_score to achieve this (http://www.elasticsearch.org/guide/reference/api/search/min-score/). The ES docs example:

{
    "min_score": 0.5,
    "query" : {
        "term" : { "user" : "kimchy" }
    }
}

As the docs also say, this isn't usually practical because scoring is a relative calculation. If you're heavily influencing the results however, it might be what you need.

Upvotes: 3

Related Questions