private ResultPage<DocContentMatch> findInContentUsingIndex(final FindInContentRequest request) {
        try {
            final StringMatch filter = request.getFilter();
            final Query query = getQuery(filter);
            final List<DocContentMatch> matches = new ArrayList<>();
            final PageRequest pageRequest = request.getPageRequest();
            final ContentHighlighter highlighter = getHighlighter(filter);

            long total = 0;
            try (final DirectoryReader directoryReader = DirectoryReader.open(directory)) {
                final IndexSearcher searcher = new IndexSearcher(directoryReader);
                final ScoreDoc[] hits = searcher.search(query, 1_000_000).scoreDocs;
                LOGGER.debug(() -> LogUtil.message("{} ({}) query '{}' matched {} documents",
                        filter.getMatchType(),
                        (filter.isCaseSensitive()
                                ? "case-sense"
                                : "case-insense"),
                        filter.getPattern(),
                        hits.length));
                final StoredFields storedFields = searcher.storedFields();
                for (final ScoreDoc hit : hits) {
                    final int docId = hit.doc;
                    final Document doc = storedFields.document(docId);
                    final DocRef docRef = new DocRef(doc.get(TYPE), doc.get(UUID), doc.get(NAME));
                    final String text = doc.get(TEXT);
                    final List<StringMatchLocation> highlights = highlighter.getHighlights(text, 1);
                    if (!highlights.isEmpty()) {
                        if (securityContext.hasDocumentPermission(docRef, DocumentPermission.VIEW)) {
                            if (total >= pageRequest.getOffset() &&
                                total < pageRequest.getOffset() + pageRequest.getLength()) {
                                try {
                                    final String extension = doc.get(EXTENSION);
                                    matches.add(DocContentMatch.create(docRef,
                                            extension,
                                            text,
                                            highlights.getFirst()));
                                } catch (final Exception e) {
                                    LOGGER.debug(e::getMessage, e);
                                }
                            }
                            total++;
                        }
                    }
                }
            }

            return new ResultPage<>(matches, PageResponse
                    .builder()
                    .offset(pageRequest.getOffset())
                    .length(matches.size())
                    .total(total)
                    .exact(total == pageRequest.getOffset() + matches.size())
                    .build());
        } catch (final ParseException e) {
            LOGGER.debug(() -> LogUtil.message(
                    "Parse error on '{}': {} (TRACE for stack trace)",
                    request.getFilter().getPattern(),
                    e.getMessage()));
            LOGGER.trace(e::getMessage, e);
            return ResultPage.empty();
        } catch (final RuntimeException | IOException e) {
            LOGGER.debug(e::getMessage, e);
            return ResultPage.empty();
        }
    }
Re-index all indexable items on the system
stroom-index/stroom-index-lucene980/src/main/java/stroom/contentindex/LuceneContentIndex.java