Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 12479 invoked from network); 13 Jul 2005 23:59:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Jul 2005 23:59:48 -0000 Received: (qmail 97463 invoked by uid 500); 13 Jul 2005 23:59:45 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 96552 invoked by uid 500); 13 Jul 2005 23:59:41 -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 96533 invoked by uid 99); 13 Jul 2005 23:59:41 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jul 2005 16:59:41 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [69.55.225.129] (HELO ehatchersolutions.com) (69.55.225.129) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jul 2005 16:59:38 -0700 Received: by ehatchersolutions.com (Postfix, from userid 504) id 3339613E2005; Wed, 13 Jul 2005 19:59:34 -0400 (EDT) Received: from [172.16.1.101] (va-71-48-129-227.dhcp.sprint-hsd.net [71.48.129.227]) by ehatchersolutions.com (Postfix) with ESMTP id BA3A013E2005 for ; Wed, 13 Jul 2005 19:59:31 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v730) In-Reply-To: <20050713144053.5131.qmail@webmail32.rediffmail.com> References: <20050713144053.5131.qmail@webmail32.rediffmail.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Erik Hatcher Subject: Re: Wild card and multiple keyword search Date: Wed, 13 Jul 2005 19:52:48 -0400 To: java-user@lucene.apache.org X-Mailer: Apple Mail (2.730) X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on javelina X-Spam-Level: X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-5.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.1 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Jul 13, 2005, at 10:40 AM, Rahul D Thakare wrote: > que: - The question back to you is do you want searches for simply > "MAIN" to > find both "MAIN LOGIC" and "MAIN PARTS"? Or should it return no > documents since its not an exact match? > > Ans: It should return no documents since it is not a exact match. > > I would like to explain my point 2 in below mail again by giveing > an example here > > eg- If there are two records with keyword ie "Main Logic" and > "Main Board" respectively. > > what we want is > 1. if the user serch on Main*, both the record should return. > 2. If the user search on "Main Logic", only one record should be > return. > 3. If the user searches for Main, no record should be returned > > > point 2 above is working now because we are using Field.Keyword > (which doesn't tokenise the spaces) and KeywordAnalyser. > > point 1 (wild card search) is not working because KeywordAnalyser > does not recognise wild card That's not quite accurate about why wild card search isn't working. My hunch is that it is the lowercasing effect of QueryParser. There is an _instance_ setter to control it. You'll need to construct an instance of QueryParser, call setLowercaseWildcardTerms(false), and then call the parse(String) method. Erik --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org