lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Miller (JIRA)" <>
Subject [jira] Commented: (LUCENE-1122) queryparser whitespace escaping and documentation?
Date Mon, 10 Nov 2008 15:01:44 GMT


Mark Miller commented on LUCENE-1122:

Its because a term is madeup of TERM_START_CHAR + TERM_CHAR*, both of which can contain an
ESCAPED_CHAR, which is an escape, '\', followed by anything. So backslash space matches ESCAPED_CHAR,
and the space is eaten as part of the term rather than being used as a whitespace break.

We could change it, or it sounds like its fine to leave it. If we leave it, I guess we can
doc it and close this issue. Give me your preference and I'll be happy to do it.

> queryparser whitespace escaping and documentation?
> --------------------------------------------------
>                 Key: LUCENE-1122
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: QueryParser, Website
>            Reporter: Hoss Man
> as noted in this solr thread...
>'s possible to escape a whitespace character in the value of a term or prefix query
by using a backslash so that the QueryParser will not treat it as "special" (ie: won't split
on it when dividing the input into chunks for analysis).
> at a minimum, this should be noted here...
> ...but it got me wondering...
>    * is this a side effect of something else, or will QueryParser really respect this
everywhere? even in field names? (i haven't tested) ... i think this is a result of QueryParser
allowing you to escape any character even if it isn't "special" to the syntax
>    * shouldn't a space be considered "special" since it does trigger certain behavior?
... so shouldn't QueryParser.escape(String) escape spaces as well as the other special characters?

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message