query_metadata() resolves the filter against the encrypted metadata index and returns the matching IDs. With text, it also ranks matches by BM25 relevance. It works on untrained indexes.
Parameters
- Without
order_byortext, results come back in no particular order. - Items missing the
order_byfield, or holding a non-scalar value in it, sort last.
Filter constraints
query() falls back to a post-filter over decrypted metadata when the index can’t answer a filter, for pure vector queries. query_metadata() has no fallback, so every filter must be answerable from the index. The index’s metadata_schema is therefore enforced here:
$regexand$containsneed a field created withpattern: True.- A field created with
filterable: Falsecan’t be filtered on. $typeisn’t supported.
cyborgdb.ValidationError (HTTP 400) with the reason. Nested dot-paths such as "loc.city" are supported.
Returns
List[MetadataResult]: one dict per match.
Exceptions
cyborgdb.ValidationError
cyborgdb.ValidationError
order_by is a dict with more than one key, or is neither a str nor a dict (raised before any request is sent), or the service rejects the query (HTTP 400): see Filter constraints.cyborgdb.AuthenticationError
cyborgdb.AuthenticationError
The
index_key or api_key is invalid (HTTP 401).cyborgdb.ServiceError / cyborgdb.TransportError
cyborgdb.ServiceError / cyborgdb.TransportError
The service returns
5xx or can’t be reached.