Hi guys,
I had a need to know how many deleted documents are in the index. I noticed
there isn't an API for it in IndexReader, however the information can be
obtained by calling IndexReader.maxDoc() - IndexReader.numDocs().
Do you think it's worth adding such an API to IndexReader?
Cheers,
Shai
t; To: java-dev@lucene.apache.org
> Sent: Friday, January 11, 2008 2:30:24 PM
> Subject: Add numDeletedDocs() to IndexReader
>
> Hi guys,
>
> I had a need to know how many deleted documents are in the index. I
> noticed
> there isn't an API for it in IndexReader, however t
ROTECTED]>
To: java-dev@lucene.apache.org
Sent: Friday, January 11, 2008 2:30:24 PM
Subject: Add numDeletedDocs() to IndexReader
Hi guys,
I had a need to know how many deleted documents are in the index. I
noticed
there isn't an API for it in IndexReader, however the information can
b
g time ago... maybe on some local
> version...
>
> Otis
> --
> Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch
>
> - Original Message
> From: Shai Erera <[EMAIL PROTECTED]>
> To: java-dev@lucene.apache.org
> Sent: Friday, January 11, 2008 2:30:2
er: Shai Erera
>Priority: Minor
> Fix For: 2.4
>
>
> Add numDeletedDocs to IndexReader. Basically, the implementation is as simple
> as doing:
> public int numDeletedDocs() {
> return deletedDocs == null ? 0 : deletedDocs.count();
> }
> in SegmentRead
Docs()?
> Add numDeletedDocs to IndexReader
> -
>
> Key: LUCENE-1131
> URL: https://issues.apache.org/jira/browse/LUCENE-1131
> Project: Lucene - Java
> Issue Type: New Feature
>
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
Priority
necessary readers.
> Add numDeletedDocs to IndexReader
> -
>
> Key: LUCENE-1131
> URL: https://issues.apache.org/jira/browse/LUCENE-1131
> Project: Lucene - Java
> Issue Type: New Feature
>
, so calling it twice won't be a performance
killer, esp. since this is not something you'd call frequently, I imagine.
However, I do agree about numDeletedDocs() being nice for hiding implementation
details.
> Add numDeletedDo
[
https://issues.apache.org/jira/browse/LUCENE-1131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Otis Gospodnetic reassigned LUCENE-1131:
Assignee: Otis Gospodnetic
> Add numDeletedDocs to IndexRea
o in?
> Add numDeletedDocs to IndexReader
> -
>
> Key: LUCENE-1131
> URL: https://issues.apache.org/jira/browse/LUCENE-1131
> Project: Lucene - Java
> Issue Type: New Feature
>
iles.
> Add numDeletedDocs to IndexReader
> -
>
> Key: LUCENE-1131
> URL: https://issues.apache.org/jira/browse/LUCENE-1131
> Project: Lucene - Java
> Issue Type: New Feature
>
mpat (adds new abstract method to IndexReader).
Why don't we fallback to default impl, in IndexReader, of maxDoc() - numDocs()?
Patch is much less invasive, and, we don't break back compat? maxDoc() is
indeed cheap.
> Add numDeletedDo
xDoc() - 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
>
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 numDe
d in mind.
As for extending classes, I agree that calling two methods has little
performance overhead, but it just looks cleaner (for SegmentReader for
example). Anyway, I don't have a strong opinion on whether we should override
or not. I'll be fine with either.
> Add numDele
16 matches
Mail list logo