【发布时间】:2021-04-12 13:34:56
【问题描述】:
我正在尝试使用 Solr 改进我的搜索结果。 目前我正在研究复合词,到目前为止,我正在获得复合词及其部分的结果,但问题是结果之间没有优先级/权重。 我希望与原始复合词相关的结果比其部分具有更高的权重/优先级。 有没有办法用 Solr 做到这一点?
作为示例,搜索词可能是“støvsuger”,目前我得到的“støvsuger”、“støv”和“suger”结果相同。我想要的是“støvsuger”的权重高于“støv”和“suger”。
这是我目前正在做的:
<filter class="solr.DictionaryCompoundWordTokenFilterFactory" minSubwordSize="4" dictionary="lang/ordbog.txt" onlyLongestMatch="true" maxSubwordSize="15" minWordSize="7"/>
当前查询字符串如下所示:
{0}Portal1_{1}_{2}/select?defType=edismax
&fl=id,title,shortDescription,htmlContent,kbId,score
&mm={3}
&q={4}
&qf=_priorityKeywords^60 title^80 portalTitle^60 shortDescription^50 htmlContent^20
&pf=_priorityKeywords^60 title^100 portalTitle^60 shortDescription~10^50 htmlContent~10^20
&rows=500
&wt=json
&tie=0.1
您可以在其中输入 {0}、{1}、{2},{3} 是搜索词的数量,{4} 是搜索词/术语。
【问题讨论】: