且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Elasticsearch中的嵌套查询

更新时间:2023-11-20 14:02:10

您的查询无效查询。您需要使用适当的复合查询将其他查询组合在一起,不能只使用逗号并添加仅支持一个查询的另一个查询。

Your query is not a valid query. You need to use a proper compound query to combine other queries together, you can't just use a comma and add another query where only one is supported.

您能够 例如,使用布尔查询并具有两个must子句,几乎是您的两个query_string。也许您甚至可以切换到使用过滤器,并进行过滤查询。
我将看一下本文中的示例: http://www.spacevatican.org/2012/6/3/fun-with-elasticsearch-s-children-andnested-documents/ 。

You can for instance use a bool query and have two must clauses, pretty much your two query_string. Or maybe you can even switch to using filters, and have a filtered query. I'd have a look at the examples on this article: http://www.spacevatican.org/2012/6/3/fun-with-elasticsearch-s-children-and-nested-documents/.