# Is there a way to get all the tokens in the term vector of an index

**URL:** https://discuss.elastic.co/t/is-there-a-way-to-get-all-the-tokens-in-the-term-vector-of-an-index/60202
**Category:** Elasticsearch
**Created:** [September 9, 2016, 11:08pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-get-all-the-tokens-in-the-term-vector-of-an-index/60202 "2016-09-09T23:08:16Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tyka](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@tyka](https://discuss.elastic.co/u/tyka)
#### Post date: [September 9, 2016, 11:08pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-get-all-the-tokens-in-the-term-vector-of-an-index/60202/1 "2016-09-09T23:08:16Z")

</div>

Hi,

I have a set of documents and I stored term vectors of a text field when indexing. Is it possible to get all the tokens stored in the term vectors of all documents?  
I want to get a vocabulary for my documents and that is why thinking in this direction.

Thanks!

---

<div class="post-metadata">

### Author: ![javanna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javanna/32/4698_2.png) [@javanna](https://discuss.elastic.co/u/javanna)
#### Post date: [September 12, 2016, 8:41am UTC](https://discuss.elastic.co/t/is-there-a-way-to-get-all-the-tokens-in-the-term-vector-of-an-index/60202/2 "2016-09-12T08:41:21Z")

</div>

I don't think there is a way to get all term\_vectors for all documents in a single call, but you can get term\_vectors for a specific document by id. Maybe you can simply run a search scroll and retrieve term\_vectors for each document? That may take a while depending on how many documents you have, but it should do it.

---

<div class="post-metadata">

### Author: ![tyka](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@tyka](https://discuss.elastic.co/u/tyka)
#### Post date: [September 12, 2016, 6:08pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-get-all-the-tokens-in-the-term-vector-of-an-index/60202/3 "2016-09-12T18:08:34Z")

</div>

Because I have a large number of documents, retrieving for each document seem to be very inefficient. But it looks like that's the best option available.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 5, 2017, 10:20pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-get-all-the-tokens-in-the-term-vector-of-an-index/60202/4 "2017-07-05T22:20:59Z")

</div>


