> "analyze term"~2 > "term analyze"~2 > > In my case, two queries return different result set. > Isn't that in your case?
Hmm you are right, I tested with a trunk instance using lucene query parser. Results sets were different. If I am not wrong they were same at some version. I can suggest you two different solutions : One is to use SurroundQueryParser where you have explicit control over ordered versus unordered. But it has its own limitations. See below: http://wiki.apache.org/solr/SurroundQueryParser Second one : There is an example in lucene in action book about how to override QueryParser and replace PhraseQuery with SpanNearQuery. SpanNearQuery also has a Boolean parameter inOrder, You can use that example code. If you pass false to its constructor you will obtain unordered phrase query. But this second option assumes that you are using lucene query parser. defType=lucene