I got the answer. Somehow I missed it. The PhraseQuery requires the terms to be in a fixed order whereas the BooleanQuery does not require the terms to be in a particular order.
On Thu, Mar 31, 2016 at 3:07 PM, Sachin Kulkarni <kulk...@hawk.iit.edu> wrote: > Hi, > > I am using Lucene-5.0.0. > If I had a qurey "New York" and if I use the BooleanQuery with the > BooleanClause set to MUST on the two terms, is it the same as dong a > PhraseQuery with the two terms? > > I am doing some 2-gram type queries and they are giving me different > results with these two methods. I am trying to understand why is the > difference. > > Thank you. > > Regards, > Sachin >