lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tirupathi reddy <tirupathiredd...@yahoo.com>
Subject Some problem with prefix wilcard search
Date Mon, 19 Sep 2005 08:41:14 GMT
Hello,
  I am using Lucene for for searching in my application. 
My application needs prefix wildcard search also. 
But Lucene doesn't support this. So I changed in the QueryParser.jj file
FROM:
 | <WILDTERM:  <_TERM_START_CHAR>
              (<_TERM_CHAR> | ( [ "*", "?" ] ))* >
 To:
 | <WILDTERM:  (<_TERM_CHAR> | ( [ "*", "?" ] ))* >

And then I build it using ant and then by using
 command ant -Djavacc.home = C:/javac javacc
And both times it was saying build was successful. 
Then I  put in the classpath, the newly generated jar file in build directory
instead of lucene-current.jar. Even then it is not working for 
prefix wildcard search (e.g. *patent). And I am getting the following error:
caught a class org.apache.lucene.queryParser.ParseException
  with message: Lexical error at line 1, column 2.  Encountered:  
 "*" (42), after   : ""

Is it the correct way for to make it work for prefix wildcard
search using lucene.
Is there any thing wrong I am doing?
Is there any other way to do this?
part of my querying code is:
Query query = QueryParser.parse(query,"ALL",analyzer);
Hits hits = searcher.search(query);
And the query I am passing e.g. is *static.
So please any one help me to solve this problem.


Tirupati Reddy Manyam 
24-06-08, 
Sundugaullee-24, 
79110 Freiburg 
GERMANY. 

Phone: 00497618811257 
cell : 004917624649007

		
---------------------------------
Yahoo! for Good
 Click here to donate to the Hurricane Katrina relief effort. 
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message