Get term vector information
Get information and statistics about terms in the fields of a particular document.
Path parameters
-
Name of the index that contains the document.
Query parameters
-
fields string | array[string]
Comma-separated list or wildcard expressions of fields to include in the statistics. Used as the default list unless a specific field list is provided in the
completion_fields
orfielddata_fields
parameters. -
field_statistics boolean
If
true
, the response includes the document count, sum of document frequencies, and sum of total term frequencies. -
offsets boolean
If
true
, the response includes term offsets. -
payloads boolean
If
true
, the response includes term payloads. -
positions boolean
If
true
, the response includes term positions. -
preference string
Specifies the node or shard the operation should be performed on. Random by default.
-
realtime boolean
If true, the request is real-time as opposed to near-real-time.
-
routing string
Custom value used to route operations to a specific shard.
-
term_statistics boolean
If
true
, the response includes term frequency and document frequency. -
version number
If
true
, returns the document version as part of a hit. -
version_type string
Specific version type.
Values are
internal
,external
,external_gte
, orforce
.
Body
-
doc object
An artificial document (a document not present in the index) for which you want to retrieve term vectors.
Additional properties are allowed.
-
filter object
Additional properties are allowed.
-
per_field_analyzer object
Overrides the default per-field analyzer.
curl \
-X POST http://api.example.com/{index}/_termvectors \
-H "Content-Type: application/json" \
-d '{"doc":{},"filter":{"max_doc_freq":42.0,"max_num_terms":42.0,"max_term_freq":42.0,"max_word_length":42.0,"min_doc_freq":42.0,"min_term_freq":42.0,"min_word_length":42.0},"per_field_analyzer":{"additionalProperty1":"string","additionalProperty2":"string"}}'
{
"doc": {},
"filter": {
"max_doc_freq": 42.0,
"max_num_terms": 42.0,
"max_term_freq": 42.0,
"max_word_length": 42.0,
"min_doc_freq": 42.0,
"min_term_freq": 42.0,
"min_word_length": 42.0
},
"per_field_analyzer": {
"additionalProperty1": "string",
"additionalProperty2": "string"
}
}
{
"found": true,
"_id": "string",
"_index": "string",
"term_vectors": {
"additionalProperty1": {
"field_statistics": {
"doc_count": 42.0,
"sum_doc_freq": 42.0,
"sum_ttf": 42.0
},
"terms": {
"additionalProperty1": {
"doc_freq": 42.0,
"score": 42.0,
"term_freq": 42.0,
"tokens": [
{}
],
"ttf": 42.0
},
"additionalProperty2": {
"doc_freq": 42.0,
"score": 42.0,
"term_freq": 42.0,
"tokens": [
{}
],
"ttf": 42.0
}
}
},
"additionalProperty2": {
"field_statistics": {
"doc_count": 42.0,
"sum_doc_freq": 42.0,
"sum_ttf": 42.0
},
"terms": {
"additionalProperty1": {
"doc_freq": 42.0,
"score": 42.0,
"term_freq": 42.0,
"tokens": [
{}
],
"ttf": 42.0
},
"additionalProperty2": {
"doc_freq": 42.0,
"score": 42.0,
"term_freq": 42.0,
"tokens": [
{}
],
"ttf": 42.0
}
}
}
},
"took": 42.0,
"_version": 42.0
}