How to get a better Lucene/Solr score if word queried was at the beginning of the indexed field?

纵饮孤独 提交于 2020-01-14 14:33:11

问题


I read at some point something explaining what to do to have Lucene/Solr give a better score if my queried word was found at the beginning of the description I indexed. Cannot find it anymore on the net. Anybody has the links handy ? Thank you.


回答1:


Payloads could help you do that. Actually, payloads let you give an arbitrary boost to any token of your token stream, so you can boost depending on anything:

  • the position in the stream,
  • the font weight,
  • whether the token contains capital letters,
  • ...

You can read more about payloads in this nice post from Grant Ingersoll.



来源:https://stackoverflow.com/questions/9490389/how-to-get-a-better-lucene-solr-score-if-word-queried-was-at-the-beginning-of-th

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