You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Earwin Burrfoot <ea...@gmail.com> on 2008/12/03 13:03:53 UTC

PhraseQuery with non-strict offsets

Not sure if this belongs to java-dev or java-user, correct me if I'm wrong.

I need a variation of PhraseQuery for which position difference
between adjacent terms shouldn't match exactly, but in equals-or-less
fashion.
Example:
"a+1 b+1 c+3"
should match
a b c, a b e c, a b e e c
should not match
a e b c, a b e e e c

Has anyone written/seen something like this, or has an advice on how
to hack stock PhraseQuery to support this?
setSlop fails obviously, because i need strict distance between one
pair of terms, and sloppy between other pair, also i do not need
reorderings.
I could use a big bunch of SpanNear+SpanTerm queries, but is somewhat
reluctant to do this, conversion code will get real ugly, and I'm not
sure about speed.

-- 
Kirill Zakharenko/Кирилл Захаренко (earwin@gmail.com)
Home / Mobile: +7 (495) 683-567-4 / +7 (903) 5-888-423
ICQ: 104465785