Skip to content
Specifies advanced fingerprint analyzer for Elasticsearch index
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Fingerprint Elasticsearch

This is a package that prepares Elasticsearch analyzers, filters and tokenizers to work with custom implementation of fingerprint algorithm. It is basically an improved version of fingerprint - official Elasticsearch documentation The difference is that custom analyzer that is created includes synonyms filter making the final combination something like this:

  • lowercase
  • asciifolding
  • fp_X_syn (synonyms for specific type X)
  • fp_X_rem (removals for specific type X)
  • fingerprint

Available types are City, Company, Street and Title. That means, whenever you need to store cities, companies, street addresses or titles you likely need this analyzer that will help you sort them out. Otherwise, you'll end up with messy data.

Use cases

  • Having complete Elasticsearch fingerprint analyzer
  • Combined with fingerprint makes creation and testing fingerprint easier.


City analyzer/filter/property can be get like this:

        $ESCity = new ESCity();

        $analyzer = $ESCity->analyzerES();
        $filter = $ESCity->filterES();
        $prop = $ESCity->propES();

That creates analyzer with specific filters:

   'fp_city_analyzer' => [
       'type'      => 'custom',
       'tokenizer' => 'standard',
       'filter'    => [

It is using same synonyms and removals from depending project.

And specific city property:

   'type'         => 'keyword',
   'ignore_above' => 256,
   'fields'       => [
       'fp' => [
           'type'     => 'text',
           'analyzer' => 'fp_city_analyzer',

Please look at tests for more examples.

System Requirements

You need PHP >= 5.4.0. Even though there's no Elasticsearch dependency, fingerprint token filter is available from Elasticsearch version 5.0 Depending on fingerprint for synonyms/removals.


Install fingerprint-elasticsearch using Composer.

$ composer require vladan-me/fingerprint-elasticsearch

Additional Notes

This package contains additional analyzers (punctuation removal, 2gram and 3gram with punctuation) that might be useful depending on use case, but likely should be optional.


Contributions are welcome and will be fully credited. Please see CONTRIBUTING and CONDUCT for details.


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

You can’t perform that action at this time.