我试图将Solr搜索结果放在结果集顶部的特定字段(此处为resourcename
)中,其中包含我的搜索短语。如何提高在字段中包含搜索关键字的结果
我是Solr的初学者。我寻觅了好一阵子网页,发现一些相关的问题,比如:
Use function query for boosting score in Solr
SolrNet queries with boost functions
然后,我开始尝试自己有这样的疑问:
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
但是,无论我尝试什么,我都会得到结果,其中包含test
这个词在resourcename
中,而不仅仅是结果的顶部。
任何想法,我可能会失踪或做错?
谢谢。这有帮助,但由于某种原因,我无法将所有包含搜索词/结果的结果保留在顶部。我已经尝试过我想要的财产非常大的重量,但由于某种原因,它拒绝应用这些重量或其他东西......:^)我曾尝试将重量放在大部分字段上,但仍然没有任何结果。我不知道发生了什么... – user2173353
嗯...我想我明白了:它希望我把'* term *'而不是'term *'来找到一个包含类似'这是term.'。不太清楚为什么...:^) – user2173353
如果您对我上次评论中的问题有任何想法,请告诉我。但无论如何,非常感谢您的帮助。至少我现在工作得很好。我只怕性能问题。 :) – user2173353