lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doron Cohen <>
Subject Re: proximity and location scoring
Date Tue, 23 Jan 2007 18:56:09 GMT
Felix Litman <> wrote on 23/01/2007 10:01:00:

> Is there a straightforward way to extend the "standard" parser to
> incorporate proximity into the score in multi-word queries,
> including boost factors?

Current parser supports relaxed phrase syntax:

>  I.e. score results higher when query terms
> appear closer toghether then when scattered?

So for query "x y"~10 doc with "x a y" would score
higher than doc with "x a b y". You can control the effect of the
distance, programmatically, providing your own similarity class,
especially sloppyFreq(int distance);

(Doesn't help you much if you already knew all this but just
looking for how to extend the query parser...)

>   How about incorporating search term location in the score?  I.e.
> score results higher where terms appear closer to the beginning of
> the search field...

Current query parser (and syntax) does not support this, but see

and all its sub-classes, especially SpanFirst and SpanNear - with both
scoring takes into account the distance between terms.

>   Thank you,
>   Felix

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

View raw message