Filter context for should in bool query (Elasticsearch)

自闭症网瘾萝莉.ら 提交于 2019-12-24 18:22:25

问题


Elasticsearch documentation says "If the bool query is a filter context or has neither must or filter then at least one of the should queries must match a document for it to match the bool query."

So I can have a bool query with a should clause along with must or filter within a filter context and then still get exact match. How to do this combination?

I would also be interested in knowing how to do this with Jest client?


回答1:


In that case you need to add minimum_should_match: 1 if you want that at least one of your should clauses match.



来源:https://stackoverflow.com/questions/50998320/filter-context-for-should-in-bool-query-elasticsearch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!