Break the query into words then add them as TermQuery instances as optional clauses to a BooleanQuery with a call to setMinimumNumberShouldMatch(2) somewhere along the line. You may want to do some parsing or analysis on the query terms to avoid problems of case matching and the like.
-- Ian. On Tue, Feb 17, 2015 at 4:57 PM, Deepak Gopalakrishnan <dgk...@gmail.com> wrote: > Hello, > > I have a rather simple query. I have a list where I have terms like and > then my query is more natural language. I want to be able to retrieve > matches that has atleast 2 words in common between the query and the index > > Can you guys suggest a Query Type and a field that I should be using? > > -- > Regards, > *Deepak Gopalakrishnan* --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org