You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by ca...@bookandhammer.com on 2002/01/16 17:06:17 UTC
QueryParser.jj with NEAR conj
Hi,
This is probably meant for Brian as the keeper of QueryParser.jj
This is based on the previous QueryParser.jj (I noticed Brain updated it
a few days ago).
This is my version of the NEAR function working through the queryparser.
It must follow NEAR# pattern where # is a number.
So if someone just types near, or even NEAR it will be found in the
index.
example query
test NEAR4 equipment
turns into "test equipment" with a slop factor of 4
test NEAR50 equipment
turns into "test equipment" with a slop factor of 50
I have also not automatically incremented it by 1, so the minimum
interesting value is still 2 as stated in the docs.
This version, also requires that TermQuery add a new getTerm() method to
return its Term (source not provided).
I have also added an extra <_TERM_START_CHAR> of "."
and <_TERM_CHAR> of ".", "/", "&"
I hope this helps when you look to implement this into the final version.
If you come up with a better way to do this, I will be interested in
learning.
Thanks for your time
--Peter