private synchronized void updateIndex(final List<EntityEvent> list, final TaskContext taskContext) {
        final IndexWriterConfig indexWriterConfig = new IndexWriterConfig(analyzer);
        try (final IndexWriter writer = new IndexWriter(directory, indexWriterConfig)) {
            updateProgress.set(0);
            updateTotal.set(list.size());
            list.stream()
                    .takeWhile(createTaskTerminatedCheck(taskContext))
                    .forEach(event -> {
                        updateDocInIndex(taskContext, event, writer);
                    });

            taskContext.info(() -> LogUtil.message("Committing {} changes to the content index", list.size()));
            LOGGER.logDurationIfDebugEnabled(
                    ThrowingRunnable.unchecked(writer::commit),
                    () -> LogUtil.message("Commit {} event(s)", updateProgress));

            taskContext.info(() -> LogUtil.message("Flushing {} changes to the content index", list.size()));
            LOGGER.logDurationIfDebugEnabled(
                    ThrowingRunnable.unchecked(writer::flush),
                    () -> LogUtil.message("Flush {} event(s)", updateProgress));
        } catch (final Exception e) {
            LOGGER.error(e::getMessage, e);
        }
    }
Re-index all indexable items on the system
stroom-index/stroom-index-lucene980/src/main/java/stroom/contentindex/LuceneContentIndex.java