There is a flaw in this approach as you exceed the threshold before flushing. With very large documents, that can cause an OOM.
This is a good point.
I agree that it would be better to do this in IndexWriter, but more machinery would be needed. Lucene would need to estimate the size of the new ram segment and check the threshold prior to consuming the space.
Agree.
The API that Yonik committed last night (thanks Yonik!) provides the flexibility to address both use cases. It's a tiny bit more work for
I agree that making flushRamSegments() public provides the flexibility. I was wondering if there is a way to do a bit more work so many apps could do less. Ning --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]