private Query getDictionary(final String fieldName, final DocRef docRef,
                                final IndexField indexField, final Set<String> terms) {
        final String[] wordArr = loadWords(docRef);
        final Builder builder = new Builder();
        for (final String val : wordArr) {
            Query query;

            if (indexField.getFldType().isNumeric()) {
                query = getNumericIn(fieldName, val);
            } else if (FieldType.DATE.equals(indexField.getFldType())) {
                query = getDateIn(fieldName, val);
            } else {
                query = getSubQuery(indexField, val, terms, false);
            }

            if (query != null) {
                // DictionaryDocument terms on one line must all exist in the
                // matching documents so change to must.
                query = modifyOccurrence(query, Occur.MUST);
                builder.add(query, Occur.SHOULD);
            }
        }
        return builder.build();
    }
Convert our query objects to a LUCENE query.
stroom-search/stroom-search-solr/src/main/java/stroom/search/solr/search/SearchExpressionQueryBuilder.java