# Elasticsearch

### 8.7

* \[Transform]
  * Start API 增加 `from` 的參數。
    * 避免在 search 中使用 range query (now-1d)，會影響 search request cache。
  * 新增 `_schedule_now` API
* \[Cluster] Health API GA `_health_report`
  * 8.3 之前，endpoint 是 `_internal/_health`
  * 支援多種 indicator，並且各自擁有自己的健康狀態 (green, yellow, red, unknown)
* \[Ingest Pipeline]
  * 新增 Redact Ingest Processor
    * 從內文中，使用 Grok pattern，將敏感資料給刪除。
* \[Data Stream]
  * [TSDS(Time Series Data Stream)](https://www.elastic.co/guide/en/elasticsearch/reference/current/tsds.html) GA
  * TSDS - [Downsampling](https://www.elastic.co/guide/en/elasticsearch/reference/current/downsampling.html) GA
    * 這是在 ILM 中的其中一個 action，就像是 Rollup 一樣的功能，但是能在 ILM 中結合使用，而且能直接使用 `_search` 使用。

### 8.6

* `categorize_text` aggregation GA. (log 分析的好工具，但是要付費 license 才能用)。

### 8.5

* \[ILM]
  * no longer rolls over empty indices
  * 新的 Action: downsampling (不同於rollup)，只支援 Data Stream 的 TSDS 資料類型。
* \[Data Stream] Introduce TSDS (Time Series Data Stream) (preview)
  * sharding 時，會依時間，將時間相鄰的資料放在同個 shard，並依照時間進行 sorting.
  * 好處是 壓縮率高省儲存成本、執行效率快、能依這種資料結構提供特別的 aggs
  * 因為每個 index 存放特定的時間區段資料，所以要新增較舊的時間的資料 (會落在先前的 index)，也能支援! (但要留意 index 不能是 readonly)
* \[Transform]
  * 新增 unattended mode，
* \[Aggregation]
  * Frequent items aggregation (preview)
    * renamed to `frequent item sets` in 8.7

### 8.4

* \[ILM]
  * introduce `min_` conditions in rollover API & ILM actions
* \[Transform]
  * Infinite and adaptive retries for Transforms
* \[Search] support ANN (Approximate Nearest Neighbor) in `_search` (preview)
  * 原先是 `_knn_search` 獨立的 endpoint ，現在移到 `_search` 之中，成為 `knn` 獨立的 option。

### 8.3

* \[Mapping] `_source` 支援 synthetic 模式
  * 使用 `doc_values` 來反推，在沒有儲存 `_source` 的情況下還是能支援 reindex，儲存空間省 70%。

### 8.2

* \[Mapping]
  * 新增 `lookup` runtime field (preview)
    * 可以在查詢時動態查找另一個 index 的資料，有點像是 runtime join，要小心效能!
    * 不能在 query 與 aggregation 時使用此 lookup 欄位。
* \[Aggregatin]
  * 新增 `random_sampler` 支援亂數取樣，特別適用在昂貴的 aggregation 處理時的取樣。
* \[Authentication]
  * 新加 JWT realms support for JWT validation

### 8.1

* \[Transform]
  * 新增 `reset` API

### 8.0

#### Breaking Changes

* \[Text Analysis]
  * nGram and edgeNGram 改名
    * `ngram` 與 `edge_ngram`
* \[ILM]
  * `freeze` action 沒作用了，freeze API 也被移除。
    * 應自行將 ILM Policy 中的 freeze action 移除。
  * ILM Policy 現在一定要有配合的 snapshot repo 與 SLM policy
* \[Transform]
  * 7.4 版之前建立的 Transform，必須 upgrade (upgrade transform api)
* \[Aggregation]
  * date\_histgram aggs 的 `interval` 已移除
    * 改用 `calendar_interval` 或 `fixed_interval`
  * 不能再使用 `_id` 欄位 (來自昂貴的 fielddata) 在 aggs中
    * 真的要用，只要 docvalues 有 enable，可以 duplicate 到另個欄位 (但 auto-generated ID 不支援)
* Data Folder Changed
  * 不再支援同時存多個 node 的資料在 data folder 中，只有一份會自動 migrate，存多份要自行在 config 指定好。
* Cloud Repository Plugin 預設在 ES 裡了。 (azure, gcs, s3)
* 有些 path 中 type 完全移除了
  * `_bulk`, `_count`, `_delete_by_query`, GET `_mapping/field/<field>`, `_update`, `_update_by_query`
  * 有些常用的有保持 `_doc`
* `?local` 的參數在 `_cat` API 的 nodes, shard, indices 都移除了
* Adaptive Replica Selection 在 `_search` 與 `_get` request
  * 之前會優先使用相同 location 的 shard (w/ same awareness attribute values)
  * 8.0 後，預設 Adaptive Replica Selection (參考先前 inter-node 通訊時所使用的時間)
* transient cluster settings 棄用，以後都用 persistent cluster settings.
* ./elasticsearch-setup-password 棄用，因為會自動建立，改用 elasticsearch-reset-password
* 移除 sync\_flush，在一般 flush 時就會去計算 sync\_id
