lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jinming Zhang <spee.zh...@gmail.com>
Subject How to customize score according to field value?
Date Tue, 07 Apr 2009 07:08:18 GMT
Hi,

I have the following situation which needs to customize the final score
according to field value.

Suppose there are two docs in my query result, and they are ordered by
default score sort:

doc1(field1:bookA, field2:2000-01-01) -- score:0.80
doc2(field1:bookB, filed2:2009-01-01) -- score:0.70

I want "doc2" to have a higher score since it's publishing date is more
recent, while "doc1" to have a lower score:

doc2(field1:bookB, filed2:2009-01-01) -- score:0.77
doc1(field1:bookA, field2:2000-01-01) -- score:0.73

I found this scenario is different from doc.setBoost() and field.setBoost().
Is there any way to impact the score calculated for "doc1" & "doc2"
according to the value of "field2"?

Thank you in advance!

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message