ElasticSearch 2.0以后的改动导致旧的资料和书籍需要订正的部分
2015-11-29 21:28
357 查看
id原先是可以通过path指定字段的
"thread": { "_id" : { "path" : "thread_id" }, }
但是现在不行了,具体见:
http://stackoverflow.com/questions/33428976/elasticsearch-2-0-id-is-not-configurable
https://www.elastic.co/blog/great-mapping-refactoring#meta-fields
文章指出,你需要通过url来指定id
curl -XPUT localhost:9200/your_index/your_type/YOUR_ID -d '{...}' ^ | set your id here //或者在批量操作的时候使用_id来指定 {"index":{_id:123}} {"contents":"内容"}
在Elasticsearch.The.Definitive.Guide还有对path相关介绍,在2.0已经失效。
查询脚本(groovy script)默认已经禁用了
由于用户可能通过groovy脚本进行注入,从安全角度考虑,新版本的ES已经默认禁用了groovy通过在配置文件增加下面的配置来开启
script.engine.groovy.inline.search: on
使用文件方式运行
https://www.elastic.co/blog/running-groovy-scripts-without-dynamic-scripting
由于书上没有介绍,可能导致很多人在运行demo的时候,看到类似 groovy disable的提示。
相关文章推荐
- android 之 animations 动画
- Zend Studio添加行注释和设置模板
- AjaxFileUpload.js
- ImageLodar设置圆形图片
- 【Java】基于ArrayList实现的简单登录注册
- css基础学习
- 简述C、C++程序编译的内存分配情况
- R
- 3.0 Windows和Linux双系统安装(3)
- 3.0 Windows和Linux双系统安装(3)
- c-韩信点兵
- homerHEVC代码阅读(4)——基础结构之stream_t
- hdu 2553 N皇后问题(基本dfs)
- 【C#】初识C#之 .NET Framework3.5简介
- [转]周易入门三十五问答
- LeetCode() Ugly Number II 背下来!
- 将timestamp类型转换为date类型
- 变量交换之数字交换
- jsp 颜色选择器调用
- 油菜花王国——搜索