I have some documents in Solr 4.0
. I want the most relevant records to be displayed first and then the less relevant ones.
For eg, I have 3 documents wi
I tried with ""
around the query string and it worked.
Like - q=title:"Income Distribution Policy" OR title:Income Distribution Policy
.
This gave me the output as document 1 then document 3 and then document 2. Not perfect but close enough.
If you don't sort by anything else, you are sorting by Similarity/Relevance. So, if you are not getting the results in the right order, you may need to play with how you are assigning weights and which query parsers you are using.
I assume you are using eDismax with the boost on the title field. In addition have a look at mm (minimum match) and pf (phrase fields) for boosting.
You may also want to test with autoGeneratePhraseQueries field set on your fieldType.
And, of course, debugQuery=true on the queries will help you to see what is going on. You may find that also adding debug.explain.structured=true could useful the first couple of times you are trying to read the debug output.