https://github.com/joway/elasticsearch-hamming-plugin
hamming distance plugin for elasticsearch 5.x
https://github.com/joway/elasticsearch-hamming-plugin
Last synced: 10 months ago
JSON representation
hamming distance plugin for elasticsearch 5.x
- Host: GitHub
- URL: https://github.com/joway/elasticsearch-hamming-plugin
- Owner: joway
- License: apache-2.0
- Created: 2017-11-23T05:45:31.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-11-27T03:04:34.000Z (over 6 years ago)
- Last Synced: 2025-05-31T07:05:02.969Z (about 1 year ago)
- Language: Java
- Size: 22.5 KB
- Stars: 32
- Watchers: 3
- Forks: 9
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Elasticsearch Hamming Plugin
## Install
```shell
$ 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"
}
}
}
}
]
}
}
}
```