Elasticsearch5.0 BreakChange摘要

开源搜索引擎Elasticsearch 5.0版本正式发布 

常用API变化重点关注 Java api 

1 client create方式变更;

2 count api removed;

3 suggest api removed;

4 groovy dependecies changed;

5 geoDistanceQueryBuilder相关变化;

6 highlight api有变化;

7 NodeBuilder 构建方式变化,降低使用频率;

以上是项目中用到的比较多的几个变化;

DSL Queries

1 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 Changes

1 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 Changes

1 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 Changes

1 _id的大小如果超过512 bytes,请求将被拒绝;

2 node roles 改变成:master、data、ingest、coordinating_only ;

PACKAGING

JVM 参数从 elasticsearch.in.sh 移动到了 jvm.options 里边

Plugins

1 bin/plugin 被 elasticsearch-plugin 替代;

FileSystem Related Changes

Only 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 Change

1 The default scripting language for Elasticsearch is now Painless(https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting-painless.html)

Painless的优势

Elasticsearch5.0 BreakChange摘要

对比:

Elasticsearch5.0 BreakChange摘要

官方Breaking Changes

https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes.html

凌渡冰 目前就职于美团 Do what you like to impact the world.

 

ElasticSearch 最新版本 2.20 发布下载了 

Linux上安装部署ElasticSearch全程记录 

Elasticsearch安装使用教程

ElasticSearch 配置文件译文解析

ElasticSearch集群搭建实例 

分布式搜索ElasticSearch单机与服务器环境搭建 

ElasticSearch的工作机制   

Elasticsearch的安装,运行和基本配置

使用Elasticsearch + Logstash + Kibana搭建日志集中分析平台实践 

Ubuntu 14.04搭建ELK日志分析系统(Elasticsearch+Logstash+Kibana)

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/14757.html