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

View File

@ -85,6 +85,16 @@ public final class QueryBuilders {
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.
*