lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shai Erera (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-1131) Add numDeletedDocs to IndexReader
Date Sun, 07 Sep 2008 12:31:45 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-1131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12628967#action_12628967
] 

Shai Erera commented on LUCENE-1131:
------------------------------------

What if we implement numDeletedDocs() in IndexReader, instead of defining it abstract?
Those that extend IndexReader (outside the scope of the attached patch) can then choose to
override the implementation or not.

The purpose of the patch is to add an explicit method which developers can use, rather than
understand the logic on maxDoc() - numDocs(). Not all extended classes implement it this way
BTW. SegmentReader just calls deletedDocs.count(), rather then calling the two separate methods.

> Add numDeletedDocs to IndexReader
> ---------------------------------
>
>                 Key: LUCENE-1131
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1131
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Shai Erera
>            Assignee: Otis Gospodnetic
>            Priority: Minor
>             Fix For: 2.4
>
>         Attachments: LUCENE-1131.patch
>
>
> Add numDeletedDocs to IndexReader. Basically, the implementation is as simple as doing:
> public int numDeletedDocs() {
>   return deletedDocs == null ? 0 : deletedDocs.count();
> }
> in SegmentReader.
> Patch to follow to include in all IndexReader extensions.

-- 
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


Mime
View raw message