I am using Solr v6.2.1 .We are not getting accurate results using "sort score desc".
let's assume we have a list of documents in our index as below
[{ "id": "1", "content": ["java developer"] },
{ "id": "2", "content": ["Java is object oriented.Java robust language.Core java "] },
{ "id": "3", "content": ["java is platform independent. Java language."] }]
Content is defined as multivalued field in the schema
field name="content" type="text_general" multiValued="true" indexed="true" stored="true"
when I search for java using below query
curl http://localhost:8983/solr/test/select?fl=score,id&q=(java)&wt=json&sort=score desc
I am expecting the content with Id :2 should come first as it contains more matches related to java.But solr is giving inconsistent results.
Please suggest why I am not able to get desired results.
debugQuery=true
to your query URL to see exactly how each score is calculated. You don't have to sort by score explicitly either, that's done by default. You should also provide a field name when searching, such ascontent:java
, so you're sure you're searching the field you think you're searching. – MatsLindh