lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cheolgoo Kang" <app...@gmail.com>
Subject Re: IndexModifier's docCount is inconsistent
Date Tue, 10 Apr 2007 00:36:18 GMT
Thanks Otis,

I've already made some modification to get the number of deleted docs
in IndexWriter.docCount() and using it. It's works great but the
problem is not being aware of deletes within IndexWriter itself. I
have to re-open the IndexWriter to get the updated number of deletes.
Haha! (It's fine cause my index is almost read-only.)

Anyway, I think it's name or functionality of a method should be
consistent through IndexReader, IndexWriter, IndexModifier, etc.
That's just what I've asked before.


On 4/10/07, Otis Gospodnetic <otis_gospodnetic@yahoo.com> wrote:
> I have actually added a method to get the number of deleted documents to all *Reader
classes just the other day.  I'll provide a patch soon.  It still won't make the IndexWriter
aware of deletes, but will that help you?
>
> Otis
>  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
> Simpy -- http://www.simpy.com/  -  Tag  -  Search  -  Share
>
> ----- Original Message ----
> From: Cheolgoo Kang <appler@gmail.com>
> To: java-user@lucene.apache.org
> Sent: Friday, April 6, 2007 10:40:52 AM
> Subject: IndexModifier's docCount is inconsistent
>
> When we use IndexModifier's docCount() method, it calls it's
> underlying IndexReader's numDocs() or IndexWriter's docCount() method.
> Here is the problem that IndexReader.numDocs() cares about deleted
> documents, but IndexWriter.docCount() ignores it.
>
> So, I've made some modifications in IndexWriter.docCount() and added
> SegmentInfo.getDeletedDocCount() to read the number of deleted docs as
> in IndexReader. It works great in my application but I'm not sure it's
> a right way to handle this.
>
> I found that there is no dependencies using docCount() method anywhere
> in lucene trunk except several test cases. If it was a intended
> behavior, it's okay but IndexWriter should have provided a method like
> deletedNumDocs().
>
> Any comments?
>
> --
> Cheolgoo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>


-- 
Cheolgoo

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message