Maybe you are not using the same analyzer at index and query time. Even
though you are correctly escaping the special query syntax characters,
either the query analyzer is removing them or your index analyzer removed
them. What analyzer are you using at index time? And, what analyzer are you
using at query time?
-- Jack Krupansky
-----Original Message-----
From: saisantoshi
Sent: Sunday, October 20, 2013 12:47 PM
To: java-user@lucene.apache.org
Subject: Handling special characters in Lucene 4.0
I have created strings like the below
&&searchtext
+sampletext
and when I try to search the following using *&&** or *+** it does not give
any result.
I am using QueryParser.escape(String s) method to handle the special
characters but does not look like it did anything.
Also, when I search something like this:
title:search*
it works and returns the search result
but when I search like the following, it wont work
title:*&&**
( No Result)
Is the above valid search criteria? If not, can someone suggest here what
would be appropriate search criteria?
Seems like StandardAnalyzer is stripping out all the special characters and
searching and that's why when we search without special characters, it does
seem to work.
Thanks,
Sai.
--
View this message in context:
http://lucene.472066.n3.nabble.com/Handling-special-characters-in-Lucene-4-0-tp4096674.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org