FlushPolicy
FlushPolicy controls when segments are flushed from a RAM resident internal data-structure to the IndexWriters Directory.
Segments are traditionally flushed by:
RAM consumption - configured via IndexWriterConfig.setRAMBufferSizeMB
IndexWriter consults the provided FlushPolicy to control the flushing process. The policy is informed for each added or updated document as well as for each delete term. Based on the FlushPolicy, the information provided via DocumentsWriterPerThread and DocumentsWriterFlushControl, the FlushPolicy decides if a [ ] needs flushing and mark it as flush-pending via , or if deletes need to be applied.