2019独角兽企业重金招聘Python工程师标准>>>
问题
elasticsearch从2.4升级到5.6,elasticsearch.yml配置中有一些analyzer配置拷贝到新版本,启动报错
index :analysis :analyzer :lowercase_whitespace :type : customtokenizer : myTokenizer1filter : [myTokenFilter1]tokenizer :myTokenizer1 :type : whitespacefilter :myTokenFilter1 :type : lowercase
报错信息
node settings must not contain any index level settings
解决方法:
es 5.6开始声明全局analyzer可以在template中声明,然后在index引用
put /_template/template_1
{"template": "*","settings": {"number_of_shards": 3,"analysis": {"analyzer": {"lowercase_whitespace": {"type": "custom","tokenizer": "whitespace","filter": ["lowercase"]}}}}
}
然后就可以正常引用analyzer了。