BooleanQuery normal form

2020-09-22 Thread Haoyu Zhai
Hi there, Does Lucene support normalizing a BooleanQuery into normalized form (like CNF or DNF)? If not, is there a suggested way of doing it? Also, I wonder whether there'll be a performance difference between different forms of essentially the same BooleanQuery? Thanks Patrick

Re: How to create a query to search for 2 words separated by 0-3 gaps?

2021-04-01 Thread Haoyu Zhai
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