SearchMatch
is an interface to match text with a pattern. Match
results are in a returned value SearchMatchResult
. Match result
contains info about match positions and overall score of a match.
fzf.
FuzzyMatchV2Search
Port of fzf FuzzyMatchV2Search algorithm. Does a fast fuzzy search and is good quickly finding paths.
ExactMatchNaive
Port of fzf ExactMatchNaive algorithm. Simple exact match works more accurately if you know what to search.
Algorithms and default syntax are hidden inside package protected classes
as we don’t want to fully open these until we know API’s are good to go
for longer support. You need to construct SearchMatch
via its
build-in builder.
link:../../test/java/org/springframework/shell/docs/SearchAlgorithmsSnippets.java[role=include]
It’s possible to configure case sensitivity, on what direction search happens or if text should be normilized before search happens. Normalization is handy when different languages have sligh variation for same type of characters.
Search algorithm is selected based on a search syntax shown in below table.
Token | Match type | Description |
---|---|---|
|
fuzzy-match |
Items that match |
|
exact-match |
Items that include |