pub enum FilterTerm {
SourceType(String),
Kind(String),
CreatedAfter(i64),
Status(String),
Json(Predicate),
}Expand description
0.8.11 Slice 40 (#17) — a single closed FilterTerm of the unified
filter grammar (ADR-0.8.11-filter-grammar-unification, Option A; closes
reserved-gap 37). Exactly five variants: the four G10 shorthand metadata
fields (SourceType/Kind/CreatedAfter/Status) plus the general G4
json-path Predicate (Json). The shorthand fields are dedicated typed
variants — NOT Json(Predicate) over $.source_type etc. — precisely so the
vec0 search backend can lower them to the indexed pre-KNN metadata columns
while typed-rejecting an arbitrary Json term (D3: no demotion to post-KNN
json_extract).
The grammar stays closed (inherits ADR-0.8.0 D-F1/D-F2/D-F4/D-F5): no
DSL, no caller SQL, no JsonPathFused*, no *_unchecked, no OR/nesting
(implicit AND only); Json terms are built ONLY via the validated
Predicate::json_path_eq / Predicate::json_path_compare constructors
(path allowlist enforced at construction). The shipped ScalarValue /
ComparisonOp / Predicate vocabulary is reused verbatim — no new grammar.
Variants§
SourceType(String)
vec0 partition-key metadata column source_type (pre-KNN). On
read.list it constant-folds against resolve_source_type(kind)
(the column does not exist in canonical_nodes).
Kind(String)
kind — the vec0 metadata column (pre-KNN). On read.list it
constant-folds against the partition kind argument (D1 impl decision:
constant-fold, the simpler total option vs a redundant column clause).
CreatedAfter(i64)
created_at >= bound (unix seconds). vec0 metadata column (pre-KNN);
lowers to json_extract(body,'$.created_at') >= ? on read.list.
Status(String)
vec0 metadata column status (pre-KNN); lowers to
json_extract(body,'$.status') = ? on read.list.
Json(Predicate)
The general G4 json-path predicate (unchanged shipped grammar). Resolves
only on the read.list (canonical_nodes) backend; typed-rejected
on search_filtered because it would require a post-KNN json_extract
that defeats the indexed pre-KNN filter (D3 no-demotion guarantee).
Trait Implementations§
Source§impl Clone for FilterTerm
impl Clone for FilterTerm
Source§fn clone(&self) -> FilterTerm
fn clone(&self) -> FilterTerm
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more