Module
MatchQuery
MatchQuery ( field, qstr )
A Query that appects text, analyzes it, generates internal query based
on the MatchQuery type.
|
Method Summary
Returns | Name | Description |
---|---|---|
String | _type() | The type of ejs object. For internal use only. |
Object | analyzer(analyzer) | Sets the analyzer name used to analyze the Query object. |
Object | boost(boost) | Sets the boost value for documents matching the Query . |
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. |
Object | fuzziness(fuzz) | Sets the fuzziness value for the Query . |
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. |
Object | fuzzyTranspositions(trueFalse) | Set to false to use classic Levenshtein edit distance in the fuzzy query. |
Object | lenient(trueFalse) | Enables lenient parsing of the query string. |
Object | maxExpansions(e) | Sets the max expansions of a fuzzy MatchQuery . |
Object | minimumShouldMatch(minMatch) | Sets a string value controlling how many "should" clauses in the
resulting Query should match. |
Object | minimumShouldMatch(minMatch) | Sets a percent value controlling how many "should" clauses in the
resulting Query should match. |
Object | operator(op) | Sets default operator of the Query . Default: or. |
Object | prefixLength(l) | Sets the prefix length for a fuzzy prefix MatchQuery . |
Object | query(qstr) | Sets the query string for the Query . |
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. |
Object | slop(slop) | Sets the default slop for phrases. If zero, then exact phrase matches are required. Default: 0. |
String | toJSON() | Retrieves the internal query object. This is typically used by
internal API functions so use with caution. |
Object | type(type) | Sets the type of the MatchQuery . Valid values are
boolean, phrase, and phrase_prefix. |
Object | zeroTermsQuery(q) | Sets what happens when no terms match. Valid values are "all" or "none". |
Method Detail
analyzer
Object analyzer ( analyzer )
Sets the analyzer name used to analyze the Query object.
|
boost
Object boost ( boost )
Sets the boost value for documents matching the Query .
|
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.
|
fuzziness
Object fuzziness ( fuzz )
Sets the fuzziness value for the Query .
|
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.
|
fuzzyTranspositions
Object fuzzyTranspositions ( trueFalse )
Set to false to use classic Levenshtein edit distance in the
fuzzy query.
|
lenient
Object lenient ( trueFalse )
Enables lenient parsing of the query string.
|
maxExpansions
Object maxExpansions ( e )
Sets the max expansions of a fuzzy MatchQuery .
|
minimumShouldMatch
Object minimumShouldMatch ( minMatch )
Sets a string value controlling how many "should" clauses in the
resulting Query should match.
|
minimumShouldMatch
Object minimumShouldMatch ( minMatch )
Sets a percent value controlling how many "should" clauses in the
resulting Query should match.
|
operator
Object operator ( op )
Sets default operator of the Query . Default: or.
|
prefixLength
Object prefixLength ( l )
Sets the prefix length for a fuzzy prefix MatchQuery .
|
query
Object query ( qstr )
Sets the query string for the Query .
|
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.
|
slop
Object slop ( slop )
Sets the default slop for phrases. If zero, then exact phrase matches
are required. Default: 0.
|
toJSON
String toJSON ( )
Retrieves the internal query object. This is typically used by
internal API functions so use with caution.
|
type
Object type ( type )
Sets the type of the MatchQuery . Valid values are
boolean, phrase, and phrase_prefix.
|
zeroTermsQuery
Object zeroTermsQuery ( q )
Sets what happens when no terms match. Valid values are
"all" or "none".
|