@NotNull
    private static Predicate<String> createCharsAnywherePredicate(final String userInput) {
        LOGGER.trace("Creating chars appear anywhere in correct order predicate");
        // All lower case so match on each char appearing somewhere in the text
        // in the correct order
        final String lowerCaseInput = userInput.toLowerCase();
        final Pattern pattern = buildCharsAnywherePattern(lowerCaseInput);
        LOGGER.trace("Using case insensitive pattern: {}", pattern);
        return toNullSafePredicate(false, pattern.asPredicate());
    }
For a given user input this method will return a function that can evaluate a string to see how
good the match is. The quality of the match is determined by the length of the matched region
(shorter == better) and its distance from the start of the string (closer == better).
stroom-query/stroom-query-common/src/main/java/stroom/query/common/v2/StringPredicateFactory.java