Elasticsearch-dsl-py: Couldn't find a way adding min_score to query body

Created on 11 Sep 2016  路  1Comment  路  Source: elastic/elasticsearch-dsl-py

GET /_search
{
    "min_score": 0.5,
    "query" : {
        "term" : { "user" : "kimchy" }
    }
}

Documents are here: min_score

I found that neither q = Q('query_string', query=str_query, min_score=4.0) nor Search().query(q, min_score=4.0) would work.

And, if it isn't going to be supported by elasticsearch-dsl, is there any way to filter result by score?

Most helpful comment

the min_score is a top-level argument in the body, to inject your keys into the body you can use the extra method. so in this case: s = Search().query().extra(min_score=4.0)

Hope this helps

>All comments

the min_score is a top-level argument in the body, to inject your keys into the body you can use the extra method. so in this case: s = Search().query().extra(min_score=4.0)

Hope this helps

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SalahAdDin picture SalahAdDin  路  4Comments

primoz-k picture primoz-k  路  4Comments

quasiben picture quasiben  路  4Comments

njoannin picture njoannin  路  3Comments

abuzakaria picture abuzakaria  路  4Comments