Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 69888 invoked from network); 12 Jun 2009 15:32:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Jun 2009 15:32:02 -0000 Received: (qmail 86663 invoked by uid 500); 12 Jun 2009 15:32:13 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 86590 invoked by uid 500); 12 Jun 2009 15:32:13 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 86582 invoked by uid 99); 12 Jun 2009 15:32:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jun 2009 15:32:13 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [74.125.46.28] (HELO yw-out-2324.google.com) (74.125.46.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jun 2009 15:32:04 +0000 Received: by yw-out-2324.google.com with SMTP id 2so1258883ywt.5 for ; Fri, 12 Jun 2009 08:31:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.121.9 with SMTP id t9mr7672897ybc.294.1244820703628; Fri, 12 Jun 2009 08:31:43 -0700 (PDT) In-Reply-To: References: Date: Fri, 12 Jun 2009 11:31:43 -0400 Message-ID: <9ac0c6aa0906120831l6a0cbb12k84edac11079c4f04@mail.gmail.com> Subject: Re: Basic Queries are not pluggable From: Michael McCandless To: java-dev@lucene.apache.org, simon.willnauer@gmail.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org +1 Mike On Fri, Jun 12, 2009 at 9:11 AM, Simon Willnauer wrote: > Hey there, > > I have a had quite a couple of usecases where I had to change some > tiny things in basic queries like BooleanQuery. I subclassed those > queries and applied the change - no problem so far. But I wanted > lucene to use this modified query everywhere in other queries and (for > sure) in the query parser. The query parser integration was easy - > subclassed it and override new*Query() methods. The rest of lucene was > a nightmare and I eventually used a source distribution and changed it > in the actual implementation - don't comment this, I hate it! > I thought about this topic for a while and want to throw it out to the > list for discussion. > > I would really appreciate to see some kind of factory methods used for > query construction for instance in the Query#rewrite() implementations > as well as in the QueryParser classes. Such a factory could be user > provided or by default simple call the constructor of the target > class. A patch for this would not break and backwards compat. afaik > and could help quite a couple of people out there I guess. > > simon > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-dev-help@lucene.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org