Class TermvectorsRequest.Builder<TDocument>
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<BuilderT>
co.elastic.clients.elasticsearch._types.RequestBase.AbstractBuilder<TermvectorsRequest.Builder<TDocument>>
co.elastic.clients.elasticsearch.core.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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aTermvectorsRequest
.An artificial document (a document not present in the index) for which you want to retrieve term vectors.A list of fields to include in the statistics.A list of fields to include in the statistics.fieldStatistics
(Boolean value) Iftrue
, 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).Filter terms based on their tf-idf scores.Filter terms based on their tf-idf scores.A unique identifier for the document.Required - The name of the index that contains the document.Iftrue
, the response includes term offsets.Iftrue
, the response includes term payloads.perFieldAnalyzer
(String key, String value) Override the default per-field analyzer.perFieldAnalyzer
(Map<String, String> map) Override the default per-field analyzer.Iftrue
, the response includes term positions.preference
(String value) The node or shard the operation should be performed on.If true, the request is real-time as opposed to near-real-time.A custom value that is used to route operations to a specific shard.protected TermvectorsRequest.Builder<TDocument>
self()
Serializer for TDocument.termStatistics
(Boolean value) Iftrue
, 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).Iftrue
, returns the document version as part of a hit.versionType
(VersionType value) The version type.Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJson
Methods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
doc
An artificial document (a document not present in the index) for which you want to retrieve term vectors.API name:
doc
-
fieldStatistics
Iftrue
, 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
A list of fields to include in the statistics. It is used as the default list unless a specific field list is provided in thecompletion_fields
orfielddata_fields
parameters.API name:
fields
Adds all elements of
list
tofields
. -
fields
A list of fields to include in the statistics. It is used as the default list unless a specific field list is provided in thecompletion_fields
orfielddata_fields
parameters.API name:
fields
Adds one or more values to
fields
. -
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
-
filter
public final TermvectorsRequest.Builder<TDocument> filter(Function<Filter.Builder, ObjectBuilder<Filter>> fn) 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
A unique identifier for the document.API name:
id
-
index
Required - The name of the index that contains the document.API name:
index
-
offsets
Iftrue
, the response includes term offsets.API name:
offsets
-
payloads
Iftrue
, the response includes term payloads.API name:
payloads
-
perFieldAnalyzer
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
toperFieldAnalyzer
. -
perFieldAnalyzer
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
Iftrue
, the response includes term positions.API name:
positions
-
preference
The node or shard the operation should be performed on. It is random by default.API name:
preference
-
realtime
If true, the request is real-time as opposed to near-real-time.API name:
realtime
-
routing
A custom value that is used to route operations to a specific shard.API name:
routing
-
termStatistics
Iftrue
, 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
Iftrue
, returns the document version as part of a hit.API name:
version
-
versionType
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 classRequestBase.AbstractBuilder<TermvectorsRequest.Builder<TDocument>>
-
build
Builds aTermvectorsRequest
.- Specified by:
build
in interfaceObjectBuilder<TDocument>
- Throws:
NullPointerException
- if some of the required fields are null.
-