ejsMultiMatchQuery

A MultiMatchQuery query builds further on top of the MatchQuery by allowing multiple fields to be specified. The idea here is to allow to more easily build a concise match type query over multiple fields instead of using a relatively more expressive query by using multiple match queries within a bool query.

Module

 MultiMatchQuery

MultiMatchQuery ( fields, qstr )
A Query that allow to more easily build a MatchQuery over multiple fields

Parameters
fields <String | String[]> the single field or array of fields to search across
qstr <String> the query string

Method Summary

Returns Name Description
String_type()The type of ejs object. For internal use only.
Objectanalyzer(analyzer)Sets the analyzer name used to analyze the Query object.
Objectboost(boost)Sets the boost value for documents matching the Query.
ObjectcutoffFrequency(freq)Sets the maximum threshold/frequency to be considered a low frequency term in a CommonTermsQuery. Set to a value between 0 and 1.
Objectfields(f)Sets the fields to search across. If passed a single value it is added to the existing list of fields. If passed an array of values, they overwite all existing values.
Objectfuzziness(fuzz)Sets the fuzziness value for the Query.
ObjectfuzzyRewrite(m)Sets fuzzy rewrite method. Valid values are: constant_score_auto - tries to pick the best constant-score rewrite method based on term and document counts from the query scoring_boolean - translates each term into boolean should and keeps the scores as computed by the query constant_score_boolean - same as scoring_boolean, expect no scores are computed. constant_score_filter - first creates a private Filter, by visiting each term in sequence and marking all docs for that term top_terms_boost_N - first translates each term into boolean should and scores are only computed as the boost using the top N scoring terms. Replace N with an integer value. top_terms_N - first translates each term into boolean should and keeps the scores as computed by the query. Only the top N scoring terms are used. Replace N with an integer value. Default is constant_score_auto. This is an advanced option, use with care.
Objectlenient(trueFalse)Enables lenient parsing of the query string.
ObjectmaxExpansions(e)Sets the max expansions of a fuzzy Query.
ObjectminimumShouldMatch(minMatch)Sets a percent value controlling how many "should" clauses in the resulting Query should match.
Objectoperator(op)Sets default operator of the Query. Default: or.
ObjectprefixLength(l)Sets the prefix length for a fuzzy prefix Query.
Objectquery(qstr)Sets the query string for the Query.
Objectrewrite(m)Sets rewrite method. Valid values are: constant_score_auto - tries to pick the best constant-score rewrite method based on term and document counts from the query scoring_boolean - translates each term into boolean should and keeps the scores as computed by the query constant_score_boolean - same as scoring_boolean, expect no scores are computed. constant_score_filter - first creates a private Filter, by visiting each term in sequence and marking all docs for that term top_terms_boost_N - first translates each term into boolean should and scores are only computed as the boost using the top N scoring terms. Replace N with an integer value. top_terms_N - first translates each term into boolean should and keeps the scores as computed by the query. Only the top N scoring terms are used. Replace N with an integer value. Default is constant_score_auto. This is an advanced option, use with care.
Objectslop(slop)Sets the default slop for phrases. If zero, then exact phrase matches are required. Default: 0.
ObjecttieBreaker(tieBreaker)The tie breaker value. The tie breaker capability allows results that include the same term in multiple fields to be judged better than results that include this term in only the best of those multiple fields, without confusing this with the better case of two different terms in the multiple fields. Default: 0.0.
StringtoJSON()Retrieves the internal query object. This is typically used by internal API functions so use with caution.
Objecttype(type)Sets the type of the MultiMatchQuery. Valid values are boolean, phrase, and phrase_prefix or phrasePrefix.
ObjectuseDisMax(trueFalse)Sets whether or not queries against multiple fields should be combined using Lucene's DisjunctionMaxQuery
ObjectzeroTermsQuery(q)Sets what happens when no terms match. Valid values are "all" or "none".

Method Detail

 _type

String _type ( )
The type of ejs object. For internal use only.

Returns
the type of object

 analyzer

Object analyzer ( analyzer )
Sets the analyzer name used to analyze the Query object.

Parameters
analyzer <String> A valid analyzer name.
Returns
returns this so that calls can be chained.

 boost

Object boost ( boost )
Sets the boost value for documents matching the Query.

Parameters
boost <Double> A positive double value.
Returns
returns this so that calls can be chained.

 cutoffFrequency

Object cutoffFrequency ( freq )
Sets the maximum threshold/frequency to be considered a low frequency term in a CommonTermsQuery. Set to a value between 0 and 1.

Parameters
freq <Number> A positive double value.
Returns
returns this so that calls can be chained.

 fields

Object fields ( f )
Sets the fields to search across. If passed a single value it is added to the existing list of fields. If passed an array of values, they overwite all existing values.

