[ https://issues.apache.org/jira/browse/LUCENE-8253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16439135#comment-16439135 ]
Simon Willnauer commented on LUCENE-8253: ----------------------------------------- thanks [~dnhatn] good catch! I have attached a patch. [~mikemccand] can you take a look. I also optimized a couple of things along the way that were necessary due to test changes. Here is my commit message: {noformat} LUCENE-8253: Account for soft-deletes before they are flushed to disk Inside the IndexWriter buffers are only written to disk if it's needed or "worth it" which doesn't guarantee soft deletes to be accounted in time. This is not necessarily a problem since they are eventually collected and segments that have soft-deletes will me merged eventually but for tests and on par behavior compared to hard deletes this behavior is tricky. This change cuts over to accouting in-place just like hard-deletes. This results in accurate delete numbers for soft deltes at any give point in time once the reader is loaded or a pending soft delte occurs. This change also fixes an issue where all updates to a DV field are allowed event if the field is unknown. Now this only works if the field is equal to the soft deletes field. This behavior was never released. {noformat} > ForceMergeDeletes does not merge soft-deleted segments > ------------------------------------------------------ > > Key: LUCENE-8253 > URL: https://issues.apache.org/jira/browse/LUCENE-8253 > Project: Lucene - Core > Issue Type: Bug > Affects Versions: 7.4, master (8.0) > Reporter: Nhat Nguyen > Priority: Major > Attachments: LUCENE-8253.patch, test-merge.patch > > > IndexWriter#forceMergeDeletes should merge segments having soft-deleted > documents as hard-deleted documents if we configured "softDeletesField" in an > IndexWriterConfig. > Attached is a failed test. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org