How to implement elasticsearch affinity plugin?

I need to override the default Lucene affinity class, which is used by Elasticsearch for indexing and searching. When searching for a network, I found several similar implementations that do similar things. My difficulty is that I do not know how to actually implement this in my code. I found several resources:

https://github.com/tlrx/elasticsearch-custom-similarity-provider

curl -XPOST 'http://host:port/tweeter/' -d '
{
  "settings": {
    "similarity": {
      "index": {
        "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
      },
      "search": {
        "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
      }
    }
  }
}'

I cannot figure out how I can use this line directly during indexing so that my default semblance changes to this usual similarity.

org.elasticsearch.index.similarity.CustomSimilarityProvider

- , ? , . ?

.

+4

All Articles