我試圖將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