costin opened a new pull request, #16742:
URL: https://github.com/apache/lucene/pull/16742

   Introduce an experimental merge policy that wraps a stock policy and adds 
merges before or after it, based on custom logic that complements the default 
selection.
   
   Issue #16701 points out that LogMergePolicy only merges a level once it has 
mergeFactor segments causing deletes can pile up in levels that never fill up. 
   #16655 proposes a different selection adjusted for vectors as merging 
delete-free segments together is preferable since it keeps the HNSW graphs 
reusable instead of reinserting vectors one by one.
   
   Changing the stock policies for either case would change merge selection for 
all existing users is disruptive. Subclassing them is teadious as it requires 
overriding findMerges and does notcompose when more than one tweak is needed.
   
   This PR proposes composition instead: ProactiveMergePolicy wraps an existing 
policy and lets a MergeSelector pick additional merges before or after it, 
while the wrapped policy keeps its behavior and configuration.
   
   DeleteRunSelector is the first such selector which merges adjacent segments 
with a high delete percentage, targeting #16701. A vector selector  (#16655) 
could follow separately.
   
   ```java
   MergePolicy policy =
       new ProactiveMergePolicy(new LogByteSizeMergePolicy())
           .setAfterMergeSelector(new DeleteRunSelector(33.0, 2048L * 1024 * 
1024));
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to