From 6d5b79bc1feaa4bac02c7ada4b7eb28007cdfc9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Fri, 10 May 2024 12:22:13 +0200 Subject: [PATCH] Limit the number of script operations --- milli/src/update/index_documents/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/milli/src/update/index_documents/mod.rs b/milli/src/update/index_documents/mod.rs index 18cec8d7b..b9bd9e3e8 100644 --- a/milli/src/update/index_documents/mod.rs +++ b/milli/src/update/index_documents/mod.rs @@ -218,7 +218,10 @@ where output } - let engine = Engine::new(); + let mut engine = Engine::new(); + //It is an arbitrary value. We need to let users define this in the settings. + engine.set_max_operations(1_000_000); + let ast = engine.compile(code).unwrap(); let fields_ids_map = self.index.fields_ids_map(self.wtxn)?; let primary_key = self.index.primary_key(self.wtxn)?.unwrap();