From java-user-return-27904-apmail-lucene-java-user-archive=lucene.apache.org@lucene.apache.org Mon May 07 03:23:46 2007 Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 50841 invoked from network); 7 May 2007 03:23:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 May 2007 03:23:46 -0000 Received: (qmail 44247 invoked by uid 500); 7 May 2007 03:23:47 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 43575 invoked by uid 500); 7 May 2007 03:23:45 -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 43564 invoked by uid 99); 7 May 2007 03:23:45 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 May 2007 20:23:45 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of bill.w.au@gmail.com designates 64.233.162.236 as permitted sender) Received: from [64.233.162.236] (HELO nz-out-0506.google.com) (64.233.162.236) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 May 2007 20:23:38 -0700 Received: by nz-out-0506.google.com with SMTP id i1so1384238nzh for ; Sun, 06 May 2007 20:23:17 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=fdNWA2P9kDCH68gSFAV8Ilye4tte97NpFPUMKKoze/pxb22sGpxJDasNEZB3gOS6hzGhgotF0D1oV4QzjLskAOIYOdU6Ah2U0Zt73kLo5VD+XFcFhV83h6cO7H3ou3NGJ6ffHtIUddBzgi702DV0omnvEfSmqF4QgboJSNhnBMQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=O3OKMflaFeVAWdjrcIIVEE5QNP3SSYEQNNXOenKb97E9om7EJs4jyfKuaF0cvFJxKjd8nyLaIib32i8L1VqlSPGOAMIEf1FBOIq9LyyZe9rjty5WBzA6MS7Ol9QywFMY3KPYLyfDpBxPQ5qtN9B7N1s/KDQzTfE1zlUMu13O5I4= Received: by 10.114.144.1 with SMTP id r1mr322658wad.1178508197468; Sun, 06 May 2007 20:23:17 -0700 (PDT) Received: by 10.114.197.4 with HTTP; Sun, 6 May 2007 20:23:17 -0700 (PDT) Message-ID: <3b5f72030705062023r33a48432ub92f01a33f412af9@mail.gmail.com> Date: Sun, 6 May 2007 23:23:17 -0400 From: "Bill Au" To: java-user@lucene.apache.org Subject: Re: QueryParser, PrefixQuery, and case sensitivity In-Reply-To: <359a92830705041701q42e47884n1276c366b3f31cbe@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <3b5f72030705041217j3105215au4f7a8d1a4a21633a@mail.gmail.com> <359a92830705041701q42e47884n1276c366b3f31cbe@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Erick, Thanks for the advice. I will take a look at PerFieldAnalyzerWrapper to see if I want to take this on. For my case, I have to use mexed case for a couple of fields since case really does matter for them (ie apple is not the same as Apple), and I actually don't want users to find the document if they enter the "wrong" case (ie a search for Apple should not return docs containing apple). Bill On 5/4/07, Erick Erickson wrote: > Look at PerFieldAnalyzerWrapper. It allows you to use different > analyzers on different fields during the query parsing phase. > > But I wouldn't go there if you don't have to. I suspect you'll spend a > LOT of time tracking down errors in your use of a mixed case index. > If for no other reason than your users will use the "wrong" case. > > Unless your index is huge (and I don't consider, say, 8G huge), I'd > index everything in, say, lower case. And ditto for your query > parsing. > > If you need to return data to the user in mixed case, then you can > *store* (but perhaps not *index*) the display fields. So you search > on one field and return data from another. > > Best > Erick > > On 5/4/07, Bill Au wrote: > > > > I have an index with both fields that are case sensitive and > > insensitive. I > > am trying to use a QueryParser to accept query from end users for > > searching. The default behavior of QueryParser is to lowercase the prefix > > text to create the PrefixQuery. So wildcard search on the case sensitive > > fields does not work. If I use QueryParser.setLowercaseWildcardTerm > > (false), > > then wildcard search on the case insensitive fields does not work. > > > > Here is an example with two fields, name (case sensitive) and desc (case > > insensitive). The docment is > > > > name (case sensitive): PowerBook > > desc (case insensitive): professional mac laptop > > > > I want to be able to find the document with the following query: > > > > +name:Power* +field:Pro* > > > > Bill > > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org