private Query modifyOccurrence(final Query query, final Occur occur) {
        // Change all occurs to must as we want to insist that all terms exist
        // in the matched documents.
        if (query instanceof final BooleanQuery bq) {
            final Builder builder = new Builder();
            for (final BooleanClause bc : bq.clauses()) {
                builder.add(bc.getQuery(), occur);
            }
            return builder.build();
        }
        return query;
    }
Convert our query objects to a LUCENE query.
stroom-search/stroom-search-solr/src/main/java/stroom/search/solr/search/SearchExpressionQueryBuilder.java