Package org.elasticsearch.index.query
Class TermsQueryBuilder
org.elasticsearch.index.query.AbstractQueryBuilder<TermsQueryBuilder>
org.elasticsearch.index.query.TermsQueryBuilder
- All Implemented Interfaces:
NamedWriteable
,Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentObject
,QueryBuilder
,Rewriteable<QueryBuilder>
A filter for a field based on several terms matching on any of them.
-
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.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Fields inherited from class org.elasticsearch.index.query.AbstractQueryBuilder
boost, BOOST_FIELD, DEFAULT_BOOST, NAME_FIELD, queryName
Fields inherited from interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDS
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ConstructorDescriptionfieldName, double... values)
A filter for a field based on several terms matching on any of them.fieldName, float... values)
A filter for a field based on several terms matching on any of them.fieldName, int... values)
A filter for a field based on several terms matching on any of them.fieldName, long... values)
A filter for a field based on several terms matching on any of them.fieldName, <?> values)
A filter for a field based on several terms matching on any of them.fieldName, ... values)
A filter for a field based on several terms matching on any of them.fieldName, ... values)
A filter for a field based on several terms matching on any of them.fieldName, TermsLookup termsLookup)
Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
doEquals(TermsQueryBuilder other)
Indicates whether some otherQueryBuilder
object of the same type is "equal to" this one.protected int
protected QueryBuilder
doRewrite(QueryRewriteContext queryRewriteContext)
protected org.apache.lucene.search.Query
doToQuery(SearchExecutionContext context)
protected void
doWriteTo(StreamOutput out)
protected void
doXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
static TermsQueryBuilder
fromXContent(org.elasticsearch.common.xcontent.XContentParser parser)
org.elasticsearch.index.query.TermsQueryBuilder.Values
Returns the name of the writeable objectboolean
<>
values()
get readable values only forAbstractQueryBuilder.toXContent(org.elasticsearch.common.xcontent.XContentBuilder, org.elasticsearch.common.xcontent.ToXContent.Params)
and tests, don't use this to construct a query.Methods inherited from class org.elasticsearch.index.query.AbstractQueryBuilder
addValidationError, boost, boost, checkNegativeBoost, declareStandardFields, equals, extractInnerHitBuilders, getName, hashCode, parseInnerQueryBuilder, parseInnerQueryBuilder, printBoostAndQueryName, queryName, queryName, requireValue, rewrite, throwParsingExceptionOnMultipleFields, toQuery, toString, toXContent, writeTo
Methods inherited from class java.lang.
, , , , , , ,
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
Field Details
-
NAME
public static final NAME- See Also:
- Constant Field Values
-
-
Constructor Details
-
TermsQueryBuilder
-
TermsQueryBuilder
public TermsQueryBuilder( fieldName, ... values)A filter for a field based on several terms matching on any of them.- Parameters:
fieldName
- The field namevalues
- The terms
-
TermsQueryBuilder
public TermsQueryBuilder( fieldName, int... values)A filter for a field based on several terms matching on any of them.- Parameters:
fieldName
- The field namevalues
- The terms
-
TermsQueryBuilder
public TermsQueryBuilder( fieldName, long... values)A filter for a field based on several terms matching on any of them.- Parameters:
fieldName
- The field namevalues
- The terms
-
TermsQueryBuilder
public TermsQueryBuilder( fieldName, float... values)A filter for a field based on several terms matching on any of them.- Parameters:
fieldName
- The field namevalues
- The terms
-
TermsQueryBuilder
public TermsQueryBuilder( fieldName, double... values)A filter for a field based on several terms matching on any of them.- Parameters:
fieldName
- The field namevalues
- The terms
-
TermsQueryBuilder
public TermsQueryBuilder( fieldName, ... values)A filter for a field based on several terms matching on any of them.- Parameters:
fieldName
- The field namevalues
- The terms
-
TermsQueryBuilder
public TermsQueryBuilder( fieldName, <?> values)A filter for a field based on several terms matching on any of them.- Parameters:
fieldName
- The field namevalues
- The terms
-
TermsQueryBuilder
Read from a stream.- Throws:
-
-
Method Details
-
doWriteTo
- Specified by:
doWriteTo
in classAbstractQueryBuilder<TermsQueryBuilder>
- Throws:
-
fieldName
public fieldName() -
getValues
public org.elasticsearch.index.query.TermsQueryBuilder.Values getValues() -
values
public <> values()get readable values only forAbstractQueryBuilder.toXContent(org.elasticsearch.common.xcontent.XContentBuilder, org.elasticsearch.common.xcontent.ToXContent.Params)
and tests, don't use this to construct a query. usegetValues()
instead. -
termsLookup
-
isTypeless
public boolean isTypeless() -
doXContent
protected void doXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws- Specified by:
doXContent
in classAbstractQueryBuilder<TermsQueryBuilder>
- Throws:
-
fromXContent
public static TermsQueryBuilder fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws- Throws:
-
getWriteableName
public getWriteableName()Description copied from interface:NamedWriteable
Returns the name of the writeable object -
doToQuery
- Specified by:
doToQuery
in classAbstractQueryBuilder<TermsQueryBuilder>
- Throws:
-
doHashCode
protected int doHashCode()- Specified by:
doHashCode
in classAbstractQueryBuilder<TermsQueryBuilder>
-
doEquals
Description copied from class:AbstractQueryBuilder
Indicates whether some otherQueryBuilder
object of the same type is "equal to" this one.- Specified by:
doEquals
in classAbstractQueryBuilder<TermsQueryBuilder>
-
doRewrite
- Overrides:
doRewrite
in classAbstractQueryBuilder<TermsQueryBuilder>
-