Higher rank for closer matches

2011-09-21 Thread Akos Tajti
Dear List, for multi term expressions I'd like to add higher rank if the matches are closer to each other. For example for the search term "like eating" the string "i like eating" comes before "I like some eating". Is this possible? Thanks in advance, Ákos Tajti

Re: Higher rank for closer matches

2011-09-21 Thread Em
Àkos, have a look at SpanNearQuery. This is what you want. If you own the 2nd Edition of Lucene in Action have a look at their examples. It illustrates how to combine them with the classical queries. Regards, Em Am 21.09.2011 13:46, schrieb Akos Tajti: > Dear List, > > for multi term expression

Re: Higher rank for closer matches

2011-09-21 Thread Akos Tajti
Thanks, I will check SpanNearQuery! Regards, Ákos On Wed, Sep 21, 2011 at 2:20 PM, Em wrote: > Àkos, > > have a look at SpanNearQuery. This is what you want. > If you own the 2nd Edition of Lucene in Action have a look at their > examples. It illustrates how to combine them with the classica

Re: Higher rank for closer matches

2011-09-21 Thread Erik Hatcher
PhraseQuery suffices for the stated requirement of boosting when query terms are closer. A common technique is to incorporate a PhraseQuery with a large slop factor of the query terms into the query automatically, which implicitly boosts matching documents when the query terms are closer. A Sp

Re: Higher rank for closer matches

2011-09-21 Thread Em
Hi Erik, could you explain why PhraseQuery performs better than SpanNearQuery? Some time has passed since I read about it, however I think it was exactly the other way round. Thanks! Em Am 21.09.2011 15:56, schrieb Erik Hatcher: > PhraseQuery suffices for the stated requirement of boosting whe

Re: Higher rank for closer matches

2011-09-21 Thread Erik Hatcher
SpanNearQuery does more work than PhraseQuery - it keeps track of all matching spans, whereas PhraseQuery does not. Whether the performance difference will be relevant depends on your environment and data - so it may not be a big deal at all. Erik On Sep 21, 2011, at 10:44 , Em wrote

Re: Higher rank for closer matches

2011-09-21 Thread Em
Thanks, Erik. If PhraseQuery does not keep track of all matching spans, how does it do its work (in comparison to SpanNearQuery)? Regards, Em Am 21.09.2011 19:52, schrieb Erik Hatcher: > SpanNearQuery does more work than PhraseQuery - it keeps track of all > matching spans, whereas PhraseQuery d

Re: Higher rank for closer matches

2011-09-21 Thread Tajti Ákos
Thanks for the hints Guys. I implemented the SpanNearQuery approach because we might need the matching spans information. Regards, Ákos On 2011.09.21., at 20:08, Em wrote: > Thanks, Erik. > If PhraseQuery does not keep track of all matching spans, how does it do > its work (in comparison to

Re: Higher rank for closer matches

2011-09-21 Thread Erik Hatcher
SpanNearQuery is a different kind of beast than PhraseQuery... it matches when it's nested SpanQuery's are in proximity. So it is like multiple PhraseQuery's and checking proximities of those with one another... or proximity with any other type of SpanQuery. On Sep 21, 2011, at 11:08 , Em wro