[[reference-termvectors]]

////////
===========================================================================================================================
||                                                                                                                       ||
||                                                                                                                       ||
||                                                                                                                       ||
||        ██████╗ ███████╗ █████╗ ██████╗ ███╗   ███╗███████╗                                                            ||
||        ██╔══██╗██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝                                                            ||
||        ██████╔╝█████╗  ███████║██║  ██║██╔████╔██║█████╗                                                              ||
||        ██╔══██╗██╔══╝  ██╔══██║██║  ██║██║╚██╔╝██║██╔══╝                                                              ||
||        ██║  ██║███████╗██║  ██║██████╔╝██║ ╚═╝ ██║███████╗                                                            ||
||        ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝╚═════╝ ╚═╝     ╚═╝╚══════╝                                                            ||
||                                                                                                                       ||
||                                                                                                                       ||
||    This file is autogenerated, DO NOT send pull requests that changes this file directly.                             ||
||    You should update the script that does the generation, which can be found in:                                      ||
||    https://github.com/elastic/elastic-client-generator-js                                                             ||
||                                                                                                                       ||
||    You can run the script with the following command:                                                                 ||
||       npm run elasticsearch -- --version <version>                                                                    ||
||                                                                                                                       ||
||                                                                                                                       ||
||                                                                                                                       ||
===========================================================================================================================
////////

[discrete]
[[client.termvectors]]
=== client.termvectors

Get term vector information. Get information and statistics about terms in the fields of a particular document.

{ref}/docs-termvectors.html[{es} documentation]

[discrete]
==== Function signature

[source,ts]
----
(TermvectorsRequest, options?): Promise<TermvectorsResponse>
----

[discrete]
==== Request

[pass]
++++
<pre>
++++
interface TermvectorsRequest<TDocument = unknown> extends <<RequestBase>> {
  index: <<IndexName>>
  id?: <<Id>>
  fields?: <<Fields>>
  field_statistics?: boolean
  offsets?: boolean
  payloads?: boolean
  positions?: boolean
  preference?: string
  realtime?: boolean
  routing?: <<Routing>>
  term_statistics?: boolean
  version?: <<VersionNumber>>
  version_type?: <<VersionType>>
  doc?: TDocument
  filter?: <<TermvectorsFilter>>
  per_field_analyzer?: Record<<<Field>>, string>
}

[pass]
++++
</pre>
++++
[discrete]
==== Response

[pass]
++++
<pre>
++++
interface TermvectorsResponse {
  found: boolean
  _id?: <<Id>>
  _index: <<IndexName>>
  term_vectors?: Record<<<Field>>, <<TermvectorsTermVector>>>
  took: <<long>>
  _version: <<VersionNumber>>
}

[pass]
++++
</pre>
++++
