Interface SearchFuzzy

All Superinterfaces:
Bson

@Evolving @Beta(CLIENT) public interface SearchFuzzy extends Bson
Fuzzy search options that may be used with some SearchOperators.
Since:
4.7
MongoDB Atlas documentation
autocomplete operator
text operator
  • Method Details

    • maxEdits

      SearchFuzzy maxEdits(int maxEdits)
      Creates a new SearchFuzzy with the maximum number of single-character edits required to match a search term.
      Parameters:
      maxEdits - The maximum number of single-character edits required to match a search term.
      Returns:
      A new SearchFuzzy.
    • prefixLength

      SearchFuzzy prefixLength(int prefixLength)
      Creates a new SearchFuzzy with the number of characters at the beginning of a search term that must exactly match.
      Parameters:
      prefixLength - The number of characters at the beginning of a search term that must exactly match.
      Returns:
      A new SearchFuzzy.
    • maxExpansions

      SearchFuzzy maxExpansions(int maxExpansions)
      Creates a new SearchFuzzy with the maximum number of variations to generate and consider to match a search term.
      Parameters:
      maxExpansions - The maximum number of variations to generate and consider to match a search term.
      Returns:
      A new SearchFuzzy.
    • of

      static SearchFuzzy of(Bson fuzzy)
      Creates a new SearchFuzzy from a Bson in situations when there is no builder method that better satisfies your needs. This method cannot be used to validate the syntax.

      Example
      The following code creates two functionally equivalent SearchFuzzy objects, though they may not be equal.

      
        SearchFuzzy fuzzy1 = SearchFuzzy.defaultSearchFuzzy().maxEdits(1);
        SearchFuzzy fuzzy2 = SearchFuzzy.of(new Document("maxEdits", 1));
       
      Parameters:
      fuzzy - A Bson representing the required SearchFuzzy.
      Returns:
      A new SearchFuzzy.
    • defaultSearchFuzzy

      static SearchFuzzy defaultSearchFuzzy()
      Returns SearchFuzzy that represents server defaults.
      Returns:
      SearchFuzzy that represents server defaults.