lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carl...@bookandhammer.com
Subject QueryParser.jj with NEAR conj
Date Wed, 16 Jan 2002 16:06:17 GMT
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



Mime
View raw message