question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

unknown setting [index.similarity]

See original GitHub issue

I recently upgraded to elasticsearch 5.0 and am trying to get things working on a code that worked fine with elasticsearch 2.x, I’m trying to track down the problem… The elasticsearch.js code where the error is thrown looks like this

client.indices.create({
  index: indexName,
  body: {
    settings: { 
      number_of_shards: 1,
      similarity :  "norm_bm25"
    } 
  },
  ... error stuff

Also, I’m trying to set the default index settings using

curl -XPUT 'http://localhost:9200/_template/template1' -d '{
  "template" : "*",  
  "settings.number_of_replicas" : "1",
  "settings.number_of_shards" : "1",
  "settings.similarity.default.type" : "BM25",
  "settings.similarity.default.b" : "0.0",
  "settings.similarity.default.k1" : "1.2",
  "settings.similarity.norm_bm25.type" : "BM25",
  "settings.similarity.norm_bm25.b" : "0.75",
  "settings.similarity.norm_bm25.k1" : "1.2"
}'

These values were set in the elasticsearch.yml in elasticsearch 2.x (but you can no longer do that in elasticsearch 5.0)

The error I receive is

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "unknown setting [index.similarity] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "unknown setting [index.similarity] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
  },
  "status": 400
}

Any ideas as to why this is happening? I don’t seem to be able to find the documentation about how to set similarity in an index template, or how to do it in indices.create…

Thanks for any help.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13

github_iconTop GitHub Comments

1reaction
bayologicalcommented, Dec 7, 2016
0reactions
skmc1976commented, Oct 5, 2018

I am also faceing that issue,I paste [curl -X PUT “localhost:9200/customer?pretty”] in my terminal and is ok

Read more comments on GitHub >

github_iconTop Results From Across the Web

Similarity module | Elasticsearch Guide [8.5] | Elastic
A similarity (scoring / ranking model) defines how matching documents are scored. Similarity is per field, meaning that via the mapping one can...
Read more >
Unknown Similarity type " + value + " for field " + name + "
This guide will help you check for common problems that cause the log ” Unknown Similarity type ” + value + ” for...
Read more >
Elasticsearch changing similarity does not work - Stack Overflow
Changing the similarity algorithm of my index does not work. I wan't to compare BM25 vs. TF-IDF, but i always get the same...
Read more >
API - Elastiknn
This document covers the Elastiknn API, including: indexing settings, REST API payloads, all aproximate similarity models, and some nice-to-know ...
Read more >
org.elasticsearch.index.similarity.SimilarityProviders Maven / Gradle ...
org.elasticsearch.index.similarity. ... Set; import static java.util. ... isEmpty() == false) { DEPRECATION_LOGGER.deprecated("Unknown settings for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found