Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 12179 invoked from network); 10 Dec 2009 18:15:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Dec 2009 18:15:19 -0000 Received: (qmail 93992 invoked by uid 500); 10 Dec 2009 18:15:17 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 93905 invoked by uid 500); 10 Dec 2009 18:15:17 -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 93895 invoked by uid 99); 10 Dec 2009 18:15:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Dec 2009 18:15:17 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [85.25.71.29] (HELO mail.troja.net) (85.25.71.29) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Dec 2009 18:15:14 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.troja.net (Postfix) with ESMTP id 0CBF7D36004 for ; Thu, 10 Dec 2009 19:14:50 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.troja.net Received: from mail.troja.net ([127.0.0.1]) by localhost (megaira.troja.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G7vBtkdEcZHG for ; Thu, 10 Dec 2009 19:14:38 +0100 (CET) Received: from VEGA (port-83-236-62-54.dynamic.qsc.de [83.236.62.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.troja.net (Postfix) with ESMTPSA id 3992ED36001 for ; Thu, 10 Dec 2009 19:14:37 +0100 (CET) From: "Uwe Schindler" To: References: <4d19a3630912100739v5d1c833dk4d00c69d246a98fa@mail.gmail.com> <0BD98686910A41E9AD92D0F0A1E9F364@VEGA> Subject: RE: "IN" Query for NumericFields Date: Thu, 10 Dec 2009 19:14:36 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <0BD98686910A41E9AD92D0F0A1E9F364@VEGA> Thread-Index: Acp5rxzZqJSNbIcQSmOK8VjOYG5qdwABat+gAAOOrTAAAFesgA== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Sorry, if you have an IN query, it must be BooleanClause.Occur.SHOULD, as the CategoryID can be 1, or 3 or 7. You query should not match any doc (I verified this). ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: uwe@thetaphi.de > -----Original Message----- > From: Uwe Schindler [mailto:uwe@thetaphi.de] > Sent: Thursday, December 10, 2009 7:03 PM > To: java-user@lucene.apache.org > Subject: RE: "IN" Query for NumericFields > > Cannot be :-) Is the precstep identical? > > ----- > Uwe Schindler > H.-H.-Meier-Allee 63, D-28213 Bremen > http://www.thetaphi.de > eMail: uwe@thetaphi.de > > > > -----Original Message----- > > From: comparis.ch - Roman Baeriswyl [mailto:roman.baeriswyl@comparis.ch] > > Sent: Thursday, December 10, 2009 5:24 PM > > To: 'java-user@lucene.apache.org' > > Subject: RE: "IN" Query for NumericFields > > > > I tried > > > > Query q = new BooleanQuery(); > > ((BooleanQuery)q).Add(NumericRangeQuery.NewLongRange("CategoryID", 1, 1, > > true, true), BooleanClause.Occur.MUST); > > ((BooleanQuery)q).Add(NumericRangeQuery.NewLongRange("CategoryID", 3, 3, > > true, true), BooleanClause.Occur.MUST); > > ((BooleanQuery)q).Add(NumericRangeQuery.NewLongRange("CategoryID", 7, 7, > > true, true), BooleanClause.Occur.MUST); > > > > But that seems to mach all Documents in my Index. > > > > -----Original Message----- > > From: shashi.mit@gmail.com [mailto:shashi.mit@gmail.com] On Behalf Of > > Shashi Kant > > Sent: Donnerstag, 10. Dezember 2009 16:40 > > To: java-user@lucene.apache.org > > Subject: Re: "IN" Query for NumericFields > > > > Have you looked at BooleanQuery? Create individual TermQuery and OR them > > using BooleanQuery. > > > > On Thu, Dec 10, 2009 at 10:34 AM, comparis.ch - Roman Baeriswyl < > > roman.baeriswyl@comparis.ch> wrote: > > > > > Hi, > > > > > > I do have some indices where I need to get results based on a fixed > > number > > > list (not a range) > > > Let's say I have a field named "CategoryID" and I now need all results > > > where "CategoryID" is 1,3 or 7. > > > > > > In Lucene 2.4 I created a QueryParser which looked like: > "CategoryID:(1 > > 3 > > > 7)". But the Query Parser won't work with NumericFields... > > > > > > How can I achieve the same for NumericFields? > > > > > > Btw I'm using Lucene.net. > > > > > > Thanks for Help > > > //Roman > > > > > > comparis.ch auf Twitter folgen: http://twitter.com/comparis > > > > > > Ein Freund auf Facebook werden: http://www.facebook.com/comparis.ch > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > > > For additional commands, e-mail: java-user-help@lucene.apache.org > > > > > > > > > > comparis.ch auf Twitter folgen: http://twitter.com/comparis > > > > Ein Freund auf Facebook werden: http://www.facebook.com/comparis.ch > > > > --------------------------------------------------------------------- > > 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 --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org