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.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringName of field to match against.protected ObjectValue to find matches for.static org.elasticsearch.common.xcontent.ParseFieldFields inherited from class org.elasticsearch.index.query.AbstractQueryBuilder
boost, BOOST_FIELD, DEFAULT_BOOST, NAME_FIELD, queryNameFields inherited from interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDSFields inherited from interface org.elasticsearch.common.xcontent.ToXContent
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.protectedRead from a stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddExtraXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)protected booleanIndicates whether some otherQueryBuilderobject of the same type is "equal to" this one.protected intprotected voiddoWriteTo(StreamOutput out)protected voiddoXContent(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, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.common.io.stream.NamedWriteable
getWriteableNameMethods 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 aBytesRefbecause inTermQueryBuilderandSpanTermQueryBuilderstring values are parsed toBytesRefand 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:
doWriteToin 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 internalBytesRefrepresentation back to string. -
doXContent
protected void doXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Specified by:
doXContentin 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:
doHashCodein classAbstractQueryBuilder<QB extends BaseTermQueryBuilder<QB>>
-
doEquals
Description copied from class:AbstractQueryBuilderIndicates whether some otherQueryBuilderobject of the same type is "equal to" this one.- Specified by:
doEqualsin classAbstractQueryBuilder<QB extends BaseTermQueryBuilder<QB>>
-