Force delete unused files
This commit is contained in:
parent
f023fc3b83
commit
4a0710ed9a
@ -450,6 +450,7 @@ public class LLLocalLuceneIndex implements LLLuceneIndex {
|
|||||||
indexWriter.deleteAll();
|
indexWriter.deleteAll();
|
||||||
indexWriter.forceMergeDeletes(true);
|
indexWriter.forceMergeDeletes(true);
|
||||||
indexWriter.commit();
|
indexWriter.commit();
|
||||||
|
indexWriter.deleteUnusedFiles();
|
||||||
} finally {
|
} finally {
|
||||||
shutdownLock.unlock();
|
shutdownLock.unlock();
|
||||||
}
|
}
|
||||||
@ -602,6 +603,7 @@ public class LLLocalLuceneIndex implements LLLuceneIndex {
|
|||||||
if (mergeScheduler instanceof ConcurrentMergeScheduler concurrentMergeScheduler) {
|
if (mergeScheduler instanceof ConcurrentMergeScheduler concurrentMergeScheduler) {
|
||||||
concurrentMergeScheduler.sync();
|
concurrentMergeScheduler.sync();
|
||||||
}
|
}
|
||||||
|
indexWriter.deleteUnusedFiles();
|
||||||
} finally {
|
} finally {
|
||||||
shutdownLock.unlock();
|
shutdownLock.unlock();
|
||||||
}
|
}
|
||||||
@ -653,6 +655,7 @@ public class LLLocalLuceneIndex implements LLLuceneIndex {
|
|||||||
}
|
}
|
||||||
commitTime.recordCallable(() -> {
|
commitTime.recordCallable(() -> {
|
||||||
indexWriter.commit();
|
indexWriter.commit();
|
||||||
|
indexWriter.deleteUnusedFiles();
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user