diff --git a/src/core/consts.js b/src/core/consts.js index e282acdb..642a07f1 100644 --- a/src/core/consts.js +++ b/src/core/consts.js @@ -52,7 +52,8 @@ exports.MULTI_MATCH_TYPE = new Set([ 'most_fields', 'cross_fields', 'phrase', - 'phrase_prefix' + 'phrase_prefix', + 'bool_prefix' ]); exports.SCORE_MODE_SET = new Set([ diff --git a/src/index.d.ts b/src/index.d.ts index c5abf585..548e0e26 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -732,9 +732,11 @@ declare namespace esb { * the `_score` from each field. * - `phrase_prefix` - Runs a `match_phrase_prefix` query on each field * and combines the `_score` from each field. + * - `bool_prefix` - (added in v7.2) Creates a match_bool_prefix query on each field and + * combines the _score from each field. * * @param {string} type Can be one of `best_fields`, `most_fields`, - * `cross_fields`, `phrase`, and `phrase_prefix`. Default is `best_fields`. + * `cross_fields`, `phrase`, `phrase_prefix` and `bool_prefix`. Default is `best_fields`. */ type( type: @@ -743,6 +745,7 @@ declare namespace esb { | 'cross_fields' | 'phrase' | 'phrase_prefix' + | 'bool_prefix' ): this; /** diff --git a/src/queries/full-text-queries/multi-match-query.js b/src/queries/full-text-queries/multi-match-query.js index 2d3d09fb..0a47c3f7 100644 --- a/src/queries/full-text-queries/multi-match-query.js +++ b/src/queries/full-text-queries/multi-match-query.js @@ -114,6 +114,9 @@ class MultiMatchQuery extends FullTextQueryBase { * - `phrase_prefix` - Runs a `match_phrase_prefix` query on each field * and combines the `_score` from each field. * + * - `bool_prefix` - (added in v7.2) Creates a match_bool_prefix query on each field and + * combines the _score from each field. + * * @example * // Find the single best matching field * const qry = esb.multiMatchQuery(['subject', 'message'], 'brown fox') @@ -141,7 +144,8 @@ class MultiMatchQuery extends FullTextQueryBase { * .operator('and'); * * @param {string} type Can be one of `best_fields`, `most_fields`, - * `cross_fields`, `phrase`, and `phrase_prefix`. Default is `best_fields`. + * `cross_fields`, `phrase`, `phrase_prefix` and `bool_prefix`. Default is + * `best_fields`. * @returns {MultiMatchQuery} returns `this` so that calls can be chained. */ type(type) {