public class CommonTermsQueryBuilder extends AbstractQueryBuilder<CommonTermsQueryBuilder>
#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.Writeable.Reader<V>, Writeable.Writer<V>ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params| Modifier and Type | Field and Description |
|---|---|
static float |
DEFAULT_CUTOFF_FREQ |
static boolean |
DEFAULT_DISABLE_COORD |
static Operator |
DEFAULT_HIGH_FREQ_OCCUR |
static Operator |
DEFAULT_LOW_FREQ_OCCUR |
static java.lang.String |
NAME |
boost, BOOST_FIELD, DEFAULT_BOOST, NAME_FIELD, queryNameEMPTY_PARAMSMAX_REWRITE_ROUNDS| Constructor and Description |
|---|
CommonTermsQueryBuilder(StreamInput in)
Read from a stream.
|
CommonTermsQueryBuilder(java.lang.String fieldName,
java.lang.Object text)
Constructs a new common terms query.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
analyzer() |
CommonTermsQueryBuilder |
analyzer(java.lang.String analyzer)
Explicitly set the analyzer to use.
|
float |
cutoffFrequency() |
CommonTermsQueryBuilder |
cutoffFrequency(float cutoffFrequency)
Sets the cutoff document frequency for high / low frequent terms.
|
protected boolean |
doEquals(CommonTermsQueryBuilder other)
Indicates whether some other
QueryBuilder object of the same type is "equal to" this one. |
protected int |
doHashCode() |
protected org.apache.lucene.search.Query |
doToQuery(QueryShardContext context) |
protected void |
doWriteTo(StreamOutput out) |
protected void |
doXContent(XContentBuilder builder,
ToXContent.Params params) |
java.lang.String |
fieldName() |
static CommonTermsQueryBuilder |
fromXContent(XContentParser parser) |
java.lang.String |
getWriteableName()
Returns the name of the writeable object
|
java.lang.String |
highFreqMinimumShouldMatch() |
CommonTermsQueryBuilder |
highFreqMinimumShouldMatch(java.lang.String highFreqMinimumShouldMatch)
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.
|
Operator |
highFreqOperator() |
CommonTermsQueryBuilder |
highFreqOperator(Operator operator)
Sets the operator to use for terms with a high document frequency
(greater than or equal to
cutoffFrequency(float). |
java.lang.String |
lowFreqMinimumShouldMatch() |
CommonTermsQueryBuilder |
lowFreqMinimumShouldMatch(java.lang.String lowFreqMinimumShouldMatch)
Sets the minimum number of low frequent query terms that need to match in order to
produce a hit.
|
Operator |
lowFreqOperator() |
CommonTermsQueryBuilder |
lowFreqOperator(Operator operator)
Sets the operator to use for terms with a low document frequency (less
than
cutoffFrequency(float). |
java.lang.Object |
value() |
addValidationError, boost, boost, convertToBytesRefIfString, convertToStringIfBytesRef, declareStandardFields, doRewrite, equals, extractInnerHitBuilders, getName, hashCode, parseInnerQueryBuilder, printBoostAndQueryName, queryName, queryName, readQueries, requireValue, rewrite, throwParsingExceptionOnMultipleFields, toFilter, toQueries, toQuery, toXContent, writeQueries, writeTobuildAsBytes, buildAsBytes, toString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitisFragmentrewrite, rewrite, rewrite, rewriteAndFetch, rewriteAndFetchpublic static final java.lang.String NAME
public static final float DEFAULT_CUTOFF_FREQ
public static final Operator DEFAULT_HIGH_FREQ_OCCUR
public static final Operator DEFAULT_LOW_FREQ_OCCUR
public static final boolean DEFAULT_DISABLE_COORD
public CommonTermsQueryBuilder(java.lang.String fieldName,
java.lang.Object text)
public CommonTermsQueryBuilder(StreamInput in) throws java.io.IOException
java.io.IOExceptionprotected void doWriteTo(StreamOutput out) throws java.io.IOException
doWriteTo in class AbstractQueryBuilder<CommonTermsQueryBuilder>java.io.IOExceptionpublic java.lang.String fieldName()
public java.lang.Object value()
public CommonTermsQueryBuilder highFreqOperator(Operator operator)
cutoffFrequency(float). Defaults to
AND.public Operator highFreqOperator()
public CommonTermsQueryBuilder lowFreqOperator(Operator operator)
cutoffFrequency(float). Defaults to AND.public Operator lowFreqOperator()
public CommonTermsQueryBuilder analyzer(java.lang.String analyzer)
public java.lang.String analyzer()
public CommonTermsQueryBuilder cutoffFrequency(float cutoffFrequency)
public float cutoffFrequency()
public CommonTermsQueryBuilder highFreqMinimumShouldMatch(java.lang.String highFreqMinimumShouldMatch)
public java.lang.String highFreqMinimumShouldMatch()
public CommonTermsQueryBuilder lowFreqMinimumShouldMatch(java.lang.String lowFreqMinimumShouldMatch)
public java.lang.String lowFreqMinimumShouldMatch()
protected void doXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
doXContent in class AbstractQueryBuilder<CommonTermsQueryBuilder>java.io.IOExceptionpublic static CommonTermsQueryBuilder fromXContent(XContentParser parser) throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getWriteableName()
NamedWriteableprotected org.apache.lucene.search.Query doToQuery(QueryShardContext context) throws java.io.IOException
doToQuery in class AbstractQueryBuilder<CommonTermsQueryBuilder>java.io.IOExceptionprotected int doHashCode()
doHashCode in class AbstractQueryBuilder<CommonTermsQueryBuilder>protected boolean doEquals(CommonTermsQueryBuilder other)
AbstractQueryBuilderQueryBuilder object of the same type is "equal to" this one.doEquals in class AbstractQueryBuilder<CommonTermsQueryBuilder>