Return-Path: X-Original-To: apmail-lucene-java-user-archive@www.apache.org Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C9BC110EAB for ; Thu, 17 Apr 2014 15:23:02 +0000 (UTC) Received: (qmail 36651 invoked by uid 500); 17 Apr 2014 15:23:00 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 36524 invoked by uid 500); 17 Apr 2014 15:22:59 -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 36515 invoked by uid 99); 17 Apr 2014 15:22:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Apr 2014 15:22:59 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gregdearing@gmail.com designates 74.125.82.182 as permitted sender) Received: from [74.125.82.182] (HELO mail-we0-f182.google.com) (74.125.82.182) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Apr 2014 15:22:55 +0000 Received: by mail-we0-f182.google.com with SMTP id p61so571904wes.41 for ; Thu, 17 Apr 2014 08:22:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=8P0PSMzjmZV7wxVXJiantLFvC0Z5qW+K6z/HKmTWwzM=; b=DCw2ZLBct8uMK57nXdK1rJods7e0vINQve3Y8W5FV/ELLq2HtzCGFlnpdWhLn9F48g WdsrWeMZxUC/N+EpM5RCoLjOX8yxlPenDuAc1QpXery6con4Z5SO53F+UFXO+QCLa1Zl xOMiYTT4u1mdTvjDSUngwSzcSpGt0pfjyU0Lb5ATxE2FjCbYSyOd47bTFVSTqmX1RmJc 86zOO6+LR48jFhdCoqL3FmYwuXfLvM0Y2K4nFjxfW+6G2IBuXS9Giye/dyqohKBo0XwY rGpcMZ12puZt1MCgXWUf9edP0vrsZSvMb9M5ls4vtkk0oABWqyyZd1+YP4QYDCKGVxa1 kxPw== MIME-Version: 1.0 X-Received: by 10.180.77.129 with SMTP id s1mr12819445wiw.56.1397748153073; Thu, 17 Apr 2014 08:22:33 -0700 (PDT) Received: by 10.180.198.109 with HTTP; Thu, 17 Apr 2014 08:22:33 -0700 (PDT) In-Reply-To: References: Date: Thu, 17 Apr 2014 11:22:33 -0400 Message-ID: Subject: Re: BooleanScorer - Maximum Prohibited Scorers? From: Gregory Dearing To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=f46d043c801e264b1904f73e9aa2 X-Virus-Checked: Checked by ClamAV on apache.org --f46d043c801e264b1904f73e9aa2 Content-Type: text/plain; charset=UTF-8 David, I believe I misunderstood your question in my earlier response. I think you can create a logical "MaximumNumberMustNotMatch" by nesting Boolean Queries. 1.) Create a Boolean Query, using 'SHOULD' clauses and setting Minimum Number Should Match. 2. ) Wrap the BooleanQuery with a 'MUST_NOT' BooleanClause. 3.) Add the negating BooleanClause to a second BooleanQuery. -Greg On Thu, Apr 17, 2014 at 10:40 AM, Gregory Dearing wrote: > David, > > Any document that matches a MUST_NOT clause will not match the > BooleanQuery. By definition. > > This means that "maximumNumberMustNotMatch" is effectively hardcoded to > zero. > > -Greg > > > On Wed, Apr 16, 2014 at 3:59 PM, David Stimpert wrote: > >> Hello, >> I have found useful functionality in BooleanQuery which allows me to >> specify a minimum number of matching optional terms >> (i.e. setMinimumNumberShouldMatch). I do not, however, see similar >> functionality available for setting the maximum number of MUST_NOTs (i.e. >> setMaximumNumberMustNotMatch). I am starting to look into how I could >> customize this functionality. Does this seem feasible? Do you foresee >> any >> major challenges? Any advice? >> > > --f46d043c801e264b1904f73e9aa2--