Hi Jean,
One thing I could come up with is to use IntervalQuery.
Specifically you could create an IntervalQuery with IntervalSource of:
Intervals.within(Intervals.term(word2), 3, Intervals.term(word1)))
to search for word2 that appears within 3 positions of word1
Best
Patrick
Jean Morissette
Hi Jean,
If you do not care about the order of the words, then use a phrase query
with a slop of 3.
Otherwise, you could use a span query to achieve that.
Regards
Ameer
On Thu, 1 Apr 2021 at 15:00, Jean Morissette
wrote:
> Does someone know how to create a query for searching 2 words separate