简体   繁体   English

通过Java客户端在弹性搜索查询中使用minimum_should_match

[英]Use minimum_should_match in elastic search query via java client

looking all over, I couldn't find a way to include minimum_should_match param our match query when using the java client. 环顾四周,使用Java客户端时,我找不到在我们的匹配查询中包含minimum_should_match参数的方法。 we are running on elastic search 2.4. 我们正在弹性搜索2.4上运行。 this become a major need now in our system and reindexing/converting the field to not_analyzed is not an option since re-indexing our index takes few days now. 现在这已成为我们系统中的主要需求,并且无法将字段重新索引/转换为not_analyzed,因为现在重新索引索引需要花费几天的时间。

so simple :) 很简单 :)

MatchQueryBuilder MatchQueryBuilder

QueryBuilders.matchQuery(FIELD_NAME, valueToMatch).minimumShouldMatch("100%")

Thanks to David :) 感谢大卫 :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM