lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bharatbhushan_Shetty" <>
Subject RE: HELP in QueyParsing !!
Date Mon, 14 Jul 2003 09:11:14 GMT
Thanks Victor. I'll look into your earlier postings for the solution. 
But I was wandering, there might be many more scenarios what a user
might search for. 

-----Original Message-----
From: Victor Hadianto [] 
Sent: Monday, July 14, 2003 2:02 PM
To: Lucene Users List
Subject: Re: HELP in QueyParsing !!

> Input:   QueryCreated     Remarks
> c\+\+      c           (Escape character not working)

The StandardTokenizer and QueryParser will drop the ++ sign. This
problem is 
similar to the recent thread. Search the archive the the following
strings '-' characer not interpreted correctly in field names

You may be able to implement similar solution to the one that I've

Actually your query got me interested, I've tried my solution for c--
and the 
-- signs are dropped. This because I define DASHESWORD as 


This will search for t-shirt, but not tshirt-. Yet another QueryParser 
peculiarity :)

If you absolutely has to search for c++ then I suggest you define
token which encompasses all alpharnumeric word and plus sign. For
(modify StandardTokenizer.jj):


add the line:

token = <MYTOKEN>

in the next() method. This may work.

> c++        -           (Parser throws an exception) [NOTE-1]
As expected.

> *c         -           (throws an exception -   [NOTE-2]
There has been a number of discussion on this subject, search the
mailing list 
for more information. 

> Does that mean that the program should taken care of validating the 
> User input and then pass the query string to QueryParser?

Depends how do you look at it. QueryParser will throw ParseException if
it has 
parsing issues, you can in some way treat this as the validation.


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message