python - 如何在 elasticsearch-dsl python 中启用 track_scores

标签 python elasticsearch elasticsearch-dsl

我正在使用 elasticsearch dsl 在 elasticsearch 上进行搜索:https://elasticsearch-dsl.readthedocs.org/en/latest/

如何为查询启用 track_scores?

我知道 elasticsearch 支持它:https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html#_track_scores

只是不知道如何在 Elasticsearch-dsl 中做同样的事情

最佳答案

我发现文档中提到了这一点:

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

s = s.extra(track_scores=True)

这有效。

关于python - 如何在 elasticsearch-dsl python 中启用 track_scores,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33799486/

相关文章:

python - 在python中搜索动态数组

python - 在 OpenFST (PyFST) 的弧中显示字符而不是整数

python - 如何在python中减去两个列表

elasticsearch - Elasricsearch和Solr数据可视化工具

elasticsearch - 使用 Elasticsearch 代理后面的UI仪表板

elasticsearch - 流程在Elasticsearch查询中如何工作?

python - 从函数内访问全局套接字时遇到问题

json - 来自 Haskell 的查询请求,包含 "same data"的两倍

elasticsearch - Logstash/Elasticsearch CSV字段类型,日期格式和多字段(.raw)

elasticsearch - 用不包含这些术语的成员过滤掉项目的最有效方法是什么?