问题
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