3

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.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Bob Yoplait
  • 2,421
  • 1
  • 23
  • 35
  • Do you mean that the first few words of the given text matters more than the rest? I answered a similar question here: http://stackoverflow.com/questions/9101478/sunspot-boost-records-where-matches-occur-early-in-the-text/9108602#9108602 . And personally, I dont recall such a link coming up on any questions – Jesvin Jose Feb 29 '12 at 04:48

1 Answers1

3

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.

jpountz
  • 9,904
  • 1
  • 31
  • 39