如何在elasticsearch-dsl python中启用track_scores [英] How to enable track_scores in elasticsearch-dsl python

查看:644
本文介绍了如何在elasticsearch-dsl python中启用track_scores的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用弹性搜索dsl搜索弹性搜索: https://elasticsearch-dsl.readthedocs .org / en / latest /

I am using elasticsearch dsl to search on elasticsearch : https://elasticsearch-dsl.readthedocs.org/en/latest/

如何启用track_scores查询?

How can i enable track_scores for the query ?

我知道它在弹性搜索中的支持: https: //www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html#_track_scores

I know its supported in elasticsearch: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html#_track_scores

只是不知道在Elasticsearch-dsl中执行相同操作

Just dont know how to do the same in Elasticsearch-dsl

推荐答案

我认为这在文档中提到:

I think this is mentioned in the documentation:

http:// elasticsearch-dsl.readthedocs.org/en/latest/search_dsl.html#extra-properties-and-parameters

s = s.extra(track_scores=True)

这样做。

这篇关于如何在elasticsearch-dsl python中启用track_scores的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