# Offset of only one term in a document, not document vector

**URL:** <https://discuss.elastic.co/t/offset-of-only-one-term-in-a-document-not-document-vector/625>\
**Category:** Elasticsearch\
**Created:** [May 13, 2015, 2:14pm UTC](https://discuss.elastic.co/t/offset-of-only-one-term-in-a-document-not-document-vector/625 "2015-05-13T14:14:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![khodaei\_reza](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@khodaei\_reza](https://discuss.elastic.co/u/khodaei_reza)\
**Post date:** [May 13, 2015, 2:14pm UTC](https://discuss.elastic.co/t/offset-of-only-one-term-in-a-document-not-document-vector/625/1 "2015-05-13T14:14:20Z")

</div>

Hi.

I have very large documents, and is not efficient to retrieve the document vector of a document.

How can i search the offset and position of a term of a document in Elasticsearch?

thanks.

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [May 13, 2015, 2:34pm UTC](https://discuss.elastic.co/t/offset-of-only-one-term-in-a-document-not-document-vector/625/2 "2015-05-13T14:34:27Z")

</div>

Hi,

You already asked the same question two days ago, maybe you missed the answer? [Start and end offset of a token in elasticsearch](https://discuss.elastic.co/t/start-and-end-offset-of-a-token-in-elasticsearch/470)

---

<div class="post-metadata">

**Author:** ![khodaei\_reza](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@khodaei\_reza](https://discuss.elastic.co/u/khodaei_reza)\
**Post date:** [May 13, 2015, 2:38pm UTC](https://discuss.elastic.co/t/offset-of-only-one-term-in-a-document-not-document-vector/625/3 "2015-05-13T14:38:28Z")

</div>

yes i know.

i don't know it's possible or not, but i need it, it's necessary for me. Do you have any approach?

---

<div class="post-metadata">

**Author:** ![khodaei\_reza](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@khodaei\_reza](https://discuss.elastic.co/u/khodaei_reza)\
**Post date:** [May 13, 2015, 2:41pm UTC](https://discuss.elastic.co/t/offset-of-only-one-term-in-a-document-not-document-vector/625/4 "2015-05-13T14:41:25Z")

</div>

Can we filter the termvector based on a term value?

---

<div class="post-metadata">

**Author:** ![archana](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@archana](https://discuss.elastic.co/u/archana)\
**Post date:** [October 27, 2015, 3:58am UTC](https://discuss.elastic.co/t/offset-of-only-one-term-in-a-document-not-document-vector/625/5 "2015-10-27T03:58:26Z")

</div>

Hi,  
Yes, you can filter the termVector based on a term. I have been using this and works fine for me.

var result = \_client.Termvector(\_indexName, typeName, id, requestBody);  
dynamic response = result.Response;  
dynamic termVector = response.term\_vectors;  
dynamic tokens = termVector.Content.terms["" + query + ""].tokens;

Thanks,  
Archana

---

<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, 11:42pm UTC](https://discuss.elastic.co/t/offset-of-only-one-term-in-a-document-not-document-vector/625/6 "2017-07-05T23:42:32Z")

</div>


