On Jul 5, 2005, at 2:26 AM, BOUDOT Christian wrote:

:-) I changed the main lines and compiled the QueryParser.java after that I compiled the entire package, build a new jar file and installed it on my server. (I followed the same procedure I used when I added a new analyzer)

Sorry if these are dumb questions, but you changed QueryParser.jj and then recompiled QueryParser.java? Did you run JavaCC to regenerate QueryParser.java?

You don't need to rebuild Lucene to add a new Analyzer. QueryParser.jj is quite a different story as it is a JavaCC-based parser and needs another step of generation besides just compilation of the .java file.

    Erik



Cheers

Chris

-----Original Message-----
From: Erik Hatcher [mailto:[EMAIL PROTECTED]
Sent: 04 July 2005 18:33
To: java-user@lucene.apache.org
Subject: Re: free text search with numbers

A couple of sanity checks... you changes the main lines, not the
comments I hope :)  And also, you need to rebuild the parser code by
running JavaCC on it.  If you're tinkering with a copy of Lucene's
source code you can run the Ant target "javacc" and you must have
JavaCC installed per the build instructions.

     Erik



On Jul 4, 2005, at 11:38 AM, BOUDOT Christian wrote:


I have found in the QueryParser.jj those lines of comments:

// 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> | ( [ "*", "?" ] ))* >

So as indicated I changed my line to the second option but it
didn't solve
the problem I still getting the lexical error. Do I have to do
something
special to this .jj file or is it read when the QueryParser.java
file is
compiled?

Cheers
Chris


-----Original Message-----
From: Erik Hatcher [mailto:[EMAIL PROTECTED]
Sent: 04 July 2005 16:15
To: java-user@lucene.apache.org
Subject: Re: free text search with numbers


On Jul 4, 2005, at 9:02 AM, BOUDOT Christian wrote:



Hi,

I modified the analyzer (it is now vegetarian and won't eat numbers
anymore
:-) but I have hit a new problem. The parser won't accept a keyword
to start
with a wildcard character. (*/12/2003) Any hints to solve this new
issue?



This is by-design "issue" with QueryParser (to avoid WildcardQuery's
from being created that run through every term in the index).  It is
the way the grammar has been defined.  You would need to build your
own QueryParser to change this behavior.   The relevant QueryParser
grammar piece is this (from QueryParser.jj):

| <WILDTERM:  <_TERM_START_CHAR>
               (<_TERM_CHAR> | ( [ "*", "?" ] ))* >

     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]

Reply via email to