private Query getQuery(final StringMatch stringMatch) throws ParseException {
        // If we are going to do a regex then we'll just scan all content and do regex.
        if (MatchType.REGEX.equals(stringMatch.getMatchType())) {
            // Lucene matches on the whole line (^ & $ are not supported), so we need
            // to append .* to each end
            final String pattern = ".*" + stringMatch.getPattern() + ".*";
            final Term term = new Term(TEXT, pattern);
            try {
                if (stringMatch.isCaseSensitive()) {
                    return new RegexpQuery(term);
                } else {
                    // The 10_000 came from looking at the other overloaded ctors in RegexpQuery
                    return new RegexpQuery(
                            term,
                            RegExp.ALL,
                            RegExp.ASCII_CASE_INSENSITIVE,
                            10_000);
                }
            } catch (Exception e) {
                LOGGER.debug(() -> LogUtil.message("Error constructing regex query with pattern '{}': {}",
                        pattern, LogUtil.exceptionMessage(e)));
                throw e;
            }
        } else {
            final String nGramField = getNGramField(stringMatch);
            final SimpleQueryParser simpleQueryParser = new SimpleQueryParser(analyzer, nGramField);
            return simpleQueryParser.createPhraseQuery(nGramField, stringMatch.getPattern());
        }
    }
Re-index all indexable items on the system
stroom-index/stroom-index-lucene980/src/main/java/stroom/contentindex/LuceneContentIndex.java