Return-Path: X-Original-To: apmail-lucene-java-user-archive@www.apache.org Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1B352D347 for ; Mon, 1 Oct 2012 14:52:37 +0000 (UTC) Received: (qmail 90440 invoked by uid 500); 1 Oct 2012 14:52:35 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 90391 invoked by uid 500); 1 Oct 2012 14:52:34 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 90381 invoked by uid 99); 1 Oct 2012 14:52:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Oct 2012 14:52:34 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of SRS0=lWm+a2=H6=basetechnology.com=jack@yourhostingaccount.com designates 65.254.253.84 as permitted sender) Received: from [65.254.253.84] (HELO mailout10.yourhostingaccount.com) (65.254.253.84) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Oct 2012 14:52:27 +0000 Received: from mailscan06.yourhostingaccount.com ([10.1.15.6] helo=mailscan06.yourhostingaccount.com) by mailout10.yourhostingaccount.com with esmtp (Exim) id 1TIhLq-0007pr-MM for java-user@lucene.apache.org; Mon, 01 Oct 2012 10:52:06 -0400 Received: from impout02.yourhostingaccount.com ([10.1.55.2] helo=impout02.yourhostingaccount.com) by mailscan06.yourhostingaccount.com with esmtp (Exim) id 1TIhLq-0003Y0-GO for java-user@lucene.apache.org; Mon, 01 Oct 2012 10:52:06 -0400 Received: from authsmtp17.yourhostingaccount.com ([10.1.18.17]) by impout02.yourhostingaccount.com with NO UCE id 5qs61k00A0N5tVm01qs6v5; Mon, 01 Oct 2012 10:52:06 -0400 X-Authority-Analysis: v=2.0 cv=HIVB5/Rv c=1 sm=1 a=PHQHB1QSaEYgcU2qnZkzMw==:17 a=aQzbgH187woA:10 a=Xf0fIZOslg4A:10 a=3jZET7lWBKwA:10 a=8nJEP1OIZ-IA:10 a=jvYhGVW7AAAA:8 a=KFT7qEhYyYIA:10 a=mV9VRH-2AAAA:8 a=G8DjC6xtmUY-QuqS-9kA:9 a=wPNLvfGTeEIA:10 a=EMlJoiak7gQA:10 a=88iI8knYSJUA:10 a=ayZJSlMgWVhgG3n+ZwULew==:117 X-EN-OrigOutIP: 10.1.18.17 X-EN-IMPSID: 5qs61k00A0N5tVm01qs6v5 Received: from 207-237-102-116.c3-0.nyr-ubr1.nyr.ny.cable.rcn.com ([207.237.102.116] helo=JackKrupansky) by authsmtp17.yourhostingaccount.com with esmtpa (Exim) id 1TIhLq-0003PZ-5u for java-user@lucene.apache.org; Mon, 01 Oct 2012 10:52:06 -0400 Message-ID: From: "Jack Krupansky" To: References: <23719B3684194B6A8C67DFBD43A03C56@JackKrupansky><4FB7C08158A448B09E305C1F76DF3261@JackKrupansky> In-Reply-To: Subject: Re: Searching for a search string containing a literal slash doesn't work with QueryParser Date: Mon, 1 Oct 2012 10:52:04 -0400 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 15.4.3555.308 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3555.308 X-EN-UserInfo: e0a4b55451ed9f27313ebf02e3d4348d:fc4a93e1349e680c52bdd723c0ab3ef6 X-EN-AuthUser: jack@basetechnology.com Sender: "Jack Krupansky" X-EN-OrigIP: 207.237.102.116 X-EN-OrigHost: 207-237-102-116.c3-0.nyr-ubr1.nyr.ny.cable.rcn.com Sorry, I meant apply the filter to the TOKENIZER that the analyzer uses. -- Jack Krupansky -----Original Message----- From: Jack Krupansky Sent: Monday, October 01, 2012 10:44 AM To: java-user@lucene.apache.org Subject: Re: Searching for a search string containing a literal slash doesn't work with QueryParser You can apply the lower case filter to the whitespace or other analyzer and use that as the analyzer. -- Jack Krupansky -----Original Message----- From: Jochen Hebbrecht Sent: Monday, October 01, 2012 10:34 AM To: java-user@lucene.apache.org Subject: Re: Searching for a search string containing a literal slash doesn't work with QueryParser Hi Jack, I tried analyzing through WhitespaceAnalyzer. Now I can search on my query string AND I can find my document! Great! But all my searches are now case sensitive. So when I index a field as "JavaOne", I also have to enter in my search word: "JavaOne" and not "javaone" or "javaOne". How do you solve this in a proper way? Bringing all characters toLowerCase() when indexing them? Jochen 2012/10/1 Jack Krupansky > That's "The escape merely..." > > -- Jack Krupansky > > -----Original Message----- From: Jack Krupansky > Sent: Monday, October 01, 2012 9:58 AM > To: java-user@lucene.apache.org > Subject: Re: Searching for a search string containing a literal slash > doesn't work with QueryParser > > > The scape merely assures that the slash will not be parsed as query syntax > and will be passed directly to the analyzer, but the standard analyzer > will > in fact always remove it. Maybe you want the white space analyzer or > keyword > analyzer (no characters removed.) > > -- Jack Krupansky > > -----Original Message----- From: Jochen Hebbrecht > Sent: Monday, October 01, 2012 8:59 AM > To: java-user@lucene.apache.org > Subject: Searching for a search string containing a literal slash doesn't > work with QueryParser > > Hi, > > I'm currently trying to search on the following search string in my Lucene > index: "2012/0.124.323". > The java code to search for ('value' is my search string) > > ---- > QueryParser queryParser = new QueryParser(Version.LUCENE_36, field, new > StandardAnalyzer(Version.**LUCENE_36)); > queryParser.**setAllowLeadingWildcard(true); > return queryParser.parse(value); > ---- > > This returns a query result: "2012" "0.124.323". QueryParser is replacing > the forward slash by a space. > I tried escaping the "/" with a backslash "\", but this doesn't work > either. > > Maybe required to fully understand my scenario. I have the following > import > XML: > > --- > ... > Vervaldag > 17/07/12 > 09/07/12 > 2012/0.124.323 > Kapitaals > ... > --- > > I get all TEXT values with an XPath expression and I index them as: > > --- > XPathExpression expr = xpath.compile("//TEXT"); > Object result = expr.evaluate(document, XPathConstants.NODESET); > NodeList nodes = (NodeList) result; > for (int i = 0; i < nodes.getLength(); i++) { > doc.add(new org.apache.lucene.document.**Field("IMAGE", > nodes.item(i).getFirstChild().**getNodeValue(), Store.NO, > Index.ANALYZED)); > } > --- > > I'm using the StandardAnalyzer. > > What is the best way to solve my issue? Do I need to switch from Analyzer? > Do I have to use something else then QueryParser? ... > I also want to support searching on 2012/0.*, so I cannot only use > TermQuery ... > > Kind regards, > Jochen > > > ------------------------------**------------------------------**--------- > To unsubscribe, e-mail: > java-user-unsubscribe@lucene.**apache.org > For additional commands, e-mail: > java-user-help@lucene.apache.**org > > ------------------------------**------------------------------**--------- > To unsubscribe, e-mail: > java-user-unsubscribe@lucene.**apache.org > For additional commands, e-mail: > java-user-help@lucene.apache.**org > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org