Parameters
f <String | String[]> A single field or list of fields names to search across.
Returns
returns this so that calls can be chained. Returns {Array} current value if `f` not specified.

 fuzziness

Object fuzziness ( fuzz )
Sets the fuzziness value for the Query.

Parameters
fuzz <Double> A double value between 0.0 and 1.0.
Returns
returns this so that calls can be chained.

 fuzzyRewrite

Object fuzzyRewrite ( m )
Sets fuzzy rewrite method. Valid values are: constant_score_auto - tries to pick the best constant-score rewrite method based on term and document counts from the query scoring_boolean - translates each term into boolean should and keeps the scores as computed by the query constant_score_boolean - same as scoring_boolean, expect no scores are computed. constant_score_filter - first creates a private Filter, by visiting each term in sequence and marking all docs for that term top_terms_boost_N - first translates each term into boolean should and scores are only computed as the boost using the top N scoring terms. Replace N with an integer value. top_terms_N - first translates each term into boolean should and keeps the scores as computed by the query. Only the top N scoring terms are used. Replace N with an integer value. Default is constant_score_auto. This is an advanced option, use with care.

Parameters
m <String> The rewrite method as a string.
Returns
returns this so that calls can be chained.

 lenient

Object lenient ( trueFalse )
Enables lenient parsing of the query string.

Parameters
trueFalse <Boolean> A boolean value
Returns
returns this so that calls can be chained.

 maxExpansions

Object maxExpansions ( e )
Sets the max expansions of a fuzzy Query.

Parameters
e <Integer> A positive integer value.
Returns
returns this so that calls can be chained.

 minimumShouldMatch

Object minimumShouldMatch ( minMatch )
Sets a percent value controlling how many "should" clauses in the resulting Query should match.

Parameters
minMatch <String> A min should match parameter.
Returns
returns this so that calls can be chained.

 operator

Object operator ( op )
Sets default operator of the Query. Default: or.

Parameters
op <String> Any of "and" or "or", no quote characters.
Returns
returns this so that calls can be chained.

 prefixLength

Object prefixLength ( l )
Sets the prefix length for a fuzzy prefix Query.

Parameters
l <Integer> A positive integer length value.
Returns
returns this so that calls can be chained.

 query

Object query ( qstr )
Sets the query string for the Query.

Parameters
qstr <String> The query string to search for.
Returns
returns this so that calls can be chained.

 rewrite

Object rewrite ( m )
Sets rewrite method. Valid values are: constant_score_auto - tries to pick the best constant-score rewrite method based on term and document counts from the query scoring_boolean - translates each term into boolean should and keeps the scores as computed by the query constant_score_boolean - same as scoring_boolean, expect no scores are computed. constant_score_filter - first creates a private Filter, by visiting each term in sequence and marking all docs for that term top_terms_boost_N - first translates each term into boolean should and scores are only computed as the boost using the top N scoring terms. Replace N with an integer value. top_terms_N - first translates each term into boolean should and keeps the scores as computed by the query. Only the top N scoring terms are used. Replace N with an integer value. Default is constant_score_auto. This is an advanced option, use with care.

Parameters
m <String> The rewrite method as a string.
Returns
returns this so that calls can be chained.

 slop

Object slop ( slop )
Sets the default slop for phrases. If zero, then exact phrase matches are required. Default: 0.

Parameters
slop <Integer> A positive integer value.
Returns
returns this so that calls can be chained.

 tieBreaker

Object tieBreaker ( tieBreaker )
The tie breaker value. The tie breaker capability allows results that include the same term in multiple fields to be judged better than results that include this term in only the best of those multiple fields, without confusing this with the better case of two different terms in the multiple fields. Default: 0.0.

Parameters
tieBreaker <Double> A positive double value.
Returns
returns this so that calls can be chained.

 toJSON

String toJSON ( )
Retrieves the internal query object. This is typically used by internal API functions so use with caution.

Returns
returns this object's internal query property.

 type

Object type ( type )
Sets the type of the MultiMatchQuery. Valid values are boolean, phrase, and phrase_prefix or phrasePrefix.

Parameters
type <String> Any of boolean, phrase, phrase_prefix or phrasePrefix.
Returns
returns this so that calls can be chained.

 useDisMax

Object useDisMax ( trueFalse )
Sets whether or not queries against multiple fields should be combined using Lucene's DisjunctionMaxQuery

Parameters
trueFalse <String> A true/false value.
Returns
returns this so that calls can be chained.

 zeroTermsQuery

Object zeroTermsQuery ( q )
Sets what happens when no terms match. Valid values are "all" or "none".

Parameters
q <String> A no match action, "all" or "none".
Returns
returns this so that calls can be chained.

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo