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
,Streamable
,Writeable
,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()
,type(String)
andid(String)
are required.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TermVectorsRequest.FilterSettings
static class
TermVectorsRequest.Flag
-
Nested classes/interfaces inherited from class org.elasticsearch.transport.TransportRequest
TransportRequest.Empty
-
Nested classes/interfaces inherited from interface org.elasticsearch.action.IndicesRequest
IndicesRequest.Replaceable
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
preference
-
Fields inherited from class org.elasticsearch.action.support.single.shard.SingleShardRequest
index, INDICES_OPTIONS
-
-
Constructor Summary
Constructors Constructor Description TermVectorsRequest()
TermVectorsRequest(java.lang.String index, java.lang.String type, java.lang.String id)
Constructs a new term vector request for a document that will be fetch from the provided index.TermVectorsRequest(MultiGetRequest.Item item)
TermVectorsRequest(TermVectorsRequest other)
Constructs a new term vector request for a document that will be fetch from the provided index.
-
Method Summary
Modifier and Type Method Description BytesReference
doc()
Returns the artificial document from which term vectors are requested for.TermVectorsRequest
doc(BytesReference doc, boolean generateRandomId)
Deprecated.usedoc(BytesReference, boolean, XContentType)
to avoid content auto detectionTermVectorsRequest
doc(BytesReference doc, boolean generateRandomId, XContentType xContentType)
Sets an artificial document from which term vectors are requested for.TermVectorsRequest
doc(XContentBuilder documentBuilder)
Sets an artificial document from which term vectors are requested for.boolean
fieldStatistics()
TermVectorsRequest
fieldStatistics(boolean fieldStatistics)
Return the field statistics for each term in the shard or skip.TermVectorsRequest.FilterSettings
filterSettings()
Return the settings for filtering out terms.TermVectorsRequest
filterSettings(TermVectorsRequest.FilterSettings settings)
Sets the settings for filtering out terms.java.util.EnumSet<TermVectorsRequest.Flag>
getFlags()
java.lang.String
id()
Returns the id of document the term vector is requested for.TermVectorsRequest
id(java.lang.String id)
Sets the id of document the term vector is requested for.boolean
offsets()
TermVectorsRequest
offsets(boolean offsets)
Return the start and stop offsets for each term if they were stored or skip offsets.java.lang.String
parent()
TermVectorsRequest
parent(java.lang.String parent)
Sets the parent id of this document.static void
parseRequest(TermVectorsRequest termVectorsRequest, XContentParser parser)
populates a request object (pre-populated with defaults) based on a parser.boolean
payloads()
TermVectorsRequest
payloads(boolean payloads)
Return the payloads for each term or skip.java.util.Map<java.lang.String,java.lang.String>
perFieldAnalyzer()
Return the overridden analyzers at each field.TermVectorsRequest
perFieldAnalyzer(java.util.Map<java.lang.String,java.lang.String> perFieldAnalyzer)
Override the analyzer used at each field when generating term vectors.boolean
positions()
TermVectorsRequest
positions(boolean positions)
Return the positions for each term if stored or skip.java.lang.String
preference()
TermVectorsRequest
preference(java.lang.String preference)
Sets the preference to execute the search.void
readFrom(StreamInput in)
Set this object's fields from a StreamInput.static java.util.Map<java.lang.String,java.lang.String>
readPerFieldAnalyzer(java.util.Map<java.lang.String,java.lang.Object> map)
static TermVectorsRequest
readTermVectorsRequest(StreamInput in)
boolean
realtime()
Return whether term vectors should be generated real-time (default to true).TermVectorsRequest
realtime(boolean realtime)
java.lang.String
routing()
TermVectorsRequest
routing(java.lang.String routing)
java.util.Set<java.lang.String>
selectedFields()
Return only term vectors for special selected fields.TermVectorsRequest
selectedFields(java.lang.String... fields)
Return only term vectors for special selected fields.boolean
termStatistics()
TermVectorsRequest
termStatistics(boolean termStatistics)
Return the term statistics for each term in the shard or skip.java.lang.String
type()
Returns the type of document to get the term vector for.TermVectorsRequest
type(java.lang.String type)
Sets the type of document to get the term vector for.ActionRequestValidationException
validate()
long
version()
TermVectorsRequest
version(long version)
VersionType
versionType()
TermVectorsRequest
versionType(VersionType versionType)
void
writeTo(StreamOutput out)
Write this object's fields to a StreamOutput.XContentType
xContentType()
-
Methods inherited from class org.elasticsearch.action.support.single.shard.SingleShardRequest
index, index, indices, indicesOptions, validateNonNullIndex
-
Methods inherited from class org.elasticsearch.action.ActionRequest
getShouldStoreResult
-
Methods inherited from class org.elasticsearch.transport.TransportRequest
getParentTask, setParentTask
-
Methods inherited from class org.elasticsearch.transport.TransportMessage
remoteAddress, remoteAddress
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask, getDescription, setParentTask
-
-
-
-
Constructor Detail
-
TermVectorsRequest
public TermVectorsRequest()
-
TermVectorsRequest
public TermVectorsRequest(java.lang.String index, java.lang.String type, java.lang.String id)
Constructs a new term vector request for a document that will be fetch from the provided index. Usetype(String)
andid(String)
to specify the document to load.
-
TermVectorsRequest
public TermVectorsRequest(TermVectorsRequest other)
Constructs a new term vector request for a document that will be fetch from the provided index. Usetype(String)
andid(String)
to specify the document to load.
-
TermVectorsRequest
public TermVectorsRequest(MultiGetRequest.Item item)
-
-
Method Detail
-
getFlags
public java.util.EnumSet<TermVectorsRequest.Flag> getFlags()
-
type
public TermVectorsRequest type(java.lang.String type)
Sets the type of document to get the term vector for.
-
type
public java.lang.String type()
Returns the type of document to get the term vector for.
-
id
public java.lang.String id()
Returns the id of document the term vector is requested for.
-
id
public TermVectorsRequest id(java.lang.String id)
Sets the id of document the term vector is requested for.
-
doc
public BytesReference doc()
Returns the artificial document from which term vectors are requested for.
-
xContentType
public XContentType xContentType()
-
doc
public TermVectorsRequest doc(XContentBuilder documentBuilder)
Sets an artificial document from which term vectors are requested for.
-
doc
@Deprecated public TermVectorsRequest doc(BytesReference doc, boolean generateRandomId)
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
public java.lang.String routing()
- Returns:
- The routing for this request.
-
routing
public TermVectorsRequest routing(java.lang.String routing)
-
parent
public java.lang.String parent()
-
parent
public TermVectorsRequest parent(java.lang.String parent)
Sets the parent id of this document.
-
preference
public java.lang.String preference()
-
preference
public TermVectorsRequest preference(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,_primary
to execute only on primary shards, or a custom value, which guarantees that the same order will be used across different requests.
-
offsets
public TermVectorsRequest offsets(boolean offsets)
Return the start and stop offsets for each term if they were stored or skip offsets.
-
offsets
public boolean offsets()
- Returns:
true
if term offsets should be returned. Otherwisefalse
-
positions
public TermVectorsRequest positions(boolean 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:
true
if term payloads should be returned. Otherwisefalse
-
payloads
public TermVectorsRequest payloads(boolean payloads)
Return the payloads for each term or skip.
-
termStatistics
public boolean termStatistics()
- Returns:
true
if term statistics should be returned. Otherwisefalse
-
termStatistics
public TermVectorsRequest termStatistics(boolean termStatistics)
Return the term statistics for each term in the shard or skip.
-
fieldStatistics
public boolean fieldStatistics()
- Returns:
true
if field statistics should be returned. Otherwisefalse
-
fieldStatistics
public TermVectorsRequest fieldStatistics(boolean fieldStatistics)
Return the field statistics for each term in the shard or skip.
-
selectedFields
public java.util.Set<java.lang.String> selectedFields()
Return only term vectors for special selected fields. Returns for term vectors for all fields if selectedFields == null
-
selectedFields
public TermVectorsRequest selectedFields(java.lang.String... fields)
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
public TermVectorsRequest realtime(boolean realtime)
- Specified by:
realtime
in interfaceRealtimeRequest
- Parameters:
realtime
- Controls whether this request should be realtime by reading from the translog.
-
perFieldAnalyzer
public java.util.Map<java.lang.String,java.lang.String> perFieldAnalyzer()
Return the overridden analyzers at each field.
-
perFieldAnalyzer
public TermVectorsRequest perFieldAnalyzer(java.util.Map<java.lang.String,java.lang.String> perFieldAnalyzer)
Override the analyzer used at each field when generating term vectors.
-
filterSettings
public TermVectorsRequest.FilterSettings filterSettings()
Return the settings for filtering out terms.
-
filterSettings
public TermVectorsRequest filterSettings(TermVectorsRequest.FilterSettings settings)
Sets the settings for filtering out terms.
-
version
public long version()
-
version
public TermVectorsRequest version(long version)
-
versionType
public VersionType versionType()
-
versionType
public TermVectorsRequest versionType(VersionType versionType)
-
validate
public ActionRequestValidationException validate()
- Specified by:
validate
in classActionRequest
-
readTermVectorsRequest
public static TermVectorsRequest readTermVectorsRequest(StreamInput in) throws java.io.IOException
- Throws:
java.io.IOException
-
readFrom
public void readFrom(StreamInput in) throws java.io.IOException
Description copied from interface:Streamable
Set this object's fields from a StreamInput.- Specified by:
readFrom
in interfaceStreamable
- Overrides:
readFrom
in classSingleShardRequest<TermVectorsRequest>
- Throws:
java.io.IOException
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:Streamable
Write this object's fields to a StreamOutput.- Specified by:
writeTo
in interfaceStreamable
- Specified by:
writeTo
in interfaceWriteable
- Overrides:
writeTo
in classSingleShardRequest<TermVectorsRequest>
- Throws:
java.io.IOException
-
parseRequest
public static void parseRequest(TermVectorsRequest termVectorsRequest, XContentParser parser) throws java.io.IOException
populates a request object (pre-populated with defaults) based on a parser.- Throws:
java.io.IOException
-
readPerFieldAnalyzer
public static java.util.Map<java.lang.String,java.lang.String> readPerFieldAnalyzer(java.util.Map<java.lang.String,java.lang.Object> map)
-
-