The best and simplest way to install this library is via Composer. To download and install Composer on your system please follow these instructions.

If you have already installed composer on your machine, then you can install Searcher library by typing this into your terminal:

$ composer require krzysztof-gzocha/searcher

or if you have just downloaded composer.phar to the same folder as your application:

$ php composer.phar require krzysztof-gzocha/searcher

After proper installation you should be able to find below text in your’s composer.json file:

    /** some libraries **/

    "krzysztof-gzocha/searcher": "^3.0.0"

Installation on production

Searcher library has configured .gitattributes file, so whenever you will install it via command:

$ composer install --prefer-dist

it will exclude files and folders that are not required in production environment (like docs/, tests/, etc). You can read more about this command in here and here.


Searcher has just one requirement (PHP language version >=5.4), but it has several development requirements, which can require some PHP extensions, like ext-mongo. If you do not have this extension installed on your system, but you still want to test this library without installing it you can use flag --ignore-platform-reqs to tell composer that it should not check for PHP extensions on your system. Whole installation command in this case will look like this:

$ composer require krzysztof-gzocha/searcher --ingore-platform-reqs

You can read more about composer require on composer pages.