hamming distance plugin for elasticsearch 5.x
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
releases
src
.gitignore add release Nov 23, 2017
LICENSE
README.md
elasticsearch-hamming-plugin.iml
elasticsearch-hamming.iml
pom.xml
release.sh

README.md

elasticsearch-hamming-plugin

Install

$ cd /tmp 
$ wget https://github.com/joway/elasticsearch-hamming-plugin/raw/master/releases/elasticsearch-hamming-0.0.1.zip
$ /usr/share/elasticsearch/bin/elasticsearch-plugin  install  file://`pwd`/elasticsearch-hamming-0.0.1.zip
$ echo "script.inline: true" >> /etc/elasticsearch/elasticsearch.yml && echo "script.stored: true" >> /etc/elasticsearch/elasticsearch.yml

Usage

POST /{index_name}/_search :

```json
{
  "query": {
    "function_score": {
      "query": {
        "match_all": {}
      },
      "functions": [
        {
          "script_score": {
            "script": {
              "inline": "hamming_distance_native",
              "lang": "native",
              "params": {
                "hash": "3dd3c609f30cd16c",
                "field": "phash"
              }
            }
          }
        }
      ]
    }
  }
}
```