Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 80499 invoked from network); 10 Feb 2005 18:25:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 10 Feb 2005 18:25:32 -0000 Received: (qmail 4937 invoked by uid 500); 10 Feb 2005 18:25:27 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 4906 invoked by uid 500); 10 Feb 2005 18:25:27 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 4891 invoked by uid 99); 10 Feb 2005 18:25:27 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of jharuska@gmail.com designates 64.233.170.193 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (64.233.170.193) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 10 Feb 2005 10:25:26 -0800 Received: by rproxy.gmail.com with SMTP id j1so147747rnf for ; Thu, 10 Feb 2005 10:25:24 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=kbT9MyPkeLkQ0MQRm+llEjJD+4joBfYFlvj0N2R9tIZqB225Mvon+Whe9kQxX/v5TK12qvQ/RCXZytaFqD9z8xEZEUXKeGoRPNLX4dHvMedDEoPKLd87oqjHu8+vyzFIw7zngEcQSQzbr0JMYexudp7kRYWr6+O9OzbRaixseEo= Received: by 10.38.92.71 with SMTP id p71mr32910rnb; Thu, 10 Feb 2005 10:25:23 -0800 (PST) Received: by 10.38.101.2 with HTTP; Thu, 10 Feb 2005 10:25:23 -0800 (PST) Message-ID: <5fbbcd1405021010257c0869a0@mail.gmail.com> Date: Thu, 10 Feb 2005 13:25:23 -0500 From: Jason Haruska Reply-To: Jason Haruska To: Lucene Users List Subject: Re: != queries In-Reply-To: <047201c50f9d$005e0150$de01a8c0@imobile2> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <045a01c50f9a$abf83d80$de01a8c0@imobile2> <1108058865.5357.19.camel@saturn> <047201c50f9d$005e0150$de01a8c0@imobile2> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N If this is a query you need to support often, you could create a field "x" that contains "x" in every document. Then search on that with your prohibited query. If not, you could get the document list by doing your search then removing all of those documents from a complete set outside of lucene. On Thu, 10 Feb 2005 11:19:03 -0700, aaz wrote: > Ok, that makes sense. Any suggestions on how to AND that prohibited clause > with a query to get everything? > > ----- Original Message ----- > From: "Miles Barr" > To: "Lucene Users List" > Sent: Thursday, February 10, 2005 11:07 AM > Subject: Re: != queries > > > On Thu, 2005-02-10 at 11:02 -0700, aaz wrote: > >> I have an index with field "documentNumber". There are 10 documents. One > >> of the documents has documentNumber A5058970 > >> > >> I want to return all matches where documentNumber != A505*. I should get > >> 9 docs back. > >> > >> I construct a query like > >> > >> wq = WildcardQuery("documentNumber","a505*") > >> > >> BooleanQuery bq = new BooleanQuery(); > >> bq.addQuery(wq,false,true); > >> > >> I always get no results for this type of query. > >> > >> Ideas? > > > > A restriction can only filter out search results and not add to them. So > > the search is starting with an empty set, then trying to filter out the > > results with a document number starting A505, i.e. doing nothing. > > > > > > > > > > -- > > Miles Barr > > Runtime Collective Ltd. > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: lucene-user-help@jakarta.apache.org > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: lucene-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org