lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marquinhocb <>
Subject Score for query-generated value
Date Tue, 01 Sep 2009 06:24:18 GMT

I would like to create a scorer that applies a score based on a value that is
calculated during a query.  More specifically, to apply a score based on
geographical distance from a latitude,longitude.

What is the easiest way to go about doing this?  The LocalLucene contrib
uses a SortComparatorSource, but I would like to, if possible, use the
scoring mechanism so that distance is scored just like all other fields,
thus allowing for searches which give more/less weight to distance (and for
example, more weight to a closer-matching search term).

Are there any good examples of how to do this? Or can someone point me in
the right direction?

Ideally I would create a CustomScoreQuery (instead of a ConstantScoreQuery)
that would take in a filter that would automatically give matching documents
a score, but I don't see a straight-forward way of doing this.
View this message in context:
Sent from the Lucene - Java Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message