Module org.elasticsearch.server
Class TermVectorsRequest
java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.TransportRequest
org.elasticsearch.action.ActionRequest
org.elasticsearch.action.support.single.shard.SingleShardRequest<TermVectorsRequest>
org.elasticsearch.action.termvectors.TermVectorsRequest
- All Implemented Interfaces:
IndicesRequest,RealtimeRequest,Writeable,RefCounted,TaskAwareRequest
public class TermVectorsRequest
extends SingleShardRequest<TermVectorsRequest>
implements RealtimeRequest
Request returning the term vector (doc frequency, positions, offsets) for a document.
Note, the SingleShardRequest.index() and id(String) are required.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic enumNested classes/interfaces inherited from class org.elasticsearch.transport.TransportRequest
TransportRequest.EmptyNested classes/interfaces inherited from interface org.elasticsearch.action.IndicesRequest
IndicesRequest.ReplaceableNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsFields inherited from class org.elasticsearch.action.support.single.shard.SingleShardRequest
index, INDICES_OPTIONS -
Constructor Summary
ConstructorsConstructorDescriptionTermVectorsRequest(String index, String id) Constructs a new term vector request for a document that will be fetch from the provided index.Constructs a new term vector request for a document that will be fetch from the provided index. -
Method Summary
Modifier and TypeMethodDescriptiondoc()Returns the artificial document from which term vectors are requested for.doc(BytesReference doc, boolean generateRandomId) Deprecated.doc(BytesReference doc, boolean generateRandomId, XContentType xContentType) Sets an artificial document from which term vectors are requested for.doc(XContentBuilder documentBuilder) Sets an artificial document from which term vectors are requested for.booleanfieldStatistics(boolean fieldStatistics) Return the field statistics for each term in the shard or skip.Return the settings for filtering out terms.Sets the settings for filtering out terms.getFlags()id()Returns the id of document the term vector is requested for.Sets the id of document the term vector is requested for.booleanoffsets()offsets(boolean offsets) Return the start and stop offsets for each term if they were stored or skip offsets.static voidparseRequest(TermVectorsRequest termVectorsRequest, XContentParser parser, RestApiVersion restApiVersion) populates a request object (pre-populated with defaults) based on a parser.booleanpayloads()payloads(boolean payloads) Return the payloads for each term or skip.Return the overridden analyzers at each field.perFieldAnalyzer(Map<String, String> perFieldAnalyzer) Override the analyzer used at each field when generating term vectors.booleanpositions(boolean positions) Return the positions for each term if stored or skip.preference(String preference) Sets the preference to execute the search.readPerFieldAnalyzer(Map<String, Object> map) booleanrealtime()Return whether term vectors should be generated real-time (default to true).realtime(boolean realtime) routing()Return only term vectors for special selected fields.selectedFields(String... fields) Return only term vectors for special selected fields.booleantermStatistics(boolean termStatistics) Return the term statistics for each term in the shard or skip.validate()longversion()version(long version) versionType(VersionType versionType) voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.action.support.single.shard.SingleShardRequest
index, index, indices, indicesOptions, validateNonNullIndexMethods inherited from class org.elasticsearch.action.ActionRequest
getShouldStoreResultMethods inherited from class org.elasticsearch.transport.TransportRequest
getParentTask, setParentTask, toStringMethods inherited from class org.elasticsearch.transport.TransportMessage
decRef, hasReferences, incRef, remoteAddress, remoteAddress, tryIncRefMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.action.IndicesRequest
includeDataStreamsMethods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask, getDescription, setParentTask
-
Field Details
-
preference
-
-
Constructor Details
-
TermVectorsRequest
public TermVectorsRequest() -
TermVectorsRequest
Constructs a new term vector request for a document that will be fetch from the provided index. Use andid(String)to specify the document to load. -
TermVectorsRequest
Constructs a new term vector request for a document that will be fetch from the provided index. Useid(String)to specify the document to load. -
TermVectorsRequest
-
-
Method Details
-
getFlags
-
id
Returns the id of document the term vector is requested for. -
id
Sets the id of document the term vector is requested for. -
doc
Returns the artificial document from which term vectors are requested for. -
xContentType
-
doc
Sets an artificial document from which term vectors are requested for. -
doc
Deprecated.usedoc(BytesReference, boolean, XContentType)to avoid content auto detectionSets an artificial document from which term vectors are requested for. -
doc
public TermVectorsRequest doc(BytesReference doc, boolean generateRandomId, XContentType xContentType) Sets an artificial document from which term vectors are requested for. -
routing
- Returns:
- The routing for this request.
-
routing
-
preference
-
preference
Sets the preference to execute the search. Defaults to randomize across shards. Can be set to_localto prefer local shards or a custom value, which guarantees that the same order will be used across different requests. -
offsets
Return the start and stop offsets for each term if they were stored or skip offsets. -
offsets
public boolean offsets()- Returns:
trueif term offsets should be returned. Otherwisefalse
-
positions
Return the positions for each term if stored or skip. -
positions
public boolean positions()- Returns:
- Returns if the positions for each term should be returned if stored or skip.
-
payloads
public boolean payloads()- Returns:
trueif term payloads should be returned. Otherwisefalse
-
payloads
Return the payloads for each term or skip. -
termStatistics
public boolean termStatistics()- Returns:
trueif term statistics should be returned. Otherwisefalse
-
termStatistics
Return the term statistics for each term in the shard or skip. -
fieldStatistics
public boolean fieldStatistics()- Returns:
trueif field statistics should be returned. Otherwisefalse
-
fieldStatistics
Return the field statistics for each term in the shard or skip. -
selectedFields
Return only term vectors for special selected fields. Returns for term vectors for all fields if selectedFields == null -
selectedFields
Return only term vectors for special selected fields. Returns the term vectors for all fields if selectedFields == null -
realtime
public boolean realtime()Return whether term vectors should be generated real-time (default to true). -
realtime
- Specified by:
realtimein interfaceRealtimeRequest- Parameters:
realtime- Controls whether this request should be realtime by reading from the translog.
-
perFieldAnalyzer
Return the overridden analyzers at each field. -
perFieldAnalyzer
Override the analyzer used at each field when generating term vectors. -
filterSettings
Return the settings for filtering out terms. -
filterSettings
Sets the settings for filtering out terms. -
version
public long version() -
version
-
versionType
-
versionType
-
validate
- Specified by:
validatein classActionRequest
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classSingleShardRequest<TermVectorsRequest>- Throws:
IOException
-
parseRequest
public static void parseRequest(TermVectorsRequest termVectorsRequest, XContentParser parser, RestApiVersion restApiVersion) throws IOException populates a request object (pre-populated with defaults) based on a parser.- Throws:
IOException
-
readPerFieldAnalyzer
-
doc(BytesReference, boolean, XContentType)to avoid content auto detection