# How to analyze consecutive words in pairs in elasticsearch?

**URL:** <https://discuss.elastic.co/t/how-to-analyze-consecutive-words-in-pairs-in-elasticsearch/32180>\
**Category:** Elasticsearch\
**Created:** [October 14, 2015, 1:43pm UTC](https://discuss.elastic.co/t/how-to-analyze-consecutive-words-in-pairs-in-elasticsearch/32180 "2015-10-14T13:43:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mehmet\_Ozer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mehmet_ozer/32/81567_2.png) [@Mehmet\_Ozer](https://discuss.elastic.co/u/Mehmet_Ozer)\
**Post date:** [October 14, 2015, 1:43pm UTC](https://discuss.elastic.co/t/how-to-analyze-consecutive-words-in-pairs-in-elasticsearch/32180/1 "2015-10-14T13:43:06Z")

</div>

Hello all,

I am trying to implement a new index which will contain consecutive words in pairs, for example I have a sentence like;

I am going home

So I want to analyze the sentence as:  
I am, am going, going home ....

Do elasticsearch has any configuration for this or I need to write the code which will index the words after combining with each other ?

Thank you

---

<div class="post-metadata">

**Author:** ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)\
**Post date:** [October 14, 2015, 2:40pm UTC](https://discuss.elastic.co/t/how-to-analyze-consecutive-words-in-pairs-in-elasticsearch/32180/2 "2015-10-14T14:40:34Z")

</div>

At first glance, this looks very much like what the [Shingle Token Filter](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/analysis-shingle-tokenfilter.html) does. Take a look there and see if you need any additional behaviour, otherwise this [chapter](https://www.elastic.co/guide/en/elasticsearch/guide/current/shingles.html) in the Definitive Guide gives an idea of how to use it.

---

<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:44pm UTC](https://discuss.elastic.co/t/how-to-analyze-consecutive-words-in-pairs-in-elasticsearch/32180/3 "2017-07-05T23:44:51Z")

</div>


