Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 28660 invoked from network); 25 Oct 2007 21:14:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Oct 2007 21:14:37 -0000 Received: (qmail 13911 invoked by uid 500); 25 Oct 2007 21:12:47 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 13879 invoked by uid 500); 25 Oct 2007 21:12:47 -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 13864 invoked by uid 99); 25 Oct 2007 21:12:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Oct 2007 14:12:47 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of warren@clarksnutrition.com designates 66.160.183.118 as permitted sender) Received: from [66.160.183.118] (HELO unassigned118.fc.aoindustries.com) (66.160.183.118) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Oct 2007 21:12:50 +0000 Received: from Warren (pool-71-110-202-177.lsanca.dsl-w.verizon.net [71.110.202.177]) (authenticated bits=0) by www7.fc.aoindustries.com (8.13.4/8.13.4) with ESMTP id l9PLDVuf016751 for ; Thu, 25 Oct 2007 16:13:31 -0500 From: "Warren" To: Subject: RE: Same query different results? Date: Thu, 25 Oct 2007 14:12:32 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 In-reply-to: <328D996C-439F-4B7D-8243-7BBBA906F352@gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org > -----Original Message----- > From: Karl Wettin [mailto:karl.wettin@gmail.com] > Sent: Wednesday, October 24, 2007 10:25 PM > To: java-user@lucene.apache.org > Subject: Re: Same query different results? > > > > 25 okt 2007 kl. 06.33 skrev Warren: > > > This query works correctly in my app and Luke > > > > +(upc:almonds description:almonds content:almonds) +dept:bulk +zone:1 > > > > Query 2: > > This query works correctly in Luke but returns no results in my app > > > > +(upc:almonds description:almonds content:almonds) +dept:"Bulk" > > +zone:1 > > > > My app code: > > > > Directory dir = FSDirectory.getDirectory(indexDir); > > IndexSearcher searcher = new IndexSearcher(dir); > > Hits hits = searcher.search(query); > > How do you create the query? If using a query parser, how do you > instantiate the query parser? > > > > > The only difference is that the term "bulk" is quoted in one query > > and not > > There is also the upper case B. > > Comparing rewritten and queries and their weight explenation might > prove helpful. > > -- > karl upc:almonds was created with QueryParser description:almonds was created with QueryParser content:almonds was created with QueryParser All of the above was placed in a BooleanQuery +dept:"Bulk" was created with a PhraseQuery +zone:1 was created with QueryParser The three different items above were all placed in a BooleanQuery QueryParser was created this way: QueryParser parser = new QueryParser(field, new StandardAnalyzer()); query = parser.parse(searchString); I can get it to work if I replace the PhraseQuery with QueryParser; Whats up with that? > > --------------------------------------------------------------------- > 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