Skip to main content

Module index_picker

Module index_picker 

Source
Expand description

Covering-index picker for the ranked query, plus the shared prefix-value encoding.

Pure functions on the document type’s index map plus the (group property, equality pins, axis, aggregate field) tuple super::mode_detection resolved. No Drive, no proof — the server and the SDK verifier both call these so they land on the same index (and therefore the same grove path) for the same request.

Functions§

encode_prefix_branches
Encode the resolved prefix pins into branches — one Vec<Vec<u8>> of prefix path segments per branch, in index-property order (the same order and encoding the write path used to key those prefix value trees). A request with only == pins yields exactly one branch; the (at most one) IN pin yields one branch per element.
find_ranked_index_for_axis
Find the index that can serve axis ranking grouped by group_by_property with the given equality pins, aggregating aggregate_field.
find_ranked_index_for_mode
find_ranked_index_for_axis driven straight from a resolved DocumentRankedMode — the shape every caller actually has.
no_covering_index_message
The “no index covers this request” rejection text, shared by the ranked and having-range resolutions (and the SDK’s mirrors of them) so a rejected request reads identically everywhere. Names the exact index the request needs: property list (pins first, in request order, then the grouping property), ranking keyword, and summable field where applicable.
resolve_ranked_query_for_mode
Resolve a validated DocumentRankedMode against a document type’s indexes into the executable DriveDocumentRankedQuery: pick the covering index, encode the prefix pins into prefix branches (one branch for all-== pins, one branch per element of the single permitted IN), and assemble the query.