Elasticsearch5.0 BreakChange摘要


Lucene版本

6.2.1

 

常用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.* 的替代品
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的優勢

對比:

官方Breaking Changes

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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM