If you have nothing open already, and all you want to do is delete
certain documents and make a commit point, then using IndexReader vs
IndexWriter should show very little difference in speed.
But if you have mixed adds/deletes, especially a batch of them where
you don't need any commit points until the end, doing everything with
a single IndexWriter is faster because IndexWriter will buffer up a
bunch of deletes before applying them.
That said, I'd really like to deprecate IndexReader.deleteDocuments,
eventually. I prefer that there be one obvious way to do things (I
copied this from Python, btw).
As of 2.4, IndexWriter now provides delete-by-Query, which I think
ought to meet nearly all of the cases where someone wants to
delete-by-docID using IndexReader.
Or are there situations out there where delete-by-docID is still
compelling?
Mike
Antony Bowesman wrote:
In 2.4, as well as IndexWriter.deleteDocuments(Term) there is also
IndexReader.deleteDocuments(Term).
I understand opening a reader is expensive, so does this means using
IndexWriter.deleteDocuments would be faster from a closed index
position?
As the IndexReader instance is newer, it has better Javadocs, so
it's unclear which is the 'right' one to use.
Any pointers?
Antony
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]