lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sergiu gordea <gser...@ifit.uni-klu.ac.at>
Subject Re: *term (SuffixQeuries)
Date Wed, 25 May 2005 13:30:01 GMT

   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: lucene-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>>
>>  
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message