0
我是一個新手與Solr,我試圖檢索這樣的文件,按有效載荷排序。Solr獲得分數與有效載荷
{ "id": "1", "tags": ["Cat|0.8", "Dog|0.2"] },
{ "id": "2", "tags": ["Cat|0.4", "Dog|0.6"] }
我試圖使用有效載荷來提高每個標記,但所有信息我發現它有點舊。 This是我發現的最新出版物。
但我發現this, too,我不知道是否有比第一種方法更新的東西。對於第二個鏈接,我認爲我可以添加到schema.xml中
<fieldType name="tags" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="float" delimiter="|"/>
</analyzer>
</fieldType>
並且有效負載將被識別。但我不知道如何檢查,我只看到搜索「狗」的結果沒有按有效載荷排序。
{
"responseHeader":{
"status":0,
"QTime":1,
"params":{
"q":"Dog",
"indent":"on",
"wt":"json",
"_":"1493191003038"}},
"response":{"numFound":2,"start":0,"docs":[
{
"id":"1",
"tags":["Cat|0.8",
"Dog|0.2"],
"_version_":1565724328306147328},
{
"id":"2",
"tags":["Cat|0.4",
"Dog|0.6"],
"_version_":1565724328307195904}]
}}
所以我不知道該怎麼辦......我應該按照第一個教程,即使我有最新的Solr版本?我的目標很簡單:通過標籤中的有效載荷對響應進行排序。
問題是,我不能假設:(我不知道標籤的數量...... – analca3