All Projects → rixwew → elasticsearch-approximate-nearest-neighbor

rixwew / elasticsearch-approximate-nearest-neighbor

Licence: other
Plugin to integrate approximate nearest neighbor(ANN) search with Elasticsearch

Programming Languages

java
68154 projects - #9 most used programming language
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to elasticsearch-approximate-nearest-neighbor

adventures-with-ann
All the code for a series of Medium articles on Approximate Nearest Neighbors
Stars: ✭ 40 (-24.53%)
Mutual labels:  ann, approximate-nearest-neighbor-search
pqlite
⚡ A fast embedded library for approximate nearest neighbor search
Stars: ✭ 141 (+166.04%)
Mutual labels:  approximate-nearest-neighbor-search, product-quantization
product-quantization
🙃Implementation of vector quantization algorithms, codes for Norm-Explicit Quantization: Improving Vector Quantization for Maximum Inner Product Search.
Stars: ✭ 40 (-24.53%)
Mutual labels:  approximate-nearest-neighbor-search, product-quantization
docker-curator
docker images for elasticsearch curator
Stars: ✭ 23 (-56.6%)
Mutual labels:  elasticsearch-plugin
gongt
NGT Go client library
Stars: ✭ 29 (-45.28%)
Mutual labels:  approximate-nearest-neighbor-search
Blur-and-Clear-Classification
Classifying the Blur and Clear Images
Stars: ✭ 88 (+66.04%)
Mutual labels:  ann
ntnu-som
Using Self-Organizing Maps for Travelling Salesman Problem
Stars: ✭ 31 (-41.51%)
Mutual labels:  ann
Time-Series-Forecasting
Rainfall analysis of Maharashtra - Season/Month wise forecasting. Different methods have been used. The main goal of this project is to increase the performance of forecasted results during rainy seasons.
Stars: ✭ 27 (-49.06%)
Mutual labels:  ann
annoy.rb
annoy-rb provides Ruby bindings for the Annoy (Approximate Nearest Neighbors Oh Yeah).
Stars: ✭ 23 (-56.6%)
Mutual labels:  approximate-nearest-neighbor-search
rosette-elasticsearch-plugin
Document Enrichment plugin for Elasticsearch
Stars: ✭ 25 (-52.83%)
Mutual labels:  elasticsearch-plugin
elasticsearch plugin
Nodeos plugin for archiving blockchain data into Elasticsearch.
Stars: ✭ 57 (+7.55%)
Mutual labels:  elasticsearch-plugin
lshensemble
LSH index for approximate set containment search
Stars: ✭ 48 (-9.43%)
Mutual labels:  approximate-nearest-neighbor-search
JPQ
CIKM'21: JPQ substantially improves the efficiency of Dense Retrieval with 30x compression ratio, 10x CPU speedup and 2x GPU speedup.
Stars: ✭ 39 (-26.42%)
Mutual labels:  product-quantization
cuhnsw
CUDA implementation of Hierarchical Navigable Small World Graph algorithm
Stars: ✭ 69 (+30.19%)
Mutual labels:  ann
NearestNeighborDescent.jl
Efficient approximate k-nearest neighbors graph construction and search in Julia
Stars: ✭ 34 (-35.85%)
Mutual labels:  approximate-nearest-neighbor-search
img classification deep learning
No description or website provided.
Stars: ✭ 19 (-64.15%)
Mutual labels:  ann
Spam-detection
Email Spam-detection is an ANN app with TensorFlow. The idea is simple - given an email you’ve never seen before, determine whether or not that email is Spam
Stars: ✭ 31 (-41.51%)
Mutual labels:  ann
elasticsearch-report-engine
An Elasticsearch plugin to return query results as either PDF,HTML or CSV.
Stars: ✭ 49 (-7.55%)
Mutual labels:  elasticsearch-plugin
elasticsearch-sudachi
The Japanese analysis plugin for elasticsearch
Stars: ✭ 129 (+143.4%)
Mutual labels:  elasticsearch-plugin
vector-search-plugin
Elasticsearch plugin for fast nearest neighbours of vectors (Similar use as FAISS)
Stars: ✭ 102 (+92.45%)
Mutual labels:  elasticsearch-plugin

Elasticsearch Approximate Nearest Neighbor plugin

This repository provides product quantization based approximate nearest neighbor elasticsearch plugin for searching high-dimensional dense vectors.

It can be used for various purposes with neural network frameworks (like tensorflow, pytorch, etc).
For example,

  1. Similar images search
  2. Question answering
  3. Recommendation or learning to rank

(See examples)

Product quantization implementation is based on paper "Product quantization for nearest neighbor search" - Herve Jegou, Matthijs Douze, Cordelia Schmid.

Installation

See the full list of prebuilt versions. If you don"t see a version available, see the link below for building or file a request via issues.

To install, you"d run a command such as:

./bin/elasticsearch-plugin install http://${release_zip_file}

After installation, you need to restart running Elasticsearch.

Usage

This plugin provides custom mapper type, analyzer, and search query.

Create mapping

Before you create mapping, product quantizer parameters has to be trained.
See example code.

PUT sample_images
{
  "settings": {
    "analysis": {
      "analyzer": {
        "image_analyzer": {
          "type": "ivfpq_analyzer",
          "d": 256,
          "m": 128,
          "ksub": 64,
          "coarseCentroids": "0.007750325836241245,0.0010391526157036424,...,0.031184080988168716",
          "pqCentroids": "0.00041024317033588886,0.022187601774930954,...,0.001461795181967318",
        }
      }
    }
  },
  "mappings": {
    "vector": {
      "_source": {
        "excludes": [
          "feature"
        ]
      },
      "properties": {
        "name": {
          "type": "keyword"
        },
        "feature": {
          "type": "ivfpq",
          "analyzer": "image_analyzer"
        }
      }
    }
  }
}

Index vector data

The following example adds or updates a vector data in a specific index, making it searchable.

POST sample_images/image/1
{
  "name": "1.jpg",
  "feature": "0.018046028912067413,0.0010425627697259188,...,0.0012223172234371305"
}

Search similar vectors

The ivfpq_query within the search request body could be used with other elasticsearch queries.

POST sample_images/_search
{
  "query": {
    "ivfpq_query": {
      "query": "0.02125333994626999,0.000217707478441298,...,0.001304438104853034",
      "fields": ["feature"]
    }
  },
  "sort": [
    {"_score": {"order": "asc"}}
  ]
}

Development

If you want to build for a new elasticsearch version which is not released, you could build by the following way.

1. Build with Gradle Wrapper

./gradlew build

This command generates a Elasticsearch plugin zip file.

2. Install with ./bin/elasticsearch-plugin

./bin/elasticsearch-plugin install file:///${path_to_generated_zip_file}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].