lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: Score for query-generated value
Date Tue, 01 Sep 2009 08:48:26 GMT
Function queries should work here? (*).


On Tue, Sep 1, 2009 at 2:24 AM, marquinhocb<> wrote:
> 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:

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

View raw message