Add `matchBoolPrefix` method to QueryBuilders (#58637)

This commit is contained in:
Patrick Jiang(白泽) 2020-06-29 22:29:53 +08:00 committed by Christoph Büscher
parent 735a3f344d
commit be20aacec3
1 changed files with 11 additions and 1 deletions

View File

@ -84,7 +84,17 @@ public final class QueryBuilders {
public static MultiMatchQueryBuilder multiMatchQuery(Object text, String... fieldNames) {
return new MultiMatchQueryBuilder(text, fieldNames); // BOOLEAN is the default
}
/**
* Creates a text query with type "BOOL_PREFIX" for the provided field name and text.
*
* @param name The field name.
* @param text The query text (to be analyzed).
*/
public static MatchBoolPrefixQueryBuilder matchBoolPrefixQuery(String name, Object text) {
return new MatchBoolPrefixQueryBuilder(name, text);
}
/**
* Creates a text query with type "PHRASE" for the provided field name and text.
*