Solr index time boost on document date

白昼怎懂夜的黑 提交于 2019-12-13 20:12:17

问题


I'm trying to index a wiki (using a direct access to the wiki db) and trying to negatively boost on document date (so that the old documents appear further down in the results). There is a great solr-wiki page on boosting and related topics:

http://wiki.apache.org/solr/SolrRelevancyFAQ

It simply says to do the following:

"Use an index-time boost that is larger for newer documents"

But how and where? Which part of the solr configuration do I have to change to use an index-time boost? Do I have to adapt the DATA import handler?


回答1:


IMO you should not use an index time boost for date.
If you do an index time boost, the boost is fixed stored in the index
Query time boost will provide you the flexibility to boost as well as change the boost at runtime without needing re-indexing

You can use Query time boost which will always boost according to the current date.




回答2:


From Solr relevancy FAQ:

Index-time boosts are assigned with the optional attribute "boost" in the section of the XML updating messages. See UpdateXmlMessages for more information.

Following the UpdateXmlMessages link you can find this:

Optional attributes on "doc"

boost = — default is 1.0 (See Lucene docs for definition of boost.) NOTE: make sure norms are enabled (omitNorms="false" in the schema.xml) for any fields where the index-time boost should be stored.

Optional attributes for "field"

boost = — default is 1.0 (See Lucene docs for definition of boost.) NOTE: make sure norms are enabled (omitNorms="false" in the schema.xml) for any fields where the index-time boost should be stored.



来源:https://stackoverflow.com/questions/13970187/solr-index-time-boost-on-document-date

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!