Hi Benny,

Yes single quote is not a special character but StandardAnalyzer strips the
trailing "'s" in tokens. So your token becomes "it" which is a stop-word.
Therefore it returns an empty query. 

DIGY

-----Original Message-----
From: Benny Michielsen [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 13, 2007 2:47 PM
To: [email protected]
Subject: Quote in query

Hi,

 

How would one search for the text: "it's" using Lucene. All other search
options work fine, just whenever there's a single quote it fails. I
don't think it's a special character (checked the documentation), even
tried escaping it.

I use this code:

 

QueryParser parser = new QueryParser("Text", new StandardAnalyzer());

Query queryText = parser.Parse(keyword);

 

When I check querytext I notice it is empty instead of containing the
parsed statement.

 

Benny

 

 


Reply via email to