How to get a better Lucene/Solr score if word quer

2019-07-04 00:40发布

问题:

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.



标签: solr lucene