1 client create方式变更;
2 count api removed;
3 suggest api removed;
4 groovy dependecies changed;
5 geoDistanceQueryBuilder相关变化;
6 highlight api有变化;
7 NodeBuilder 构建方式变化,降低使用频率;
以上是项目中用到的比较多的几个变化;
DSL Queries1 search_type=count or scan has been removed
2 默认的搜索超过1000个shard copies 会被 拒绝,当然了你可以 设置更大的值 通过配置:action.search.shard_count.limit
3 一个大的变化,fields已经被stored_fields替代了,stored_fields只返回stored的数据,不会再从_source里边获得;
4 5.0之前所有被标注为@Deprecated的API都被删除;
更多内容参见 :https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_50_search_changes.html
Mapping Changes1 string type 被 text和keyword类型替代了,text可用于全文检索,keyword用于排序、计数、精确查找;
2 数字类型的底层存储结构改变,现在用一个new BKD Tree的数据结构(占用更少的空间、对范围查询速度更快)替代;
3 geo_point fields 底层同样适用 new BKD Tree数据结构;
4 floating fields 默认用float替代了double,满足大多数情况占用更少的空间;
5 一个索引默认最多支持1000个字段,最多有20层嵌套,每个嵌套的对象最多有50个字段;
Setting Changes1 Indexed Script
script.indexed has been replaced by script.stored
类似 script.engine.* 的替代品
2 script.inline and script.stored settings已经被移除了,你现在仅仅可以设置script.line: true or script.stored: true.
REST API Changes1 _id的大小如果超过512 bytes,请求将被拒绝;
2 node roles 改变成:master、data、ingest、coordinating_only ;
PACKAGINGJVM 参数从 elasticsearch.in.sh 移动到了 jvm.options 里边
Plugins1 bin/plugin 被 elasticsearch-plugin 替代;
FileSystem Related ChangesOnly a subset of index files were open with mmap on Elasticsearch 2.x. As of Elasticsearch 5.0, all index files will be open with mmap on 64-bit systems.
While this may increase the amount of virtual memory used by Elasticsearch.
there is nothing to worry about since this is only address space consumption and the actual memory usage of Elasticsearch will stay similar to what it was in 2.x.
Scripts Change1 The default scripting language for Elasticsearch is now Painless(https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting-painless.html)
Painless的优势
对比:
官方Breaking Changeshttps://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes.html
凌渡冰 目前就职于美团 Do what you like to impact the world.
使用Elasticsearch + Logstash + Kibana搭建日志集中分析平台实践
Ubuntu 14.04搭建ELK日志分析系统(Elasticsearch+Logstash+Kibana)