Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 60141 invoked from network); 5 Apr 2007 22:04:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Apr 2007 22:04:02 -0000 Received: (qmail 62089 invoked by uid 500); 5 Apr 2007 22:04:05 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 62016 invoked by uid 500); 5 Apr 2007 22:04:05 -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 61972 invoked by uid 99); 5 Apr 2007 22:04:04 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Apr 2007 15:04:04 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Apr 2007 15:03:57 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C75B6714073 for ; Thu, 5 Apr 2007 15:03:36 -0700 (PDT) Message-ID: <28932573.1175810616800.JavaMail.jira@brutus> Date: Thu, 5 Apr 2007 15:03:36 -0700 (PDT) From: "Hoss Man (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-857) Remove BitSet caching from QueryFilter In-Reply-To: <21484719.1175805032232.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487116 ] Hoss Man commented on LUCENE-857: --------------------------------- >From email since i didn't notice Otis opened this issue already... Date: Thu, 5 Apr 2007 14:24:31 -0700 (PDT) To: java-dev@lucene.apache.org Subject: Re: Caching in QueryFilter - why? : Since caching is built into the public BitSet bits(IndexReader reader) : method, I don't see a way to deprecate that, which means I'll just cut : it out and document it in CHANGES.txt. Anyone who wants QueryFilter : caching will be able to get the caching back by wrapping the QueryFilter : in your CachingWrapperFilter. this seems like a potentially big surprise for people when upgrading ... old code will continue to work fine without warning, just get a lot less efficient. If the concern is duplicated code, perhaps QueryFilter should be deprecated and changed to be a subclass of CachingWrapperFilter, with a constructor that takes in the Query and wraps it in some new class (QueryWrapperFilter perhaps?) that does the meaty part (collecting the matches) ... @deprecated use CachingWrapperFilter and QueryWrapperFilter directly public class QueryFilter extends CachingWrapperFilter { public QueryFilter(Query query) { super(new QueryWrapperFilter(query)); } } public class QueryWrapperFilter extends Filter { private Query query; public QueryWrapperFilter(Query query) { this.query = query; } public BitSet bits(IndexReader reader) throws IOException { final BitSet bits = new BitSet(reader.maxDoc()); new IndexSearcher(reader).search(query, new HitCollector() { public final void collect(int doc, float score) { bits.set(doc); // set bit for hit } }); return bits; } } (obviously we need some toString, equals, and hashCode methods in here as well) > Remove BitSet caching from QueryFilter > -------------------------------------- > > Key: LUCENE-857 > URL: https://issues.apache.org/jira/browse/LUCENE-857 > Project: Lucene - Java > Issue Type: Improvement > Reporter: Otis Gospodnetic > Assigned To: Otis Gospodnetic > Priority: Minor > Attachments: LUCENE-857.patch > > > Since caching is built into the public BitSet bits(IndexReader reader) method, I don't see a way to deprecate that, which means I'll just cut it out and document it in CHANGES.txt. Anyone who wants QueryFilter caching will be able to get the caching back by wrapping the QueryFilter in the CachingWrapperFilter. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org