# Termvector with specific keywords from another index

**URL:** <https://discuss.elastic.co/t/termvector-with-specific-keywords-from-another-index/27242>\
**Category:** Elasticsearch\
**Created:** [August 12, 2015, 9:13am UTC](https://discuss.elastic.co/t/termvector-with-specific-keywords-from-another-index/27242 "2015-08-12T09:13:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![seb\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seb_2/32/1419_2.png) [@seb\_2](https://discuss.elastic.co/u/seb_2)\
**Post date:** [August 12, 2015, 9:13am UTC](https://discuss.elastic.co/t/termvector-with-specific-keywords-from-another-index/27242/1 "2015-08-12T09:13:30Z")

</div>

Hi

I have an index with keywords associated to a category. My goal is to be able to use these keywords for \_termvector.  
For example

```
KEYWORD | CATEGORY
---------------------
apple | fruit
banana | fruit
dog | animal
cat | animal
mouse | animal

```

I'd like to only get term of \_termvector using my KEYWORDS. Is that possible?

And even better if I could also have the category associated to a keyword in the \_termvector response that would be fantastic. Like a sub aggregation. If not possible, I always send an new request to ES server, it's not a big deal.

Thanks

---

<div class="post-metadata">

**Author:** ![Alex\_Ksikes](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@Alex\_Ksikes](https://discuss.elastic.co/u/Alex_Ksikes)\
**Post date:** [August 12, 2015, 9:52am UTC](https://discuss.elastic.co/t/termvector-with-specific-keywords-from-another-index/27242/2 "2015-08-12T09:52:38Z")

</div>

If I understand correctly what you are asking for is a feature called terms filtering. We have something [like that](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html#_terms_filtering) in the dev version of ES, but it won't do what you'd like, until we add scripting. Right now it only filters terms based on their tf-idf scores. Concerning the sub-aggregation, I would think that you'd have to perform a new request each time. Hope this helps.

---

<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:56pm UTC](https://discuss.elastic.co/t/termvector-with-specific-keywords-from-another-index/27242/3 "2017-07-05T23:56:15Z")

</div>

Closed on July 5, 2017, 11:56pm UTC


