lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doron Cohen <DOR...@il.ibm.com>
Subject Re: proximity and location scoring
Date Tue, 23 Jan 2007 18:56:09 GMT
Felix Litman <f_litman@pacbell.net> 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:
http://lucene.apache.org/java/docs/queryparsersyntax.html#Proximity%20Searches

>  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
http://lucene.apache.org/java/docs/api/org/apache/lucene/search/spans/SpanQuery.html

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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message