SPHINX:How to find all the query words within the n-words?

Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
Good day!
From example:
1) Request - "mom soap frame"
2) Condition - length of phrase should not exceed 7 words.

Desired result:
'...mom soap frame..' //Length 3 words from the first desired word to the last.
'...mom and dad washed the frame...' //5 words
'...mother, brother and I washed the window frame...'// 6

Should NOT be lyrics with such content:
'The mother loves the son, though he never washes the frame' //8 words
'The mother gave a wonderful frame, but it never washes' //9 words

How can I do that? Where to dig, in the direction of settings of index or query?

Accept to consider alternative search engines, as well as crutches. The time search operation is not critical because it is a background task.

P. P. S.
Came up with a horrible crutch:
1) Get the snippets with the "illumination" of occurrences (sauron.org.ua/post/1113).
2) Consider the number of words highlighted from the first word to the last.
3) the Filtered
by | 5 views

1 Answer

0 like 0 dislike
Proximity distance is specified in words, adjusted for word count, and applies to all words within quotes. For instance, "cat dog mouse"~5 query means that there must be less than 8-word span which contains all 3 words, ie. "CAT aaa bbb ccc DOG eee fff MOUSE" document will not match this query, because this span is exactly 8 words long.

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Apr 9, 2019 by carno
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
28,014 users