public final class

KeepOnlyLastCommitDeletionPolicy

extends Object
implements IndexDeletionPolicy
java.lang.Object
   ↳ org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy

Class Overview

This IndexDeletionPolicy implementation that keeps only the most recent commit and immediately removes all prior commits after a new commit is done. This is the default deletion policy.

Summary

Public Constructors
KeepOnlyLastCommitDeletionPolicy()
Public Methods
void onCommit(List<? extends IndexCommit> commits)
Deletes all commits except the most recent one.
void onInit(List<? extends IndexCommit> commits)
Deletes all commits except the most recent one.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.lucene.index.IndexDeletionPolicy

Public Constructors

public KeepOnlyLastCommitDeletionPolicy ()

Public Methods

public void onCommit (List<? extends IndexCommit> commits)

Deletes all commits except the most recent one.

Parameters
commits List of IndexCommit, sorted by age (the 0th one is the oldest commit).

public void onInit (List<? extends IndexCommit> commits)

Deletes all commits except the most recent one.

Parameters
commits List of current point-in-time commits, sorted by age (the 0th one is the oldest commit).