Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 29043 invoked from network); 10 Nov 2008 15:02:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Nov 2008 15:02:25 -0000 Received: (qmail 45254 invoked by uid 500); 10 Nov 2008 15:02:23 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 45059 invoked by uid 500); 10 Nov 2008 15:02:21 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 45042 invoked by uid 99); 10 Nov 2008 15:02:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Nov 2008 07:02:21 -0800 X-ASF-Spam-Status: No, hits=-1999.8 required=10.0 tests=ALL_TRUSTED,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Nov 2008 15:01:01 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id AF7EB234C28D for ; Mon, 10 Nov 2008 07:01:44 -0800 (PST) Message-ID: <1349357710.1226329304717.JavaMail.jira@brutus> Date: Mon, 10 Nov 2008 07:01:44 -0800 (PST) From: "Mark Miller (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-1122) queryparser whitespace escaping and documentation? In-Reply-To: <27068540.1199782533883.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-1122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646275#action_12646275 ] 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: https://issues.apache.org/jira/browse/LUCENE-1122 > Project: Lucene - Java > Issue Type: Improvement > Components: QueryParser, Website > Reporter: Hoss Man > > as noted in this solr thread... > http://www.nabble.com/PhraseQuery-and-WildcardQuery-to14503609.html#a14503609 > ...it'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... > http://lucene.apache.org/java/docs/queryparsersyntax.html#Escaping%20Special%20Characters > ...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: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org