ElasticSearch 2.0以后的改动导致旧的资料和书籍需要订正的部分
生活随笔
收集整理的這篇文章主要介紹了
ElasticSearch 2.0以后的改动导致旧的资料和书籍需要订正的部分
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
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的提示。
轉載于:https://www.cnblogs.com/didda/p/5005619.html
總結
以上是生活随笔為你收集整理的ElasticSearch 2.0以后的改动导致旧的资料和书籍需要订正的部分的全部內容,希望文章能夠幫你解決所遇到的問題。