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.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StringName of field to match against.protected final ObjectValue to find matches for.static final 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.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.protectedRead from a stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddExtraXContent(XContentBuilder builder, ToXContent.Params params) protected booleanIndicates whether some otherQueryBuilderobject of the same type is "equal to" this one.protected intprotected voiddoWriteTo(StreamOutput out) protected voiddoXContent(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, doInnerHitsRewrite, doRewrite, doSearchRewrite, doToQuery, equals, extractInnerHitBuilders, getMaxNestedDepth, getName, hashCode, parseInnerQueryBuilder, parseTopLevelQuery, parseTopLevelQuery, printBoostAndQueryName, queryName, queryName, readQueries, requireValue, rewrite, setMaxNestedDepth, throwParsingExceptionOnMultipleFields, toQuery, toString, toXContent, writeQueries, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragmentMethods inherited from interface org.elasticsearch.common.io.stream.VersionedNamedWriteable
getMinimalSupportedVersion, getWriteableName, supportsVersion
-
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 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
- Specified by:
doXContentin 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:
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>>
-