From java-user-return-42151-apmail-lucene-java-user-archive=lucene.apache.org@lucene.apache.org Thu Sep 03 22:16:05 2009 Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 60078 invoked from network); 3 Sep 2009 22:16:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Sep 2009 22:16:05 -0000 Received: (qmail 14825 invoked by uid 500); 3 Sep 2009 22:16:03 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 14773 invoked by uid 500); 3 Sep 2009 22:16:02 -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 14763 invoked by uid 99); 3 Sep 2009 22:16:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Sep 2009 22:16:02 +0000 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 [208.69.42.181] (HELO radix.cryptio.net) (208.69.42.181) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Sep 2009 22:15:54 +0000 Received: by radix.cryptio.net (Postfix, from userid 1007) id 6789971C787; Thu, 3 Sep 2009 15:15:34 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by radix.cryptio.net (Postfix) with ESMTP id 6180771C785 for ; Thu, 3 Sep 2009 15:15:34 -0700 (PDT) Date: Thu, 3 Sep 2009 15:15:34 -0700 (PDT) From: Chris Hostetter To: java-user@lucene.apache.org Subject: Re: Extending Sort/FieldCache In-Reply-To: <786fde50908262031u7602aac0lb01fde4d0dd9c393@mail.gmail.com> Message-ID: References: <786fde50908200449rfb30156p39f7b8bb7a9a2f5f@mail.gmail.com> <786fde50908262031u7602aac0lb01fde4d0dd9c393@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org : I wanted to avoid two things: : * Writing the logic that invokes cache-refresh upon IndexReader reload. Uh... i don't think there is any code that FieldCache refreshing on reload (yet), so you wouldn't be missing out on anything. (as long as your custom cache works at the SegmentReader level, you'd have the exact same benefits as using FieldCache) : * Write my own TopFieldCollector which uses this cache. well, yeah ... there you're screwed. you know ... just because FieldCache.DEFAULT is a static final singleton, doesn't mean we need to have FieldCache.DEFAULT hardcoded in so many places ... a lot of the high level classes that refer to FieldCache.DEFAULT could probably be refacotred to have a setFieldCache(FieldCache) method that defaults to FieldCache.DEFAULT, and then they could pass it down to the lower level classes ... that way you *could* write a "MyFieldCache extends FieldCache", and then have a SortComparator (or FieldComparator, or whatever it's called now) that cast the FieldCache it gets to your MyFieldCache and calls the custom methods ... withoutneeding to rewrite all of hte Collector code. It sounds a little invasive to make it into 2.9 ... but i haven't looked ito what it would involve ... in theory it could be really straight forward and backwards compatible. -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org