Download the PHP package tomtruyen/fuzzyness without Composer

On this page you can find all versions of the php package tomtruyen/fuzzyness. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package fuzzyness

Fuzzyness

This package is based on "Quest" by mattkingshott

What is different?

About the package

This package enables pseudo fuzzy-searching within Laravel database and Eloquent queries. Due to its pattern matching methods, it only supports MySQL or MariaDB, though I welcome any PRs to enable support for databases like Postgres.

Much of this library is based on the fantastic work of Tom Lingham for the now abandoned Laravel Searchy package. If you're interested in the background of how the fuzzy searching works, check out the readme for that project.

Installation

Pull in the package using composer

Usage

Fuzzyness automatically registers a service provider containing several macros. These macros are then attached to the underlying Illuminate\Database\Query\Builder class.

Filtering results

You can perform a fuzzy-search by calling the whereFuzzy method. This method takes three parameters. The first, is the field name. The second, is the value to use for the search e.g., the third is "extended" (default: false). Extended uses all prebuild Matchers but is slower than the non-extended version, but for more specific or accurate results it is advised to set this to

You can also perform a fuzzy search across multiple columns by chaining several whereFuzzy method calls:

You can also choose to pass your own list of "Matchers" for if you want to use a custom matcher or a custom list of existing matchers.

Note: You must also pass the score for when a field matches with the matcher

List of preset matchers with scores

Ordering results

When using Fuzzyness, a 'relevance_*' column will be included in your search results. The * is a wildcard that will be replaced with the name of the field that you are searching on e.g.

This column contains the score that the record received after each of the fuzzy-searching pattern matchers were applied to it. The higher the score, the more closely the record matches the search term.

Of course, you'll want to order the results so that the records with the highest score appear first. To make this easier, Fuzzyness includes an orderByFuzzy helper method that wraps the relevant orderBy clauses:

If you are searching across multiple fields, you can provide an array to the orderByFuzzy method:

Limitations

It is not possible to use the paginate method with Fuzzyness as the relevance fields are omitted from the secondary query that Laravel runs to get the count of the records required for LengthAwarePaginator. However, you can use the simplePaginate method without issue or a combination of skip and take. In many cases this a more preferable option anyway, particularly when dealing with large datasets as the paginate method becomes slow when scrolling through large numbers of pages.

Contributing

Thank you for considering a contribution to Fuzzyness. You are welcome to submit a PR containing improvements, however if they are substantial in nature, please also be sure to include a test or tests.

Support the project

If you'd like to support the development of Fuzzyness, then please consider sponsoring me. Thanks so much!

License

The MIT License (MIT). Please see License File for more information.


All versions of fuzzyness with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tomtruyen/fuzzyness contains the following files

Loading the files please wait ....