简体   繁体   中英

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. we are running on elastic search 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.

so simple :)

MatchQueryBuilder

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

Thanks to David :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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