From fa8b9acdf6aa932d9a5421ff4f4347f39b280a5e Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Thu, 5 Dec 2024 16:12:52 +0100 Subject: [PATCH] Ignore documents that didn't change in facets --- .../src/update/new/extract/faceted/extract_facets.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/milli/src/update/new/extract/faceted/extract_facets.rs b/crates/milli/src/update/new/extract/faceted/extract_facets.rs index f2132ce38..b865d0a35 100644 --- a/crates/milli/src/update/new/extract/faceted/extract_facets.rs +++ b/crates/milli/src/update/new/extract/faceted/extract_facets.rs @@ -97,6 +97,15 @@ impl FacetedDocidsExtractor { }, ), DocumentChange::Update(inner) => { + if !inner.has_changed_for_fields( + Some(attributes_to_extract), + rtxn, + index, + context.db_fields_ids_map, + )? { + return Ok(()); + } + extract_document_facets( attributes_to_extract, inner.current(rtxn, index, context.db_fields_ids_map)?,