Lucene版本
6.2.1
常用API變化重點(diǎn)關(guān)注
Java api
1 client create方式變更当凡;
2 count api removed;
3 suggest api removed;
4 groovy dependecies changed;
5 geoDistanceQueryBuilder相關(guān)變化山害;
6 highlight api有變化;
7 NodeBuilder 構(gòu)建方式變化沿量,降低使用頻率浪慌;
以上是項(xiàng)目中用到的比較多的幾個(gè)變化;
DSL Queries
1 search_type=count or scan has been removed
2 默認(rèn)的搜索超過(guò)1000個(gè)shard copies 會(huì)被 拒絕朴则,當(dāng)然了你可以 設(shè)置更大的值 通過(guò)配置:action.search.shard_count.limit
3 一個(gè)大的變化权纤,fields已經(jīng)被stored_fields替代了,stored_fields只返回stored的數(shù)據(jù)乌妒,不會(huì)再?gòu)腳source里邊獲得汹想;
4 5.0之前所有被標(biāo)注為@Deprecated的API都被刪除;
更多內(nèi)容參見(jiàn)如下:
https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_50_search_changes.html
Mapping Changes
1 string type 被 text和keyword類型替代了撤蚊,text可用于全文檢索古掏,keyword用于排序、計(jì)數(shù)侦啸、精確查找槽唾;
2 數(shù)字類型的底層存儲(chǔ)結(jié)構(gòu)改變席镀,現(xiàn)在用一個(gè)new BKD Tree的數(shù)據(jù)結(jié)構(gòu)(占用更少的空間、對(duì)范圍查詢速度更快)替代夏漱;
3 geo_point fields 底層同樣適用 new BKD Tree數(shù)據(jù)結(jié)構(gòu)豪诲;
4 floating fields 默認(rèn)用float替代了double,滿足大多數(shù)情況占用更少的空間;
5 一個(gè)索引默認(rèn)最多支持1000個(gè)字段挂绰,最多有20層嵌套屎篱,每個(gè)嵌套的對(duì)象最多有50個(gè)字段;
Setting Changes
1 Indexed Script
script.indexedhas been replaced byscript.stored
類似 script.engine.* 的替代品
2script.inlineandscript.storedsettings已經(jīng)被移除了葵蒂,你現(xiàn)在僅僅可以設(shè)置script.line: trueorscript.stored: true.
REST API Changes
1 _id的大小如果超過(guò)512 bytes交播,請(qǐng)求將被拒絕;
2 node roles 改變成:master践付、data秦士、ingest、coordinating_only ;
PACKAGING
JVM 參數(shù)從 elasticsearch.in.sh 移動(dòng)到了 jvm.options 里邊
Plugins
1 bin/plugin 被 elasticsearch-plugin 替代永高;
FileSystem Related Changes
Only a subset of index files were open withmmapon Elasticsearch 2.x. As of Elasticsearch 5.0, all index files will be open withmmapon 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的優(yōu)勢(shì)
Groovy和Painless對(duì)比
官方Breaking Changes
https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes.html