FAQ
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: http://www.nabble.com/Score-for-query-generated-value-tp25234966p25234966.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org

Search Discussions

  • Michael McCandless at Sep 1, 2009 at 8:49 am
    Function queries should work here? (org.apache.lucene.search.function.*).

    Mike

    On Tue, Sep 1, 2009 at 2:24 AM, marquinhocbwrote:
    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: http://www.nabble.com/Score-for-query-generated-value-tp25234966p25234966.html
    Sent from the Lucene - Java Users mailing list archive at Nabble.com.


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedSep 1, '09 at 6:24a
activeSep 1, '09 at 8:49a
posts2
users2
websitelucene.apache.org

2 users in discussion

Marquinhocb: 1 post Michael McCandless: 1 post

People

Translate

site design / logo © 2022 Grokbase