lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Materna, Wolf-Dietrich (empolis B)" <Wolf-Dietrich.Mate...@empolis.com>
Subject AW: query matching all documents
Date Thu, 22 May 2003 15:34:13 GMT
Hello,
> On Thu, 2003-05-22 at 11:36, Brisbart Franck wrote:
> > You're right.
> > When you delete a document, the document is marked as 
> > 'deleted'. And the 
> > documents numbers are still the same until an optimize is done.
> > 
> > So, after deleting documents, if you want to list them:
> > - either you do a loop from 0 to maxDoc() and you treat the 
> > deleted docs 
> > (with the same IndexReader)
> > - or you do an 'optimize' and with a brand new IndexReader 
> > you do your 
> > loop from 0 to numDocs() (without any deleted docs to treat).

> Guilherme Barile wrote:
> What are the performance concerns of doing an optimization after every
> delete ?
This is very slow in most cases. Imagine: lucene has to copy all documents
after the deleted one to a new segment (= partial index). All data are
stored
on hard disk, so this requires a lot of times for larger indexes.

Looping  0 to maxDoc() and use IndexReader.isDeleted(int docID) to check,
if the document is deleted, is a better solution.
Regards,
	Wolf-Dietrich

-- 
Wolf-Dietrich Materna
Development
 
empolis GmbH -  arvato knowledge management 
Kekul├ęstr. 7 
12489 Berlin, Germany
 
phone :  +49-30-6780-6510
fax :    +49-30-6780-6549
 
<<mailto:Wolf-Dietrich.Materna@empolis.com>> <<http://www.empolis.com>>

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


Mime
View raw message