I am trying to put Solr search results that contain my search phrase in a specific field (here resourcename
) on the top of the result set.
I am a beginner on Solr. I have searched the web for quite a while and found some related questions, like:
Use function query for boosting score in Solr
SolrNet queries with boost functions
Then I started experimenting myself with queries like these:
https://localhost:8898/solr/collection1/select?defType=edismax&fl=resourcename&indent=on&q=resourcename:"test"*^200,%20content:"test"*^1&qf=resourcename^200%20content^2&rows=1000&wt=json
https://localhost:8898/solr/collection1/select?bf=if(exists(resourcename),100,1)&defType=edismax&fl=resourcename&indent=on&q=resourcename:"test"*^200,%20content:"test"*^1&rows=1000&wt=json
https://localhost:8898/solr/collection1/select?bf=if(exists(resourcename),100,1)&defType=edismax&fl=resourcename&indent=on&q=*:"test"*&rows=1000&wt=json
https://localhost:8898/solr/collection1/select?defType=edismax&fl=resourcename&indent=on&q=*:"test"*&qf=resourcename^200%20content^2&rows=1000&wt=json
But, no matter what I try, I get results containing the word test
in the resourcename
all over the place and not only on the top of the results.
Any ideas what I might be missing or doing wrong?