Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 65267 invoked from network); 17 Nov 2004 16:30:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 17 Nov 2004 16:30:58 -0000 Received: (qmail 9614 invoked by uid 500); 17 Nov 2004 16:30:54 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 9596 invoked by uid 500); 17 Nov 2004 16:30:53 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 9583 invoked by uid 99); 17 Nov 2004 16:30:53 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from [207.14.217.166] (HELO server) (207.14.217.166) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 17 Nov 2004 08:30:51 -0800 Received: from [192.168.205.180] (lv-69-69-100-62.sta.sprint-hsd.net [69.69.100.62]) by server (8.12.8/8.12.8) with SMTP id iAHENfCV001449 for ; Wed, 17 Nov 2004 09:23:42 -0500 Mime-Version: 1.0 (Apple Message framework v619) In-Reply-To: References: Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <09A7323B-38B6-11D9-AC67-000A95BC61B6@ehatchersolutions.com> Content-Transfer-Encoding: 7bit From: Erik Hatcher Subject: Re: Whitespace Analyzer not producing expected search results Date: Wed, 17 Nov 2004 08:30:48 -0800 To: "Lucene Users List" X-Mailer: Apple Mail (2.619) X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Nov 17, 2004, at 7:44 AM, lee.a.carroll@britishairways.com wrote: > I then try a search using the term > > ResponseHelper.writeNoCachingHeaders\(*\); > > now I'm expecting this to be a wider search term and it should find at > least two, possibly more docs? > > the query parser produces the query > > +contents:responsehelper.writenocachingheaders(*); > > wow the query has lost its case and no docs get returned. > > Why does the query parser do this (my analyzer is the provided > whitespace > one). > > Any ideas to get around this ? Because generally terms are lowercased when indexed by the analyzer (but not in your case with WhitespaceAnalyzer), QueryParser defaults to lowercasing wildcarded queries. Wildcard query terms are not analyzed. To get around this, construct an instance of QueryParser and turn the lowercasing of wildcard terms off: QueryParser parser = new QueryParser("field", new StandardAnalyzer()); parser.setLowercaseWildcardTerms(false); Use the instance of QueryParser instead of the static parse method from now on. Erik --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org