> Is there a fundamental difference between > > PhraseQuery query = new PhraseQuery(); > query.add(term1, 0); > query.add(term2, 0); > > and > > MultiPhraseQuery query = new MultiPhraseQuery(); > query.add( new Term[] { term1, term2 } ); > > The only different I could think of is that MPQ somehow > does a OR between terms at the same position while PQ does a > AND. Am I off base?
MPQ can support "(quick OR fast) (cat OR mice OR dog)" type of queries so that these docs are retrieved: quick rat fast mice fast dog etc. In your example term1=quick and term2=fast. You need to add another Term array. query.add( new Term[] { term1, term2 } ); query.add( new Term[] { term3, term4, term5 } ); --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org