Package org.elasticsearch.index.query
Class CommonTermsQueryBuilder
java.lang.Object
org.elasticsearch.index.query.AbstractQueryBuilder<CommonTermsQueryBuilder>
org.elasticsearch.index.query.CommonTermsQueryBuilder
- All Implemented Interfaces:
NamedWriteable,Writeable,org.elasticsearch.common.xcontent.ToXContent,org.elasticsearch.common.xcontent.ToXContentObject,QueryBuilder,Rewriteable<QueryBuilder>
@Deprecated
public class CommonTermsQueryBuilder
extends AbstractQueryBuilder<CommonTermsQueryBuilder>
Deprecated.
Since max_optimization optimization landed in 7.0, normal MatchQuery
will achieve the same result without any configuration.
CommonTermsQuery query is a query that executes high-frequency terms in a
optional sub-query to prevent slow queries due to "common" terms like
stopwords. This query basically builds 2 queries off the
#add(Term)
added terms where low-frequency terms are added to a required boolean clause
and high-frequency terms are added to an optional boolean clause. The
optional clause is only executed if the required "low-frequency' clause
matches.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic StringDeprecated.static floatDeprecated.static booleanDeprecated.static OperatorDeprecated.static OperatorDeprecated.static StringDeprecated.Fields inherited from class org.elasticsearch.index.query.AbstractQueryBuilder
boost, BOOST_FIELD, DEFAULT_BOOST, NAME_FIELD, queryNameFields inherited from interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDSFields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionCommonTermsQueryBuilder(String fieldName, Object text)Deprecated.SeeCommonTermsQueryBuilderfor more details.Deprecated.SeeCommonTermsQueryBuilderfor more details. -
Method Summary
Modifier and TypeMethodDescriptionanalyzer()Deprecated.Deprecated.Explicitly set the analyzer to use.floatDeprecated.cutoffFrequency(float cutoffFrequency)Deprecated.Sets the cutoff document frequency for high / low frequent terms.protected booleandoEquals(CommonTermsQueryBuilder other)Deprecated.Indicates whether some otherQueryBuilderobject of the same type is "equal to" this one.protected intDeprecated.protected org.apache.lucene.search.QuerydoToQuery(SearchExecutionContext context)Deprecated.protected voiddoWriteTo(StreamOutput out)Deprecated.protected voiddoXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)Deprecated.Deprecated.static CommonTermsQueryBuilderfromXContent(org.elasticsearch.common.xcontent.XContentParser parser)Deprecated.Deprecated.Returns the name of the writeable objectDeprecated.highFreqMinimumShouldMatch(String highFreqMinimumShouldMatch)Deprecated.Sets the minimum number of high frequent query terms that need to match in order to produce a hit when there are no low frequent terms.Deprecated.highFreqOperator(Operator operator)Deprecated.Sets the operator to use for terms with a high document frequency (greater than or equal tocutoffFrequency(float).Deprecated.lowFreqMinimumShouldMatch(String lowFreqMinimumShouldMatch)Deprecated.Sets the minimum number of low frequent query terms that need to match in order to produce a hit.Deprecated.lowFreqOperator(Operator operator)Deprecated.Sets the operator to use for terms with a low document frequency (less thancutoffFrequency(float).value()Deprecated.Methods inherited from class org.elasticsearch.index.query.AbstractQueryBuilder
addValidationError, boost, boost, checkNegativeBoost, declareStandardFields, doRewrite, equals, extractInnerHitBuilders, getName, hashCode, parseInnerQueryBuilder, parseInnerQueryBuilder, printBoostAndQueryName, queryName, queryName, requireValue, rewrite, throwParsingExceptionOnMultipleFields, toQuery, toString, toXContent, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
Field Details
-
COMMON_TERMS_QUERY_DEPRECATION_MSG
Deprecated.- See Also:
- Constant Field Values
-
NAME
Deprecated.- See Also:
- Constant Field Values
-
DEFAULT_CUTOFF_FREQ
public static final float DEFAULT_CUTOFF_FREQDeprecated.- See Also:
- Constant Field Values
-
DEFAULT_HIGH_FREQ_OCCUR
Deprecated. -
DEFAULT_LOW_FREQ_OCCUR
Deprecated. -
DEFAULT_DISABLE_COORD
public static final boolean DEFAULT_DISABLE_COORDDeprecated.- See Also:
- Constant Field Values
-
-
Constructor Details
-
CommonTermsQueryBuilder
Deprecated.SeeCommonTermsQueryBuilderfor more details.Constructs a new common terms query. -
CommonTermsQueryBuilder
Deprecated.SeeCommonTermsQueryBuilderfor more details.Read from a stream.- Throws:
IOException
-
-
Method Details
-
doWriteTo
Deprecated.- Specified by:
doWriteToin classAbstractQueryBuilder<CommonTermsQueryBuilder>- Throws:
IOException
-
fieldName
Deprecated. -
value
Deprecated. -
highFreqOperator
Deprecated.Sets the operator to use for terms with a high document frequency (greater than or equal tocutoffFrequency(float). Defaults toAND. -
highFreqOperator
Deprecated. -
lowFreqOperator
Deprecated.Sets the operator to use for terms with a low document frequency (less thancutoffFrequency(float). Defaults toAND. -
lowFreqOperator
Deprecated. -
analyzer
Deprecated.Explicitly set the analyzer to use. Defaults to use explicit mapping config for the field, or, if not set, the default search analyzer. -
analyzer
Deprecated. -
cutoffFrequency
Deprecated.Sets the cutoff document frequency for high / low frequent terms. A value in [0..1] (or absolute number >=1) representing the maximum threshold of a terms document frequency to be considered a low frequency term. Defaults to{@value #DEFAULT_CUTOFF_FREQ} -
cutoffFrequency
public float cutoffFrequency()Deprecated. -
highFreqMinimumShouldMatch
Deprecated.Sets the minimum number of high frequent query terms that need to match in order to produce a hit when there are no low frequent terms. -
highFreqMinimumShouldMatch
Deprecated. -
lowFreqMinimumShouldMatch
Deprecated.Sets the minimum number of low frequent query terms that need to match in order to produce a hit. -
lowFreqMinimumShouldMatch
Deprecated. -
doXContent
protected void doXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOExceptionDeprecated.- Specified by:
doXContentin classAbstractQueryBuilder<CommonTermsQueryBuilder>- Throws:
IOException
-
fromXContent
public static CommonTermsQueryBuilder fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws IOExceptionDeprecated.- Throws:
IOException
-
getWriteableName
Deprecated.Description copied from interface:NamedWriteableReturns the name of the writeable object -
doToQuery
protected org.apache.lucene.search.Query doToQuery(SearchExecutionContext context) throws IOExceptionDeprecated.- Specified by:
doToQueryin classAbstractQueryBuilder<CommonTermsQueryBuilder>- Throws:
IOException
-
doHashCode
protected int doHashCode()Deprecated.- Specified by:
doHashCodein classAbstractQueryBuilder<CommonTermsQueryBuilder>
-
doEquals
Deprecated.Description copied from class:AbstractQueryBuilderIndicates whether some otherQueryBuilderobject of the same type is "equal to" this one.- Specified by:
doEqualsin classAbstractQueryBuilder<CommonTermsQueryBuilder>
-