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
,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 String
Name of field to match against.protected Object
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
ModifierConstructorDescriptionBaseTermQueryBuilder(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(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.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
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
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
protected void doXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Specified by:
doXContent
in classAbstractQueryBuilder<QB extends BaseTermQueryBuilder<QB>>
- Throws:
IOException
-
addExtraXContent
protected void addExtraXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.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>>
-