How to dynamically search from mutiple offset inside an index in elastic search?

Say I have a string indexed and I want to take out a substring from it at the time of search query. How will I achieve this?

For example -

String to be indexed -

"The quick brown fox"

Searches that I want to make -

- "the"
- "thequ"
- "quick"
- "th"
- "quick the"

How should I do this if I am working with Django and elasticsearch?

I have tried to use ngrams and have merged the whole string to create an n gram index for every combination possible. This is on the code side, How to do this with elastic search.

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