private void initQueueProcessorThread() {
        CompletableFuture
                .runAsync(() -> {
                    Thread.currentThread().setName("Content index queue monitor");
                    LOGGER.info("{} - Starting background thread to monitor change queue", RE_INDEX_JOB_NAME);
                    // This runnable is executed at the end of initIndex, so we don't
                    // have to worry about checking if the index is ready
                    try {
                        while (!Thread.currentThread().isInterrupted()) {
                            final List<EntityEvent> list = new ArrayList<>();
                            // This one will block if empty
                            list.add(changes.take());
                            // Now get everything else on the queue without blocking
                            changes.drainTo(list);
                            if (!list.isEmpty()) {
                                securityContext.asProcessingUser(() -> taskContextFactory.context(
                                        "Indexing Content Changes",
                                        TerminateHandlerFactory.NOOP_FACTORY,
                                        taskContext -> {
                                            updateIndex(list);
                                        }).run());
                            }
                        }
                    } catch (final InterruptedException e) {
                        LOGGER.error(e::getMessage, e);
                        Thread.currentThread().interrupt();
                        throw new UncheckedInterruptedException(e);
                    }
                });
    }
Creation of the content index (or re-indexing it) is triggered by a user doing a content
search. This ensures that only UI nodes create the index.
The index is also updated on a doc basis by this class handling {@link EntityEvent}s however
they will be ignored if the index is not initialised.
There is also a managed job that will trigger a full re-index
stroom-index/stroom-index-lucene980/src/main/java/stroom/contentindex/LuceneContentIndex.java