I recently switched to elasticsearch 5.0 and some of the things in elasticsearch.yml from 2.x don't seem to be working. I get an error on startup that warns my to define my index parameters using curl instead of elasticsearch.yml, the suggested modifcations did not work - and I determined I should be using the index template. Anyway, my es 2.x elasticsearch.yml looks like this
index :
number_of_shards: 1
number_of_replicas: 1
similarity:
default:
type: BM25
b: 0.0
k1: 1.2
norm_bm25:
type: BM25
b: 0.75
k1: 1.2
And I've tried to use templates to replace this 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"
}'
However, I seem to be getting errors from my elasticsearch.js (now at version 12.01) when I try to create a new index with the call (this worked fine with elasticsearch 2.x)
client.indices.create({
index: indexName,
body: { settings: {
number_of_shards: 1,
similarity : "norm_bm25"
}
}. ... error stuff
The error 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}'
I'm thinking the issue is with my template, but it is installed without warning. The problem could also be in elasticsearch.js - though elasticsearch.js 11.01, for which it worked before, also fails with es 5.
Thanks for any help.
John