You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by "Tim Lebedkov (UPK)" <Ti...@upk.de> on 2005/02/02 14:54:05 UTC

*term

Hi,

is there a way to make QueryParser accept *term?

thank you
--Tim

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


Re: *term (SuffixQeuries)

Posted by sergiu gordea <gs...@ifit.uni-klu.ac.at>.
   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


Re: *term

Posted by sergiu gordea <gs...@ifit.uni-klu.ac.at>.
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