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>
  • Field Details

    • VALUE_FIELD

      public static final org.elasticsearch.common.xcontent.ParseField VALUE_FIELD
    • fieldName

      protected final String fieldName
      Name of field to match against.
    • value

      protected final Object value
      Value to find matches for.
  • Constructor Details

    • BaseTermQueryBuilder

      public BaseTermQueryBuilder(String fieldName, String value)
      Constructs a new base term query.
      Parameters:
      fieldName - The name of the field
      value - The value of the term
    • BaseTermQueryBuilder

      public BaseTermQueryBuilder(String fieldName, int value)
      Constructs a new base term query.
      Parameters:
      fieldName - The name of the field
      value - The value of the term
    • BaseTermQueryBuilder

      public BaseTermQueryBuilder(String fieldName, long value)
      Constructs a new base term query.
      Parameters:
      fieldName - The name of the field
      value - The value of the term
    • BaseTermQueryBuilder

      public BaseTermQueryBuilder(String fieldName, float value)
      Constructs a new base term query.
      Parameters:
      fieldName - The name of the field
      value - The value of the term
    • BaseTermQueryBuilder

      public BaseTermQueryBuilder(String fieldName, double value)
      Constructs a new base term query.
      Parameters:
      fieldName - The name of the field
      value - The value of the term
    • BaseTermQueryBuilder

      public BaseTermQueryBuilder(String fieldName, boolean value)
      Constructs a new base term query.
      Parameters:
      fieldName - The name of the field
      value - The value of the term
    • BaseTermQueryBuilder

      public BaseTermQueryBuilder(String fieldName, Object value)
      Constructs a new base term query. In case value is assigned to a string, we internally convert it to a BytesRef because in TermQueryBuilder and SpanTermQueryBuilder string values are parsed to BytesRef 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 field
      value - The value of the term
    • BaseTermQueryBuilder

      protected BaseTermQueryBuilder(StreamInput in) throws IOException
      Read from a stream.
      Throws:
      IOException
  • Method Details