Right, the "Escaping Special Characters" is simply to escape query operators
like "&&" (means "AND") and "+" (which means "AND" or "MUST"). Yes, the
white space analyzer could be used, or a custom analyzer that uses the
white space tokenizer and then also uses a filter to strip out any
punctuation characters that you don't want to keep (e.g., period, comma,
semicolon, parentheses, etc.)
The query parser itself knows nothing about what your chosen analyzer does.
But the query parser does specially interpret the special characters that
the escape method mentions.
-- Jack Krupansky
-----Original Message-----
From: saisantoshi
Sent: Sunday, October 20, 2013 7:12 PM
To: java-user@lucene.apache.org
Subject: Re: Handling special characters in Lucene 4.0
Thanks.
So, if I understand correctly, StandardAnalyzer wont work for the following
below as it strips out the special characters and does search only on
searchText ( in this case).
queryText = *&&searchText*
If we want to do a search like "*&&**" then we need to use
WhiteSpaceAnalyzer. Please let me know if my understanding is correct.
Also, I am not sure as the following is mentioned in the lucene docs? Is the
below not for StandardAnalyzer then? It is not mentioned that it wont work
for StandardAnalyzer.
/*
Escaping Special Characters
Lucene supports escaping special characters that are part of the query
syntax. The current list special characters are
+ - && || ! ( ) { } [ ] ^ " ~ * ? : \ /
To escape these character use the \ before the character. For example to
search for (1+1):2 use the query:
\(1\+1\)\:2
*/
Thanks,
Sai.
--
View this message in context:
http://lucene.472066.n3.nabble.com/Handling-special-characters-in-Lucene-4-0-tp4096674p4096727.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