driver-core/src/main/com/mongodb/client/model/Filters.java
public static Bson text(final String search, final TextSearchOptions textSearchOptions) {
        notNull("search", search);
        notNull("textSearchOptions", textSearchOptions);
        return new TextFilter(search, textSearchOptions);
    }
public static Bson text(final String search, final TextSearchOptions textSearchOptions) {
        notNull("search", search);
        notNull("textSearchOptions", textSearchOptions);
        return new TextFilter(search, textSearchOptions);
    }
Creates a filter that matches all documents matching the given the search term with the given text search options.

@param search            the search term
@param textSearchOptions the text search options to use
@return the filter
@mongodb.driver.manual reference/operator/query/text $text
@since 3.2