# Term Vectors within search API

**URL:** https://discuss.elastic.co/t/term-vectors-within-search-api/203373
**Category:** Elasticsearch
**Created:** [October 14, 2019, 3:06am UTC](https://discuss.elastic.co/t/term-vectors-within-search-api/203373 "2019-10-14T03:06:49Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![chandu\_tricon](https://avatars.discourse-cdn.com/v4/letter/c/4bbf92/32.png) [@chandu\_tricon](https://discuss.elastic.co/u/chandu_tricon)
#### Post date: [October 14, 2019, 3:06am UTC](https://discuss.elastic.co/t/term-vectors-within-search-api/203373/1 "2019-10-14T03:06:49Z")

</div>

I have a scenario where I need to return the position of a word in the field (same as Term Vectors position) within the search results of a keyword.

I have couple of questions:

1. Term Vectors API would only work on an ID/Multi ID. Instead, can we achieve this using Search API as well?
2. Is there a way to leverage Term Vectors by ID to return only matching keyword terms but not every term of a field?

Example use-case to achieve:  
Searching for a keyword **car** in an index using **\_search** API should return all the documents which match the keyword **car** along with positions of only **car** term in set of fields.

---

<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: [November 11, 2019, 3:17am UTC](https://discuss.elastic.co/t/term-vectors-within-search-api/203373/2 "2019-11-11T03:17:55Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
