|Classes of AccountKiller||>||Fuse||>||README.md||>||Download|
A fuzzy search library for PHP based on the Bitap algorithm
This is a PHP port of the awesome Fuse.js project and provides 100% API compatibility.
> Latest compatible Fuse.js version: 3.6.1
For an approximate demonstration of what this library can do, check out their demo & usage.
This package is available via Composer. To add it to your project, just run:
List of properties that will be searched. This supports nested properties, weighted search, searching in arrays of strings and associative arrays etc:
The name of the identifier property. If specified, the returned result will be a list of the items' identifiers, otherwise it will be a list of the items.
Indicates whether comparisons should be case sensitive.
Whether the score should be included in the result set. A score of
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:
Whether to sort the result list, by score.
The get function to use when fetching an associative array's properties. The default will search nested paths like
The function that is used for sorting the result list.
Determines approximately where in the text is the pattern expected to be found.
At what point does the match algorithm give up. A threshold of
Determines how close the match must be to the fuzzy location (specified by
The maximum length of the search pattern. The longer the pattern, the more intensive the search operation will be. Whenever the pattern exceeds the
Will print out steps. Useful for debugging.
When true, the search algorithm will search individual words and the full string, computing the final score as a function of both. Note that when
A regular expression string used to separate words of the search pattern when searching. Only applicable when
When set to include matches, only those whose length exceeds this value will be returned. (For instance, if you want to ignore single character index returns, set to
The following methods are available on a
Searches for all the items whose keys (fuzzy) match the pattern.
Sets a new list of data for Fuse to match against.
In some cases you may want certain keys to be weighted differently for more accurate results. You may provide each key with a custom
Before submitting a pull request, please add relevant unit tests to the
Please note that I'm striving for feature parity with the original Fuse.js and therefore won't add own features beyond bug fixes.