pub struct Filter {
pub terms: Vec<FilterTerm>,
}Expand description
0.8.11 Slice 40 (#17) — the unified closed Filter contract. ONE superset
type with implicit-AND FilterTerms, dispatched to one of two internal
compilation backends (Option A — the TYPE unifies, the COMPILATION
dispatches): the vec0-metadata indexed pre-KNN WHERE for search_filtered,
and json_extract over canonical_nodes.body for read.list. The shipped
SearchFilter (G10) and Predicate lists (G4) re-express as sugar that
lowers into this type (D4); the filter=None byte-identical-0.7.2-SQL pin is
preserved because the vec0 lowering routes back through the shipped
vector_filter_clause compilation verbatim.
Fields§
§terms: Vec<FilterTerm>AND-combined terms (implicit AND, inherits D-F5). Empty = unfiltered.
Implementations§
Source§impl Filter
impl Filter
Sourcepub fn to_search_filter(&self) -> Result<SearchFilter, EngineError>
pub fn to_search_filter(&self) -> Result<SearchFilter, EngineError>
Backend dispatch for search_filtered (vec0 — indexed pre-KNN). Lowers
the metadata subset {SourceType, Kind, CreatedAfter, Status} back into a
SearchFilter (which the shipped vector_filter_clause compiles to the
pre-KNN WHERE), and typed-rejects a FilterTerm::Json term with
EngineError::InvalidFilter — the explicit no-demotion guarantee (D3).
Field-by-variant assignment makes the output canonical-order-independent
of terms ordering (hand-built router filters included). A later
duplicate metadata term overwrites the earlier (last-wins).
Trait Implementations§
Source§impl From<&SearchFilter> for Filter
impl From<&SearchFilter> for Filter
Source§fn from(sf: &SearchFilter) -> Self
fn from(sf: &SearchFilter) -> Self
D4 sugar lowering — the shipped G10 SearchFilter re-expressed as the
unified Filter. Field → term in the canonical order
(source_type, kind, created_after, status) so the round-trip back
to a SearchFilter (and thus the produced vec0 SQL) is byte-identical.