Class TermVectorsRequestBuilder
java.lang.Object
org.elasticsearch.action.ActionRequestBuilder<TermVectorsRequest,TermVectorsResponse>
org.elasticsearch.action.termvectors.TermVectorsRequestBuilder
public class TermVectorsRequestBuilder
extends ActionRequestBuilder<TermVectorsRequest,TermVectorsResponse>
The builder class for a term vector request.
Returns the term vector (doc frequency, positions, offsets) for a document.
Note, the index
, type
and id
are
required.
-
Field Summary
Fields inherited from class org.elasticsearch.action.ActionRequestBuilder
action, client, request
-
Constructor Summary
ConstructorDescriptionTermVectorsRequestBuilder(ElasticsearchClient client, TermVectorsAction action)
TermVectorsRequestBuilder(ElasticsearchClient client, TermVectorsAction action, String index, String type, String id)
Constructs a new term vector request builder for a document that will be fetch from the provided index. -
Method Summary
Modifier and TypeMethodDescriptionsetDoc(org.elasticsearch.common.xcontent.XContentBuilder xContent)
Sets the artificial document from which to generate term vectors.setFieldStatistics(boolean fieldStatistics)
Sets whether to return the field statistics for each term in the shard or skip.setFilterSettings(TermVectorsRequest.FilterSettings filterSettings)
Sets the settings for filtering out terms.Sets the id of the document.Sets the index where the document is located.setOffsets(boolean offsets)
Sets whether to return the start and stop offsets for each term if they were stored or skip offsets.setPayloads(boolean payloads)
Sets whether to return the payloads for each term or skip.setPerFieldAnalyzer(Map<String,String> perFieldAnalyzer)
Sets the analyzer used at each field when generating term vectors.setPositions(boolean positions)
Sets whether to return the positions for each term if stored or skip.setPreference(String preference)
Sets the preference to execute the search.setRealtime(boolean realtime)
Sets whether term vectors are generated real-time.setRouting(String routing)
Sets the routing.setSelectedFields(String... fields)
Sets whether to return only term vectors for special selected fields.setTermStatistics(boolean termStatistics)
Sets whether to return the term statistics for each term in the shard or skip.Sets the type of the document.setVersion(long version)
setVersionType(VersionType versionType)
-
Constructor Details
-
TermVectorsRequestBuilder
-
TermVectorsRequestBuilder
public TermVectorsRequestBuilder(ElasticsearchClient client, TermVectorsAction action, String index, String type, String id)Constructs a new term vector request builder for a document that will be fetch from the provided index. Useindex
,type
andid
to specify the document to load.
-
-
Method Details
-
setIndex
Sets the index where the document is located. -
setType
Sets the type of the document. -
setId
Sets the id of the document. -
setDoc
Sets the artificial document from which to generate term vectors. -
setRouting
Sets the routing. Required if routing isn't id based. -
setPreference
Sets the preference to execute the search. Defaults to randomize across shards. Can be set to_local
to prefer local shards or a custom value, which guarantees that the same order will be used across different requests. -
setOffsets
Sets whether to return the start and stop offsets for each term if they were stored or skip offsets. -
setPositions
Sets whether to return the positions for each term if stored or skip. -
setPayloads
Sets whether to return the payloads for each term or skip. -
setTermStatistics
Sets whether to return the term statistics for each term in the shard or skip. -
setFieldStatistics
Sets whether to return the field statistics for each term in the shard or skip. -
setSelectedFields
Sets whether to return only term vectors for special selected fields. Returns the term vectors for all fields if selectedFields == null -
setRealtime
Sets whether term vectors are generated real-time. -
setVersion
-
setVersionType
-
setPerFieldAnalyzer
Sets the analyzer used at each field when generating term vectors. -
setFilterSettings
public TermVectorsRequestBuilder setFilterSettings(TermVectorsRequest.FilterSettings filterSettings)Sets the settings for filtering out terms.
-