: Now the expected result using phrase query after giving valid slop, should : return back document with exact match first and then remaining documents : that match any or few terms in the phrase. Here is the example of terms with : # of occurrences in index is as follows
there is no single query structure that does what you describe, however i suggest you take a look at the dismax request handler ... configured properly for the fields you care about it will not only score documents that match on many terms better then documents that match on few terms, but it will also give a "phrasequery" boost to documents that match on the whole query as a phrase (with whatever amount of slop you wnat). note that dismax is primarily designed to query multiple fields, but in it's simplest form you can still use it's query parsing goodness on a single field, something like... qt=dismax&qf=txtField&pf=txtField&ps=100&mm=0&q=How+do+I+look+for+supply http://lucene.apache.org/solr/api/org/apache/solr/request/DisMaxRequestHandler.html -Hoss