diff --git a/README.md b/README.md index cdf2a76..2092971 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,12 @@ Check out their [demo](https://fusejs.io/demo.html) and [examples](https://fusej **Table of Contents:** -- [Installation](#installation) -- [Usage](#usage) -- [Options](#options) -- [Methods](#methods) -- [Differences with Fuse.js](#differences-with-fusejs) -- [Development](#development) +- [Installation](#installation) +- [Usage](#usage) +- [Options](#options) +- [Methods](#methods) +- [Differences with Fuse.js](#differences-with-fusejs) +- [Development](#development) --- @@ -107,8 +107,8 @@ Fuse has a lot of options to refine your search: #### `isCaseSensitive` -- Type: `bool` -- Default: `false` +- Type: `bool` +- Default: `false` Indicates whether comparisons should be case sensitive. @@ -125,8 +125,8 @@ Indicates whether comparisons should ignore diacritics (accents). #### `includeScore` -- Type: `bool` -- Default: `false` +- Type: `bool` +- Default: `false` Whether the score should be included in the result set. A score of `0` indicates a perfect match, while a score of `1` indicates a complete mismatch. @@ -134,8 +134,8 @@ Whether the score should be included in the result set. A score of `0` indicates #### `includeMatches` -- Type: `bool` -- Default: `false` +- Type: `bool` +- Default: `false` Whether the matches should be included in the result set. When `true`, each record in the result set will include the indices of the matched characters. These can consequently be used for highlighting purposes. @@ -143,8 +143,8 @@ Whether the matches should be included in the result set. When `true`, each reco #### `minMatchCharLength` -- Type: `int` -- Default: `1` +- Type: `int` +- Default: `1` Only the matches whose length exceeds this value will be returned. (For instance, if you want to ignore single character matches in the result, set it to `2`). @@ -152,8 +152,8 @@ Only the matches whose length exceeds this value will be returned. (For instance #### `shouldSort` -- Type: `bool` -- Default: `true` +- Type: `bool` +- Default: `true` Whether to sort the result list, by score. @@ -161,8 +161,8 @@ Whether to sort the result list, by score. #### `findAllMatches` -- Type: `bool` -- Default: `false` +- Type: `bool` +- Default: `false` When true, the matching function will continue to the end of a search pattern even if a perfect match has already been located in the string. @@ -170,8 +170,8 @@ When true, the matching function will continue to the end of a search pattern ev #### `keys` -- Type: `array` -- Default: `[]` +- Type: `array` +- Default: `[]` List of keys that will be searched. This supports nested paths, weighted search, searching in arrays of [strings](https://fusejs.io/examples.html#search-string-array) and [objects](https://fusejs.io/examples.html#nested-search). @@ -181,8 +181,8 @@ List of keys that will be searched. This supports nested paths, weighted search, #### `location` -- Type: `int` -- Default: `0` +- Type: `int` +- Default: `0` Determines approximately where in the text is the pattern expected to be found. @@ -190,8 +190,8 @@ Determines approximately where in the text is the pattern expected to be found. #### `threshold` -- Type: `float` -- Default: `0.6` +- Type: `float` +- Default: `0.6` At what point does the match algorithm give up. A threshold of `0.0` requires a perfect match (of both letters and location), a threshold of `1.0` would match anything. @@ -199,8 +199,8 @@ At what point does the match algorithm give up. A threshold of `0.0` requires a #### `distance` -- Type: `int` -- Default: `100` +- Type: `int` +- Default: `100` Determines how close the match must be to the fuzzy location (specified by `location`). An exact letter match which is `distance` characters away from the fuzzy location would score as a complete mismatch. A `distance` of `0` requires the match be at the exact `location` specified. A distance of `1000` would require a perfect match to be within `800` characters of the `location` to be found using a `threshold` of `0.8`. @@ -208,8 +208,8 @@ Determines how close the match must be to the fuzzy location (specified by `loca #### `ignoreLocation` -- Type: `bool` -- Default: `false` +- Type: `bool` +- Default: `false` When `true`, search will ignore `location` and `distance`, so it won't matter where in the string the pattern appears. @@ -223,8 +223,8 @@ When `true`, search will ignore `location` and `distance`, so it won't matter wh #### `useExtendedSearch` -- Type: `bool` -- Default: `false` +- Type: `bool` +- Default: `false` When `true`, it enables the use of unix-like search commands. See [example](https://fusejs.io/examples.html#extended-search). @@ -232,8 +232,8 @@ When `true`, it enables the use of unix-like search commands. See [example](http #### `getFn` -- Type: `callable` -- Default: [source](src/Helpers/get.php) +- Type: `callable` +- Default: [source](src/Helpers/get.php) The function to use to retrieve an object's value at the provided path. The default will also search nested paths. @@ -241,8 +241,8 @@ The function to use to retrieve an object's value at the provided path. The defa #### `sortFn` -- Type: `callable` -- Default: [source](src/Helpers/sort.php) +- Type: `callable` +- Default: [source](src/Helpers/sort.php) The function to use to sort all the results. The default will sort by ascending relevance score, ascending index. @@ -250,8 +250,8 @@ The function to use to sort all the results. The default will sort by ascending #### `ignoreFieldNorm` -- Type: `bool` -- Default: `false` +- Type: `bool` +- Default: `false` When `true`, the calculation for the relevance score (used for sorting) will ignore the [field-length norm](https://fusejs.io/concepts/scoring-theory.html#fuzziness-score). @@ -261,8 +261,8 @@ When `true`, the calculation for the relevance score (used for sorting) will ign ### `fieldNormWeight` -- Type: `float` -- Default: `1` +- Type: `float` +- Default: `1` Determines how much the [field-length norm](https://fusejs.io/concepts/scoring-theory.html#field-length-norm) affects scoring. A value of `0` is equivalent to ignoring the field-length norm. A value of `0.5` will greatly reduce the effect of field-length norm, while a value of `2.0` will greatly increase it. @@ -302,14 +302,14 @@ public function search(mixed $pattern, ?array $options): array The `$pattern` can be one of: -- [String](https://fusejs.io/examples.html#search-string-array) -- [Path](https://fusejs.io/examples.html#nested-search) -- [Extended query](https://fusejs.io/examples.html#extended-search) -- [Logical query](https://fusejs.io/api/query.html) +- [String](https://fusejs.io/examples.html#search-string-array) +- [Path](https://fusejs.io/examples.html#nested-search) +- [Extended query](https://fusejs.io/examples.html#extended-search) +- [Logical query](https://fusejs.io/api/query.html) The `$options`: -- `limit` (type: `int`): Denotes the max number of returned search results. +- `limit` (type: `int`): Denotes the max number of returned search results. ---