# Keep-words-tokenfilter example

**URL:** <https://discuss.elastic.co/t/keep-words-tokenfilter-example/107150>\
**Category:** Elasticsearch\
**Created:** [November 10, 2017, 8:06am UTC](https://discuss.elastic.co/t/keep-words-tokenfilter-example/107150 "2017-11-10T08:06:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vnaresh666666](https://avatars.discourse-cdn.com/v4/letter/v/76d3ee/32.png) [@vnaresh666666](https://discuss.elastic.co/u/vnaresh666666)\
**Post date:** [November 10, 2017, 8:06am UTC](https://discuss.elastic.co/t/keep-words-tokenfilter-example/107150/1 "2017-11-10T08:06:08Z")

</div>

Can some one provide me a full working example of keep-words-token filter(with a file having some keywords, only which are to be indexed). I have followed the documentation but I didn't get through it.

thank you.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [November 10, 2017, 9:41am UTC](https://discuss.elastic.co/t/keep-words-tokenfilter-example/107150/2 "2017-11-10T09:41:14Z")

</div>

Hey,

there is an example in our documentation [https://www.elastic.co/guide/en/elasticsearch/reference/5.6/analysis-keep-words-tokenfilter.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/analysis-keep-words-tokenfilter.html)

If that one is not working, can you be more exact, what is failing and include steps for reproduction?

Thank you!

--Alex

---

<div class="post-metadata">

**Author:** ![vnaresh666666](https://avatars.discourse-cdn.com/v4/letter/v/76d3ee/32.png) [@vnaresh666666](https://discuss.elastic.co/u/vnaresh666666)\
**Post date:** [November 10, 2017, 9:51am UTC](https://discuss.elastic.co/t/keep-words-tokenfilter-example/107150/3 "2017-11-10T09:51:55Z")

</div>

thank you for your reply

I am new to elasticsearch. I will tell you my use case and please direct me how to make use of this filter.

I have a directory with set of files. If i index those files the whole content get indexes into elasticsearch. But i don't want the whole content to be indexed but I will provide some key words in a file and when i index a file then the only key words to be indexed and when run a search query with particular key word it show that the document which is having that keyword, instead of showing whole content of the document.

please provide me working example.

thank you

---

<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:** [December 8, 2017, 9:52am UTC](https://discuss.elastic.co/t/keep-words-tokenfilter-example/107150/4 "2017-12-08T09:52:01Z")

</div>

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