Encrypted Index
Query by Metadata
POST
Query by Metadata
Find items by metadata alone — no query vector. With no
Any valid credential is accepted — the root key or a per-user
Text query — each result row is
Combined operators with a result cap:
Sorted descending by a metadata field (top_k applies after the sort):
Full-text search (index must have at least one
Regex match (field must have been created with
text, the filter is resolved entirely against the encrypted metadata index and the matching items are returned unscored. With text, a BM25 full-text search runs over the index’s full_text fields and the top matches are returned ranked by score; a filter given alongside restricts which items are scored. Works on untrained indexes. To add a vector leg on top of either form, use /v1/vectors/query — see Combining search legs.
Authentication
Required - API key viaX-API-Key header:
cdbk_ token. When RBAC is not enabled (CYBORGDB_SERVICE_ROOT_KEY unset), no header is required.
Request Body
Filter constraints
Unlike/v1/vectors/query, which falls back to a post-filter over the decrypted metadata when a filter cannot be answered from the index, /v1/vectors/query_metadata has no fallback stage — every filter leaf must be resolvable from the encrypted metadata index. That makes the index’s metadata_schema enforcement instead of a performance hint:
$regex/$containsrequire the field to have been declaredpattern: trueat index create time.- A field declared
filterable: falsecannot be filtered on here at all. $typeis not supported on this endpoint.
/v1/vectors/query with a vector for filters that need the post-filter path. Nested dot-paths (loc.city) are supported.
Supported operators: $and, $or, $nor, $not, $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $exists, $regex (pattern fields only), $contains (pattern fields only).
Response
Filter-only query — each result row is{"id"} (there is nothing to score):
{"id", "score"} in descending BM25 score order:
Exceptions
400 Bad Request
400 Bad Request
Filter references a field the metadata index cannot resolve — a
$regex/$contains on a non-pattern field, a filterable: false field, or an unsupported operator. Also raised for text-parameter violations: text on an index with no full_text field, a text_fields entry that is not a full_text field, a text knob (text_fields / text_field_weights / require_all_terms) without text, or order_by combined with text404 Not Found
404 Not Found
Index not found
422 Unprocessable Entity
422 Unprocessable Entity
Invalid request parameters
500 Internal Server Error
500 Internal Server Error
Internal server error
Example Usage
Filter only (all matches, unordered):full_text field; results ranked by BM25 score):
pattern: true):