Module org.elasticsearch.server
Package org.elasticsearch.index.query
Class BaseTermQueryBuilder<QB extends BaseTermQueryBuilder<QB>>
java.lang.Object
org.elasticsearch.index.query.AbstractQueryBuilder<QB>
org.elasticsearch.index.query.BaseTermQueryBuilder<QB>
- All Implemented Interfaces:
NamedWriteable
,VersionedNamedWriteable
,Writeable
,QueryBuilder
,Rewriteable<QueryBuilder>
,ToXContent
,ToXContentObject
- Direct Known Subclasses:
SpanTermQueryBuilder
,TermQueryBuilder
public abstract class BaseTermQueryBuilder<QB extends BaseTermQueryBuilder<QB>>
extends AbstractQueryBuilder<QB>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final String
Name of field to match against.protected final Object
Value to find matches for.static final ParseField
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.xcontent.ToXContent
EMPTY, EMPTY_PARAMS
-
Constructor Summary
ConstructorsModifierConstructorDescriptionBaseTermQueryBuilder
(String fieldName, boolean value) Constructs a new base term query.BaseTermQueryBuilder
(String fieldName, double value) Constructs a new base term query.BaseTermQueryBuilder
(String fieldName, float value) Constructs a new base term query.BaseTermQueryBuilder
(String fieldName, int value) Constructs a new base term query.BaseTermQueryBuilder
(String fieldName, long value) Constructs a new base term query.BaseTermQueryBuilder
(String fieldName, Object value) Constructs a new base term query.BaseTermQueryBuilder
(String fieldName, String value) Constructs a new base term query.protected
Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addExtraXContent
(XContentBuilder builder, ToXContent.Params params) protected boolean
Indicates whether some otherQueryBuilder
object of the same type is "equal to" this one.protected int
protected void
doWriteTo
(StreamOutput out) protected void
doXContent
(XContentBuilder builder, ToXContent.Params params) Returns the field name used in this query.value()
Returns the value used in this query.Methods inherited from class org.elasticsearch.index.query.AbstractQueryBuilder
addValidationError, boost, boost, boostAndQueryNameToXContent, checkNegativeBoost, declareStandardFields, doCoordinatorRewrite, doIndexMetadataRewrite, doRewrite, doSearchRewrite, doToQuery, equals, extractInnerHitBuilders, getMaxNestedDepth, getName, hashCode, parseInnerQueryBuilder, parseTopLevelQuery, parseTopLevelQuery, printBoostAndQueryName, queryName, queryName, readQueries, requireValue, rewrite, setMaxNestedDepth, throwParsingExceptionOnMultipleFields, toQuery, toString, toXContent, writeQueries, writeTo
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
Methods inherited from interface org.elasticsearch.common.io.stream.VersionedNamedWriteable
getMinimalSupportedVersion, getWriteableName
-
Field Details
-
VALUE_FIELD
-
fieldName
Name of field to match against. -
value
Value to find matches for.
-
-
Constructor Details
-
BaseTermQueryBuilder
Constructs a new base term query.- Parameters:
fieldName
- The name of the fieldvalue
- The value of the term
-
BaseTermQueryBuilder
Constructs a new base term query.- Parameters:
fieldName
- The name of the fieldvalue
- The value of the term
-
BaseTermQueryBuilder
Constructs a new base term query.- Parameters:
fieldName
- The name of the fieldvalue
- The value of the term
-
BaseTermQueryBuilder
Constructs a new base term query.- Parameters:
fieldName
- The name of the fieldvalue
- The value of the term
-
BaseTermQueryBuilder
Constructs a new base term query.- Parameters:
fieldName
- The name of the fieldvalue
- The value of the term
-
BaseTermQueryBuilder
Constructs a new base term query.- Parameters:
fieldName
- The name of the fieldvalue
- The value of the term
-
BaseTermQueryBuilder
Constructs a new base term query. In case value is assigned to a string, we internally convert it to aBytesRef
because inTermQueryBuilder
andSpanTermQueryBuilder
string values are parsed toBytesRef
and we want internal representation of query to be equal regardless of whether it was created from XContent or via Java API.- Parameters:
fieldName
- The name of the fieldvalue
- The value of the term
-
BaseTermQueryBuilder
Read from a stream.- Throws:
IOException
-
-
Method Details
-
doWriteTo
- Specified by:
doWriteTo
in classAbstractQueryBuilder<QB extends BaseTermQueryBuilder<QB>>
- Throws:
IOException
-
fieldName
Returns the field name used in this query. -
value
Returns the value used in this query. If necessary, converts internalBytesRef
representation back to string. -
doXContent
- Specified by:
doXContent
in classAbstractQueryBuilder<QB extends BaseTermQueryBuilder<QB>>
- Throws:
IOException
-
addExtraXContent
protected void addExtraXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Throws:
IOException
-
doHashCode
protected int doHashCode()- Specified by:
doHashCode
in classAbstractQueryBuilder<QB extends BaseTermQueryBuilder<QB>>
-
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<QB extends BaseTermQueryBuilder<QB>>
-