Package com.mongodb.client.model.search
Interface SearchFuzzy
- All Superinterfaces:
Bson
Fuzzy search options that may be used with some
SearchOperator
s.- Since:
- 4.7
- MongoDB Atlas documentation
- autocomplete operator
- text operator
-
Field Summary
Fields inherited from interface org.bson.conversions.Bson
DEFAULT_CODEC_REGISTRY
-
Method Summary
Modifier and TypeMethodDescriptionstatic SearchFuzzy
ReturnsSearchFuzzy
that represents server defaults.maxEdits
(int maxEdits) Creates a newSearchFuzzy
with the maximum number of single-character edits required to match a search term.maxExpansions
(int maxExpansions) Creates a newSearchFuzzy
with the maximum number of variations to generate and consider to match a search term.static SearchFuzzy
Creates a newSearchFuzzy
from aBson
in situations when there is no builder method that better satisfies your needs.prefixLength
(int prefixLength) Creates a newSearchFuzzy
with the number of characters at the beginning of a search term that must exactly match.Methods inherited from interface org.bson.conversions.Bson
toBsonDocument, toBsonDocument
-
Method Details
-
maxEdits
Creates a newSearchFuzzy
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
Creates a newSearchFuzzy
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
Creates a newSearchFuzzy
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
Creates a newSearchFuzzy
from aBson
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 equivalentSearchFuzzy
objects, though they may not be equal.SearchFuzzy fuzzy1 = SearchFuzzy.defaultSearchFuzzy().maxEdits(1); SearchFuzzy fuzzy2 = SearchFuzzy.of(new Document("maxEdits", 1));
- Parameters:
fuzzy
- ABson
representing the requiredSearchFuzzy
.- Returns:
- A new
SearchFuzzy
.
-
defaultSearchFuzzy
ReturnsSearchFuzzy
that represents server defaults.- Returns:
SearchFuzzy
that represents server defaults.
-