lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anne <asros...@gmail.com>
Subject Escaping special character -
Date Tue, 18 Oct 2011 18:47:07 GMT
Hi,
I have a field that is not tokenized. Its value can contain a "-".
For instance it could be "project-test". I have read that I need to escape
this special character with a \
I am using the following code (StandardAnanyzer):
 Query query = queryParser.parse("field:project\\-test);

and it doesn't retrieve my document.

Is it because I need to use a TermQuery?
I have tried with a TermQuery and it seems that in this case I don't need to
escape the "-".

Or is it because of the analyzer?

Any help will be appreciated. Thanks a lot,
Anne



--
View this message in context: http://lucene.472066.n3.nabble.com/Escaping-special-character-tp3432118p3432118.html
Sent from the Lucene - Java Developer mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message