You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Iulius Curt <iu...@gmail.com> on 2012/04/18 21:15:17 UTC

[QueryParser] Omit escaped special characters

Hi, guys.

Why is it OK for the QueryParser to omit escaped special chars? Or isn't it?
What I'm trying to say is that the escaped char is replaced with whitespace
instead of being literally passed.

I try to understand why this happens. Is it because of the Analyzer or
because of the Parser?
Here are some tests using StandardAnalyzer and QueryParser (trunk version)
to illustrate:

f:foo-bar --> f:foo f:bar
f:"foo-bar" --> f:"foo bar"
f:"foo\-bar" --> f:"foo bar"
f:"foo\+bar" --> f:"foo bar"
f:"foo\!bar" --> f:"foo bar"

temp:70 --> temp:70
temp:\-70 --> temp:70
temp:"-70" --> temp:70

\(1\+1\)\:2 --> defaultfield:1 defaultfield:1 defaultfield:2
"\(1\+1\)\:2" --> defaultfield:"1 1 2"

This (not sure if) issue is somehow related to LUCENE-2916 [1]

[1] https://issues.apache.org/jira/browse/LUCENE-2916

Thanks,
Iulius

Re: [QueryParser] Omit escaped special characters

Posted by Iulius Curt <iu...@gmail.com>.
(Gentle reminder) If you get some time, please have a look on this.