Class TermvectorsRequest.Builder<TDocument>

All Implemented Interfaces:
WithJson<TermvectorsRequest.Builder<TDocument>>, ObjectBuilder<TermvectorsRequest<TDocument>>
Enclosing class:
TermvectorsRequest<TDocument>

public static class TermvectorsRequest.Builder<TDocument> extends RequestBase.AbstractBuilder<TermvectorsRequest.Builder<TDocument>> implements ObjectBuilder<TermvectorsRequest<TDocument>>
Builder for TermvectorsRequest.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • doc

      public final TermvectorsRequest.Builder<TDocument> doc(@Nullable TDocument value)
      An artificial document (a document not present in the index) for which you want to retrieve term vectors.

      API name: doc

    • fieldStatistics

      public final TermvectorsRequest.Builder<TDocument> fieldStatistics(@Nullable Boolean value)
      If true, the response includes:
      • The document count (how many documents contain this field).
      • The sum of document frequencies (the sum of document frequencies for all terms in this field).
      • The sum of total term frequencies (the sum of total term frequencies of each term in this field).

      API name: field_statistics

    • fields

      public final TermvectorsRequest.Builder<TDocument> fields(List<String> list)
      A list of fields to include in the statistics. It is used as the default list unless a specific field list is provided in the completion_fields or fielddata_fields parameters.

      API name: fields

      Adds all elements of list to fields.

    • fields

      public final TermvectorsRequest.Builder<TDocument> fields(String value, String... values)
      A list of fields to include in the statistics. It is used as the default list unless a specific field list is provided in the completion_fields or fielddata_fields parameters.

      API name: fields

      Adds one or more values to fields.

    • filter

      public final TermvectorsRequest.Builder<TDocument> filter(@Nullable Filter value)
      Filter terms based on their tf-idf scores. This could be useful in order find out a good characteristic vector of a document. This feature works in a similar manner to the second phase of the More Like This Query.

      API name: filter

    • filter

      Filter terms based on their tf-idf scores. This could be useful in order find out a good characteristic vector of a document. This feature works in a similar manner to the second phase of the More Like This Query.

      API name: filter

    • id

      public final TermvectorsRequest.Builder<TDocument> id(@Nullable String value)
      A unique identifier for the document.

      API name: id

    • index

      public final TermvectorsRequest.Builder<TDocument> index(String value)
      Required - The name of the index that contains the document.

      API name: index

    • offsets

      public final TermvectorsRequest.Builder<TDocument> offsets(@Nullable Boolean value)
      If true, the response includes term offsets.

      API name: offsets

    • payloads

      public final TermvectorsRequest.Builder<TDocument> payloads(@Nullable Boolean value)
      If true, the response includes term payloads.

      API name: payloads

    • perFieldAnalyzer

      public final TermvectorsRequest.Builder<TDocument> perFieldAnalyzer(Map<String,String> map)
      Override the default per-field analyzer. This is useful in order to generate term vectors in any fashion, especially when using artificial documents. When providing an analyzer for a field that already stores term vectors, the term vectors will be regenerated.

      API name: per_field_analyzer

      Adds all entries of map to perFieldAnalyzer.

    • perFieldAnalyzer

      public final TermvectorsRequest.Builder<TDocument> perFieldAnalyzer(String key, String value)
      Override the default per-field analyzer. This is useful in order to generate term vectors in any fashion, especially when using artificial documents. When providing an analyzer for a field that already stores term vectors, the term vectors will be regenerated.

      API name: per_field_analyzer

      Adds an entry to perFieldAnalyzer.

    • positions

      public final TermvectorsRequest.Builder<TDocument> positions(@Nullable Boolean value)
      If true, the response includes term positions.

      API name: positions

    • preference

      public final TermvectorsRequest.Builder<TDocument> preference(@Nullable String value)
      The node or shard the operation should be performed on. It is random by default.

      API name: preference

    • realtime

      public final TermvectorsRequest.Builder<TDocument> realtime(@Nullable Boolean value)
      If true, the request is real-time as opposed to near-real-time.

      API name: realtime

    • routing

      public final TermvectorsRequest.Builder<TDocument> routing(@Nullable String value)
      A custom value that is used to route operations to a specific shard.

      API name: routing

    • termStatistics

      public final TermvectorsRequest.Builder<TDocument> termStatistics(@Nullable Boolean value)
      If true, the response includes:
      • The total term frequency (how often a term occurs in all documents).
      • The document frequency (the number of documents containing the current term).

      By default these values are not returned since term statistics can have a serious performance impact.

      API name: term_statistics

    • version

      public final TermvectorsRequest.Builder<TDocument> version(@Nullable Long value)
      If true, returns the document version as part of a hit.

      API name: version

    • versionType

      public final TermvectorsRequest.Builder<TDocument> versionType(@Nullable VersionType value)
      The version type.

      API name: version_type

    • tDocumentSerializer

      public final TermvectorsRequest.Builder<TDocument> tDocumentSerializer(@Nullable JsonpSerializer<TDocument> value)
      Serializer for TDocument. If not set, an attempt will be made to find a serializer from the JSON context.
    • self

      Specified by:
      self in class RequestBase.AbstractBuilder<TermvectorsRequest.Builder<TDocument>>
    • build

      public TermvectorsRequest<TDocument> build()
      Specified by:
      build in interface ObjectBuilder<TDocument>
      Throws:
      NullPointerException - if some of the required fields are null.