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
andid
are required.
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.action.ActionRequestBuilder
action, client, request
-
-
Constructor Summary
Constructors Constructor Description TermVectorsRequestBuilder(ElasticsearchClient client, TermVectorsAction action)
TermVectorsRequestBuilder(ElasticsearchClient client, TermVectorsAction action, java.lang.String index, java.lang.String type, java.lang.String id)
Constructs a new term vector request builder for a document that will be fetch from the provided index.
-
Method Summary
Modifier and Type Method Description TermVectorsRequestBuilder
setDoc(XContentBuilder xContent)
Sets the artificial document from which to generate term vectors.TermVectorsRequestBuilder
setFieldStatistics(boolean fieldStatistics)
Sets whether to return the field statistics for each term in the shard or skip.TermVectorsRequestBuilder
setFilterSettings(TermVectorsRequest.FilterSettings filterSettings)
Sets the settings for filtering out terms.TermVectorsRequestBuilder
setId(java.lang.String id)
Sets the id of the document.TermVectorsRequestBuilder
setIndex(java.lang.String index)
Sets the index where the document is located.TermVectorsRequestBuilder
setOffsets(boolean offsets)
Sets whether to return the start and stop offsets for each term if they were stored or skip offsets.TermVectorsRequestBuilder
setPayloads(boolean payloads)
Sets whether to return the payloads for each term or skip.TermVectorsRequestBuilder
setPerFieldAnalyzer(java.util.Map<java.lang.String,java.lang.String> perFieldAnalyzer)
Sets the analyzer used at each field when generating term vectors.TermVectorsRequestBuilder
setPositions(boolean positions)
Sets whether to return the positions for each term if stored or skip.TermVectorsRequestBuilder
setPreference(java.lang.String preference)
Sets the preference to execute the search.TermVectorsRequestBuilder
setRealtime(boolean realtime)
Sets whether term vectors are generated real-time.TermVectorsRequestBuilder
setRouting(java.lang.String routing)
Sets the routing.TermVectorsRequestBuilder
setSelectedFields(java.lang.String... fields)
Sets whether to return only term vectors for special selected fields.TermVectorsRequestBuilder
setTermStatistics(boolean termStatistics)
Sets whether to return the term statistics for each term in the shard or skip.TermVectorsRequestBuilder
setType(java.lang.String type)
Sets the type of the document.TermVectorsRequestBuilder
setVersion(long version)
TermVectorsRequestBuilder
setVersionType(VersionType versionType)
-
-
-
Constructor Detail
-
TermVectorsRequestBuilder
public TermVectorsRequestBuilder(ElasticsearchClient client, TermVectorsAction action)
-
TermVectorsRequestBuilder
public TermVectorsRequestBuilder(ElasticsearchClient client, TermVectorsAction action, java.lang.String index, java.lang.String type, java.lang.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 Detail
-
setIndex
public TermVectorsRequestBuilder setIndex(java.lang.String index)
Sets the index where the document is located.
-
setType
public TermVectorsRequestBuilder setType(java.lang.String type)
Sets the type of the document.
-
setId
public TermVectorsRequestBuilder setId(java.lang.String id)
Sets the id of the document.
-
setDoc
public TermVectorsRequestBuilder setDoc(XContentBuilder xContent)
Sets the artificial document from which to generate term vectors.
-
setRouting
public TermVectorsRequestBuilder setRouting(java.lang.String routing)
Sets the routing. Required if routing isn't id based.
-
setPreference
public TermVectorsRequestBuilder setPreference(java.lang.String preference)
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
public TermVectorsRequestBuilder setOffsets(boolean offsets)
Sets whether to return the start and stop offsets for each term if they were stored or skip offsets.
-
setPositions
public TermVectorsRequestBuilder setPositions(boolean positions)
Sets whether to return the positions for each term if stored or skip.
-
setPayloads
public TermVectorsRequestBuilder setPayloads(boolean payloads)
Sets whether to return the payloads for each term or skip.
-
setTermStatistics
public TermVectorsRequestBuilder setTermStatistics(boolean termStatistics)
Sets whether to return the term statistics for each term in the shard or skip.
-
setFieldStatistics
public TermVectorsRequestBuilder setFieldStatistics(boolean fieldStatistics)
Sets whether to return the field statistics for each term in the shard or skip.
-
setSelectedFields
public TermVectorsRequestBuilder setSelectedFields(java.lang.String... fields)
Sets whether to return only term vectors for special selected fields. Returns the term vectors for all fields if selectedFields == null
-
setRealtime
public TermVectorsRequestBuilder setRealtime(boolean realtime)
Sets whether term vectors are generated real-time.
-
setVersion
public TermVectorsRequestBuilder setVersion(long version)
-
setVersionType
public TermVectorsRequestBuilder setVersionType(VersionType versionType)
-
setPerFieldAnalyzer
public TermVectorsRequestBuilder setPerFieldAnalyzer(java.util.Map<java.lang.String,java.lang.String> perFieldAnalyzer)
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.
-
-