Expand description
Composable search predicates.
Each predicate independently resolves to a set of content hashes;
candidates intersects them. Keeping them here rather than in
person_search/classify/geocode means the intersection logic lives in
one testable place and those modules keep their existing callers unchanged.
Both search surfaces consume this module: commands::search (the CLI) and
commands::mcp (over the QueryEmbedder trait) call the same predicates, so
a composed CLI query and the equivalent MCP tool call cannot drift.
Structs§
- Candidates
- The rows a selection narrowed to, plus their distances when a place was given.
- GeoFilter
- SortKey
- Sortable
- The fields a sort can key on.
commands/search.rsbuilds these from its own hit type, so the ranker never depends on the CLI’s JSON shape.
Enums§
Constants§
- EFFECTIVE_
DATE_ SQL - The date a file is considered to have: its EXIF capture date when that is present and valid, otherwise the filesystem modification time.
Functions§
- apply_
sort - Sorts in place.
sort_byis stable, so fully tied rows keep input order. - by_
category - Hashes classified as
categorybymodel_id. - by_date
- Hashes whose effective date is in
[after, before). - by_
location - Hashes within
radius_kmof a point, mapped to their distance in km. - by_
person - Hashes with at least one confirmed face labelled
name. - expand_
date - Expands
--dateshorthand into a half-open[start, end)range. - normalise_
bound - Normalises an
--after/--beforebound to full ISO-8601. - parse_
sort