[EMAIL PROTECTED] wrote:
.. and here is the way to do it:
(See attached file: SUPPOR~1.RAR)
Hi all,
I got from iouli the solution to enable prefix queries (*term). In fact you can find the solution in
lucene source, in QueryParser.jj is said in a comment how to enable prefix queries.
I did so ... but I found a lot of bugs. If you define WildTerm as
| <WILDTERM: (<_TERM_CHAR> | ( [ "*", "?" ] ))* >
a lot of constructions will be validated, and you will get a lot of errors ...
for example "----" and "+++++" are considered valid, * is considered valid, and they generate TooManyBooleanClausesExceptions,
I' not very good in creating regular expressions but I succesfully use the following construction ..
| <WILDTERM: (<_TERM_START_CHAR> (<_TERM_CHAR> | ( [ "*", "?" ] ))* )
| ( [ "*", "?" ] <_TERM_START_CHAR> (<_TERM_CHAR> | ( [ "*", "?" ] ) )* ) >
Can anyone improve the construction and update the comment in QueryParser.jj?
Thanks a lot,
Sergiu
Erik Hatcher <[EMAIL PROTECTED] To: "Lucene Users List" utions.com> <[EMAIL PROTECTED]> cc: (bcc: Iouli Golovatyi/X/GP/Novartis) 08.09.2004 12:46 Subject: Re: *term search Please respond to "Lucene Users Category: |-------------------------| List" | ( ) Action needed | | ( ) Decision needed | | ( ) General Information | |-------------------------|
On Sep 8, 2004, at 6:26 AM, sergiu gordea wrote:
I want to discuss a little problem, lucene doesn't support *Term like
queries.
First of all, this is untrue. WildcardQuery itself most definitely supports wildcards at the beginning.
I would like to use "*schreiben".
The dilemma you've encountered is that QueryParser prevents queries that begin with a wildcard.
So my question is if there is a simple solution for implementing the
funtionality mentioned above.
Maybe subclassing one class and overwriting some methods will sufice.
It will require more than that in this case. You will need to create a custom parser that allows the grammar you'd like. Feel free to use the JavaCC source code to QueryParser as a basis of your customizations.
Erik
--------------------------------------------------------------------- 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]
