No support for distance between a term and an exact term with slop

Hello,
I am trying to use the 'simple query string query' (as well as other query options) to give me certain results and wonder about my options / if it is possible.

The challenge: to search for a term1 within distance of X from term2 (with term2 being a phrase with multiple words).
So, for example: plate "home center store" ~6. It should return me hits like "in home center store, my favorite plate can be found",
whereas "in home center store, there are a lot of new products including my favorite plate" will not be found.

  • My attempt: wrote inside simple_query_string_query's query:
    "\"plate \"home center\"\"~1"

I have read most of the relevant docs but have not found an answer (perhaps you can enlighten me). If 'query string query' or any other syntax allows such option, please let me know.
Any syntaxis option will do it.

Thanks in advance!

Hi @Savi_Ifraimov

Have you read about Interval Query? Maybe I can help you.

1 Like

@RabBit_BR
It did help.
Follow-up question: can you "embed" interval query inside a 'simple query string' or you basically can't use both together?

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