How to analyze consecutive words in pairs in elasticsearch?

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

At first glance, this looks very much like what the Shingle Token Filter does. Take a look there and see if you need any additional behaviour, otherwise this chapter in the Definitive Guide gives an idea of how to use it.

1 Like