Skip to content

armgit / xerj

Public Imported from GitHub
0

AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.

Merge remote-tracking branch 'upstream/main' into feat/ism-ilm-lifecycle-engine

Vincenzo Lombardof118c25f5e8b
diff --cc engine/crates/xerj-api/src/es_compat.rs
index c3284ff76,91c93f51d..2e7864d53
--- a/engine/crates/xerj-api/src/es_compat.rs
+++ b/engine/crates/xerj-api/src/es_compat.rs
@@@ -21221,16 -21358,21 +21369,31 @@@ pub async fn put_settings
state.engine.index_settings.insert(idx.clone(), existing);
}
+ // `index.blocks.*` is not a display-only setting: it gates writes and reads
+ // in the engine, whose `Index::settings` is a different store from the
+ // `engine.index_settings` map updated above. Forward the block keys so a
+ // settings PUT can both set *and clear* a block — previously it updated only
+ // the display copy, leaving every block permanent once set.
+ for name in &targets {
+ let Ok(idx) = state.engine.get_index(name) else {
+ continue;
+ };
+ if let Err(e) = idx.apply_block_settings(&body).await {
+ return ApiError::new(xerj_common::XerjError::from(e)).into_response();
+ }
+ sync_display_blocks(&state, name).await;
+ }
+
+ // Same lazy, best-effort `index.lifecycle.name` attach as create_index —
+ // `PUT {index}/_settings {"index.lifecycle.name": "policy"}` is the
+ // other real ILM entry point (attaching to an index that already
+ // exists, not just at creation).
+ if let Some(policy_name) = ilm_policy_name_from_settings(&body) {
+ for idx in &targets {
+ let _ = crate::ism_api::attach_policy(&state, idx, &policy_name).await;
+ }
+ }
+
Json(json!({ "acknowledged": true })).into_response()
}