Hi all,

I send this email to make a correction to the solution that enables SuffixQeuries

The definition of the WILDTERM was a buggy one, it splitted a term in two terms e.g "term:te*st" was parsed to "term:te* term:st", of course this was wrong.

HERE is the right way to do it ...

<DEFAULT> TOKEN : {
.......
| <WILDTERM: (([ "*", "?" ])* <_TERM_START_CHAR> (<_TERM_CHAR> | ( [ "*", "?" ] ) )* ) >
.......

Erik (or other lucene developer), can you please update the Comments in the QueryParser.jj to include this correction? The existing suggestion allows doesn't throw parse exception if the user tries to use "*-" or this kind of combinations and throws some OutOfBoundsException or NPE ..., my definition throws ParseException that can be catched and displayed that the given string is an invalid search string ...

What needs to be done is to change :

// OG: to support prefix queries:
// http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12137
// Change from:
// | <WILDTERM:  <_TERM_START_CHAR>
//              (<_TERM_CHAR> | ( [ "*", "?" ] ))* >
// To:
//
// | <WILDTERM:  (<_TERM_CHAR> | ( [ "*", "?" ] ))* >

// OG: to support prefix queries:
// http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12137
// Change from:
// | <WILDTERM:  <_TERM_START_CHAR>
//              (<_TERM_CHAR> | ( [ "*", "?" ] ))* >
// To:
//
// | <WILDTERM:  (<_TERM_CHAR> | ( [ "*", "?" ] ))* >
//
//SG: or better, this definition
//| <WILDTERM: (([ "*", "?" ])* <_TERM_START_CHAR> (<_TERM_CHAR> | ( [ "*", "?" ] ) )* ) >

sergiu gordea wrote:

Tim Lebedkov (UPK) wrote:

Hi,

is there a way to make QueryParser accept *term?
yes, if you apply a patch the lucene sources.
Search for "*term search" in lucene archive.

Best,

 Sergiu

thank you
--Tim

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to