Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 13574 invoked from network); 25 Apr 2009 09:33:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Apr 2009 09:33:54 -0000 Received: (qmail 97420 invoked by uid 500); 25 Apr 2009 09:33:53 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 97347 invoked by uid 500); 25 Apr 2009 09:33:53 -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 97339 invoked by uid 99); 25 Apr 2009 09:33:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Apr 2009 09:33:53 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Apr 2009 09:33:51 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 6A721234C4AE for ; Sat, 25 Apr 2009 02:33:30 -0700 (PDT) Message-ID: <1370418275.1240652010434.JavaMail.jira@brutus> Date: Sat, 25 Apr 2009 02:33:30 -0700 (PDT) From: "Michael McCandless (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-1612) expose lastDocId in the posting from the TermEnum API In-Reply-To: <636121903.1240628490563.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-1612?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12702669#action_12702669 ] Michael McCandless commented on LUCENE-1612: -------------------------------------------- This would be a good test (custom codec) for flexible indexing (LUCENE-1458), ie, allowing you to write whatever you want per-term. Also, if lastDocID is always available, this could make merging of postings much faster than it is today, because you could bulk-copy the doc/freq posting bytes while just "fixing up" the boundary between them, because docIDs are delta coded. > expose lastDocId in the posting from the TermEnum API > ----------------------------------------------------- > > Key: LUCENE-1612 > URL: https://issues.apache.org/jira/browse/LUCENE-1612 > Project: Lucene - Java > Issue Type: Improvement > Components: Index > Affects Versions: 2.4 > Reporter: John Wang > Attachments: lucene-1612-patch.txt > > > We currently have on the TermEnum api: docFreq() which gives the number docs in the posting. > It would be good to also have the max docid in the posting. That information is useful when construction a custom DocIdSet, .e.g determine sparseness of the doc list to decide whether or not to use a BitSet. > I have written a patch to do this, the problem with it is the TermInfosWriter encodes values in VInt/VLong, there is very little flexibility to add in lastDocId while making the index backward compatible. (If simple int is used for say, docFreq, a bit can be used to flag reading of a new piece of information) > output.writeVInt(ti.docFreq); // write doc freq > output.writeVLong(ti.freqPointer - lastTi.freqPointer); // write pointers > output.writeVLong(ti.proxPointer - lastTi.proxPointer); > Anyway, patch is attached with:TestSegmentTermEnum modified to test this. TestBackwardsCompatibility fails due to reasons described above. -- 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