HaterTot
HaterTot

Reputation: 407

Is there any way for me to change scoring based on term position in Lucene?

for example, if I am searching an index of book titles with the term "harry", "Dirty Harry" is scored equally to "Harry Potter", and when two items are equally scored, the order is random. I'd like to weight the one that begins with my search term (Harry Potter) higher.

I would rather not use TermPostionVector as it seems that this is something I can read only after the search and scoring has been completed.

thanks for your time/consideration.

Upvotes: 9

Views: 324

Answers (1)

Mikos
Mikos

Reputation: 8553

Look up spanquery.

Upvotes: 2

Related Questions