Package org.elasticsearch.index.query
Class BaseTermQueryBuilder<QB extends BaseTermQueryBuilder<QB>>
org.elasticsearch.index.query.AbstractQueryBuilder<QB>
org.elasticsearch.index.query.BaseTermQueryBuilder<QB>
- All Implemented Interfaces:
NamedWriteable
,Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentObject
,QueryBuilder
,Rewriteable<QueryBuilder>
- 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.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
Modifier and TypeFieldDescriptionprotected
Name of field to match against.protected
Value to find matches for.static org.elasticsearch.common.xcontent.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.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ModifierConstructorDescriptionfieldName, boolean value)
Constructs a new base term query.fieldName, double value)
Constructs a new base term query.fieldName, float value)
Constructs a new base term query.fieldName, int value)
Constructs a new base term query.fieldName, long value)
Constructs a new base term query.fieldName, value)
Constructs a new base term query.fieldName, value)
Constructs a new base term query.protected
Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addExtraXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.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(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.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, checkNegativeBoost, declareStandardFields, doRewrite, doToQuery, 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.io.stream.NamedWriteable
getWriteableName
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
Field Details
-
VALUE_FIELD
public static final org.elasticsearch.common.xcontent.ParseField VALUE_FIELD -
fieldName
protected final fieldNameName of field to match against. -
value
protected final valueValue to find matches for.
-
-
Constructor Details
-
BaseTermQueryBuilder
public BaseTermQueryBuilder( fieldName, value)Constructs a new base term query.- Parameters:
fieldName
- The name of the fieldvalue
- The value of the term
-
BaseTermQueryBuilder
public BaseTermQueryBuilder( fieldName, int value)Constructs a new base term query.- Parameters:
fieldName
- The name of the fieldvalue
- The value of the term
-
BaseTermQueryBuilder
public BaseTermQueryBuilder( fieldName, long value)Constructs a new base term query.- Parameters:
fieldName
- The name of the fieldvalue
- The value of the term
-
BaseTermQueryBuilder
public BaseTermQueryBuilder( fieldName, float value)Constructs a new base term query.- Parameters:
fieldName
- The name of the fieldvalue
- The value of the term
-
BaseTermQueryBuilder
public BaseTermQueryBuilder( fieldName, double value)Constructs a new base term query.- Parameters:
fieldName
- The name of the fieldvalue
- The value of the term
-
BaseTermQueryBuilder
public BaseTermQueryBuilder( fieldName, boolean value)Constructs a new base term query.- Parameters:
fieldName
- The name of the fieldvalue
- The value of the term
-
BaseTermQueryBuilder
public BaseTermQueryBuilder( fieldName, value)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:
-
-
Method Details
-
doWriteTo
- Specified by:
doWriteTo
in classAbstractQueryBuilder<QB extends BaseTermQueryBuilder<QB>>
- Throws:
-
fieldName
public fieldName()Returns the field name used in this query. -
value
public value()Returns the value used in this query. If necessary, converts internalBytesRef
representation back to string. -
doXContent
protected void doXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws- Specified by:
doXContent
in classAbstractQueryBuilder<QB extends BaseTermQueryBuilder<QB>>
- Throws:
-
addExtraXContent
protected void addExtraXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws- Throws:
-
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>>
-