Menu
Platform
AI
App store purchases
Database
Flags
Jobs and cron
Localization
Monitoring
Notifications
Payments
Queues
Sandboxes
Webhooks
Getting Started
Authentication
KV Store
Deploy & Infrastructure
Reference
On this page
Querying
The query call, the three fields it takes, and what a hit carries.
A query is one call to one index, and the index decides the ranking: the hits come back best match first.
curl -X POST "https://api.data.sylphx.com/v1/search/index-id" \
-H "Authorization: Bearer $SYLPHX_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'index-id is the id segment of the index's name in the environment. The call
needs data:read, and it is served on the data host beside the documents it
reads.
#Three fields
| Field | Type | What it is |
|---|---|---|
query | string | Text to match. |
vector | double[] | An embedding to match by nearness. |
limit | uint32 | At most this many hits, 1 to 100; unset is 20. |
query is the lexical half: text, matched against the words in the documents.
vector is the other half of the same index: an embedding you supply, matched
by nearness to the embeddings written with the documents. Send one or send
both. A text query works in every index; a vector query needs an index with a
positive vector_dimensions, because there is nothing else to compare an
embedding against — and Data never invents one.
limit is a cap rather than a page: the answer is the best limit hits, and
there is no token to continue from.
#What comes back
The answer is hits, best first. A hit is the document the index stored, plus
the number it matched by:
| Field | Type | What it is |
|---|---|---|
document | DocumentRecord | The document. |
score | double | How well it matched; higher is better. |
A hit carries the whole record — document_json, vector, version,
sha256 — so a result is enough to act on without a second read, and the
order of hits is the order of score.