diff --git a/crates/uffs-core/src/search/filters/apply.rs b/crates/uffs-core/src/search/filters/apply.rs index 28285b4bb..835dbf053 100644 --- a/crates/uffs-core/src/search/filters/apply.rs +++ b/crates/uffs-core/src/search/filters/apply.rs @@ -137,8 +137,20 @@ pub(crate) fn row_passes_filters( apply_derived_filters(row, filters) } -/// Apply extended search filters to display rows (in-place). -pub(crate) fn apply_search_filters(rows: &mut Vec, filters: &SearchFilters) { +/// Apply extended search filters to display rows (in-place) — retains +/// only the rows that pass every non-empty filter in `filters`. +/// +/// Public so a downstream crate holding its own richer row data (more +/// fields than [`DisplayRow`] carries) can still reuse this entire +/// filter engine unchanged: build a [`DisplayRow`] via its public +/// [`DisplayRow::new`] constructor from whatever subset of fields +/// overlaps, run it through this function to get every existing filter +/// axis applied verbatim, then apply any additional filters the extra +/// fields need as a separate, small pass of its own. This avoids +/// forking or reimplementing this engine for that case — see +/// `PRIVATE_RICH_INDEX_DESIGN.md` in the `uffs-products` repo for the +/// concrete motivating use case. +pub fn apply_search_filters(rows: &mut Vec, filters: &SearchFilters) { if filters.is_empty() { return; } diff --git a/crates/uffs-core/src/search/filters/mod.rs b/crates/uffs-core/src/search/filters/mod.rs index f3e20c225..286654d19 100644 --- a/crates/uffs-core/src/search/filters/mod.rs +++ b/crates/uffs-core/src/search/filters/mod.rs @@ -18,6 +18,11 @@ mod ext_match; mod path_normalize; mod time_parsing; +// `apply_search_filters` is a deliberately public re-export — see its +// own doc comment for why a downstream crate needs to call it directly. +// The `apply::*` glob below stays `pub(crate)`: everything else in +// `apply` (e.g. `row_passes_filters`) is an internal helper. +pub use apply::apply_search_filters; pub(crate) use apply::*; pub use attr_parsing::*; pub(crate) use ext_match::extract_extension_after_dot;