Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DDFF79CCD for ; Wed, 18 Apr 2012 19:15:51 +0000 (UTC) Received: (qmail 9208 invoked by uid 500); 18 Apr 2012 19:15:50 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 9160 invoked by uid 500); 18 Apr 2012 19:15:50 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 9153 invoked by uid 99); 18 Apr 2012 19:15:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Apr 2012 19:15:50 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of iulius.curt@gmail.com designates 209.85.210.176 as permitted sender) Received: from [209.85.210.176] (HELO mail-iy0-f176.google.com) (209.85.210.176) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Apr 2012 19:15:42 +0000 Received: by iagw33 with SMTP id w33so14622651iag.35 for ; Wed, 18 Apr 2012 12:15:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=8mLfvARHmg6Eiiw5u4BwF/3At3EcYUG0ru/YyHk/85U=; b=CCS5GTLbXBUau6etj3eGm11bTjADKQyhDgoTFkkbA61mOMioo38/tkBsqNKmvpYn28 Eivjp/wo0lqUrGcfQ/0kWxK8xUq01mTlb9H/mV7CAmozet6tANgJzLbmse7XEB/QFixk a6GTrIM+qeyOqoXSIe7cSKjixkfeY4oJyMzo14PrjD7TWCuO4IRTHuyQmNovCQg3zYKG /x3H04zdUfUtySTxnbN8WMevwpdhnV8WWC/1nM3q37mpZeOg2rNlwsqwh/dEVWv4RbpW vkRmqX2jstRMBHc283+Ua1RgfV68D04ZeAWoaRLBZNXECHzB1KwPvjiVviKwN933DMSs EyaA== MIME-Version: 1.0 Received: by 10.50.17.201 with SMTP id q9mr3228313igd.19.1334776522072; Wed, 18 Apr 2012 12:15:22 -0700 (PDT) Received: by 10.42.227.198 with HTTP; Wed, 18 Apr 2012 12:15:17 -0700 (PDT) Date: Wed, 18 Apr 2012 22:15:17 +0300 Message-ID: Subject: [QueryParser] Omit escaped special characters From: Iulius Curt To: dev@lucene.apache.org Content-Type: multipart/alternative; boundary=14dae934094b73e0d804bdf8e0c9 --14dae934094b73e0d804bdf8e0c9 Content-Type: text/plain; charset=ISO-8859-1 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 --14dae934094b73e0d804bdf8e0c9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi, guys.

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

I try to understand why this happens.=20 Is it because of the Analyzer or because of the Parser? =A0
Here are some tests using StandardAnalyzer and QueryParser (t= runk 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&quo= t; --> f:"foo bar"
f:"foo\!bar" --> f:"fo= o bar"

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

\(1\+1\)\:2 --> defaultfield:1 defaultf= ield:1 defaultfield:2
"\(1\+1\)\:2" --> defaultfield:"1 1 2"

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


Thanks,
Iulius
--14dae934094b73e0d804bdf8e0c9--