Interface FuzzySearchOptions

All Superinterfaces:
Bson

@Sealed @Beta(CLIENT) public interface FuzzySearchOptions 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

      FuzzySearchOptions maxEdits(int maxEdits)
      Creates a new FuzzySearchOptions 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 FuzzySearchOptions.
    • prefixLength

      FuzzySearchOptions prefixLength(int prefixLength)
      Creates a new FuzzySearchOptions 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 FuzzySearchOptions.
    • maxExpansions

      FuzzySearchOptions maxExpansions(int maxExpansions)
      Creates a new FuzzySearchOptions 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 FuzzySearchOptions.
    • option

      FuzzySearchOptions option(String name, Object value)
      Creates a new FuzzySearchOptions with the specified option 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 FuzzySearchOptions objects, though they may not be equal.

      
        FuzzySearchOptions options1 = FuzzySearchOptions.fuzzySearchOptions().maxEdits(1);
        FuzzySearchOptions options2 = FuzzySearchOptions.fuzzySearchOptions().option("maxEdits", 1);
       
      Parameters:
      name - The option name.
      value - The option value.
      Returns:
      A new FuzzySearchOptions.
    • fuzzySearchOptions

      static FuzzySearchOptions fuzzySearchOptions()
      Returns FuzzySearchOptions that represents server defaults.
      Returns:
      FuzzySearchOptions that represents server defaults.