Big ElasticSearch bool 查询:以某种方式标记与查询的特定部分匹配的项目

Big ElasticSearch bool query: Somehow mark items that match a particular piece of the query

我正在执行一个巨大的 ElasticSearch 查询。它由 "subqueries" 和 bool 上的 should 连接而成。我需要知道哪些结果项与查询的 should 匹配。

我排序然后限制查询的大小。我无法将查询拆分为多个查询,然后进行 msearch,因为会返回大量数据,以便稍后对完整结果集进行排序并再次截断大小。

有没有办法标记与查询的一部分相匹配的结果,以便我以后可以确定是哪些部分导致了这些结果?

是的,看看Named Queries

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-named-queries-and-filters.html