使用edismax的Solr相关性

时间:2014-10-14 12:01:37

标签: search solr relevance edismax

如何在solr配置中添加edismax以使我的标题增强然后描述然后刻面等等......

我的solr配置看起来像这样

<str name="defType">edismax</str>
<str name="qf">text^50 and title^1000 and contentdescription^180 and productname^140 and groupname^13 and maincontent^113 and contenttype^120 and published_date^115 and viewcount^114 and fileid^101 and filename^10 and content^10</str>
 <str name="pf">text^50 and title^1000 and contentdescription^180 and productname^140 and groupname^13 and maincontent^113 and contenttype^120 and published_date^115 and viewcount^114 and fileid^101 and filename^10 and content^10</str>

架构为

<copyField source="id" dest="text"/>
    <copyField source="productid" dest="text"/>
     <copyField source="groupid" dest="text"/>
   <copyField source="maincontent" dest="text"/>
   <copyField source="title" dest="text" />
   <copyField source="contentdescription" dest="text"/>
   <copyField source="groupname" dest="text"/>
   <copyField source="productname" dest="text"/>
   <copyField source="videourl" dest="text"/>
   <copyField source="contenttype" dest="text" />
<copyField source="title" dest="autocomplete-field" />

1 个答案:

答案 0 :(得分:0)

只需要检查几件事......

  1. 从qf中移除所有&#39;和pf,字段名称列表只是用空格分隔,应该如下所示:
  2.   

    text ^ 50 title ^ 1000 contentdescription ^ 180 productname ^ 140 groupname ^ 13 maincontent ^ 113 contenttype ^ 120 published_date ^ 115 viewcount ^ 114 fileid ^ 101 filename ^ 10 content ^ 10

    1. 确保您在qf和pf中包含的所有字段都已编入索引(选项索引=&#34; true&#34;在字段定义中)