Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 30602 invoked from network); 10 Jul 2008 15:19:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Jul 2008 15:19:00 -0000 Received: (qmail 3197 invoked by uid 500); 10 Jul 2008 15:16:34 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 3164 invoked by uid 500); 10 Jul 2008 15:16: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 3152 invoked by uid 99); 10 Jul 2008 15:16:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Jul 2008 08:16:34 -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: local policy) Received: from [82.111.253.243] (HELO mail.uk.scalix.com) (82.111.253.243) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Jul 2008 15:15:40 +0000 Received: from mail.uk.scalix.com (localhost.localdomain [127.0.0.1]) by mail.uk.scalix.com (8.13.8/8.13.8) with ESMTP id m6AFEx1K010379 for ; Thu, 10 Jul 2008 16:15:00 +0100 Received: from [10.11.108.233] (mail.uk.scalix.com [10.11.108.216]) by mail.uk.scalix.com (Scalix SMTP Relay 11.4.1.11843) via ESMTP; Thu, 10 Jul 2008 16:14:59 +0100 (BST) Date: Thu, 10 Jul 2008 16:14:59 +0100 From: Chris Bamford To: java-user@lucene.apache.org Message-ID: <48762773.60009@scalix.com> In-Reply-To: <4875F939.20507@scalix.com> References: <18295066.post@talk.nabble.com> References: <4875F939.20507@scalix.com> Subject: Re: newbie question (for John Griffin) - fixed x-scalix-Hops: 1 User-Agent: Thunderbird 2.0.0.14 (X11/20080505) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII"; format="flowed" Content-Disposition: inline X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail.uk.scalix.com X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Hi John, Please ignore my earlier questions on this subject, as I have got to the bottom of it. I was not passing each word in the phrase as a separate Term to the query; instead I was passing the whole string (doh!). Thanks. - Chris Chris Bamford wrote: > Hi John, > > Further to my question below, I did some back-to-basics investigation > of PhraseQueries and found that even basic ones fail for me... > I found the attached code on the Internet (see > http://affy.blogspot.com/2003/04/codebit-examples-for-all-of-lucenes.html) > and this fails too... Can you explain why? I would expect the first > test to deliver 2 hits. > > I have tried with Lucene 2.0 and 2.3.2 jars and both fail. > > Thanks again, > > - Chris > > > > Chris Bamford wrote: >> Hi John, >> >> Just continuing from an earlier question where I asked you how to >> handle strings like "from:fred flintston*" (sorry I have lost the >> original email). >> You advised me to write my own BooleanQuery and add to it Prefix- / >> Term- / Phrase- Querys as appropriate. I have done so, but am having >> trouble with the result - my PhraseQueries just do not get any hits >> at all :-( >> My code looks for quotes - if it finds them, it treats the quoted >> phrase as a PhraseQuery and sets the slop factor to 0. >> so, an input of: >> >> subject:"Good Morning" >> >> results in a PhraseQuery (which I add to my BooleanQuery and then >> dump with toString()) of: >> >> +subject:"good morning" >> >> ... which fails. >> However, if I break it into 2 TermQuerys, it works (but that's not >> what I want). >> >> What am I missing? >> >> Thanks, >> >> - Chris >> >> --------------------------------------------------------------------- >> 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 -- ------------------------------------------------------------------------ *Chris Bamford* Senior Development Engineer ------------------------------------------------------------------------ /Email / MSN/ chris.bamford@scalix.com /Tel/ +44 (0)1344 381814 /Skype/ c.bamford --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org