Skip to main content

Module query

Module query 

Source
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.rs builds these from its own hit type, so the ranker never depends on the CLI’s JSON shape.

Enums§

SortField

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_by is stable, so fully tied rows keep input order.
by_category
Hashes classified as category by model_id.
by_date
Hashes whose effective date is in [after, before).
by_location
Hashes within radius_km of a point, mapped to their distance in km.
by_person
Hashes with at least one confirmed face labelled name.
expand_date
Expands --date shorthand into a half-open [start, end) range.
normalise_bound
Normalises an --after/--before bound to full ISO-8601.
parse_sort