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
Query in Search
Searches an index by text, by vector, or both, best match first, with filters and paging.
Searches an index by text, by vector, or both, best match first, with filters and paging.
- Path
POST https://api.data.sylphx.com/v1/search/index-id - Scope
data:read - Effect
read— nothing is written. - Collection search
- Host
https://api.data.sylphx.com
#Request
| Field | Type | What it is |
|---|---|---|
index_id | string | The search index's id. Required. |
query | string | Text to match, in web-search syntax: words (all must match), "quoted phrases", or, and -word to exclude. The last word also matches as a word prefix unless prefix is false. |
vector | double[] | An embedding to match by cosine similarity; its length is the index's vector dimensions. |
limit | uint32 | At most this many hits, 1 to 100; unset is 20. |
offset | uint32 | Hits to skip; offset + limit is at most 1000. |
filters | SearchFilter[] | Conditions every hit meets, at most 16. |
vector_weight | double | The vector list's share of a hybrid score, 0 to 1; unset is 0.5. |
prefix | bool | Whether the query's last word also matches as a word prefix; unset is true. |
#SearchFilter
| Field | Type | What it is |
|---|---|---|
field | string | A dot path of object keys, for example price.amount; at most 8 keys. Required. |
op | string | eq, ne, in, gt, gte, lt, lte, or exists. eq and in also match an array field that holds the value; ne matches documents without the field. Required. |
value_json | string | The value as JSON: a string, number, or boolean; for in, an array of 1 to 100 of them; for the ranges, a number or string; for exists, empty. |
#Response
| Field | Type | What it is |
|---|---|---|
hits | SearchHit[] | The hits, best first. |
#SearchHit
| Field | Type | What it is |
|---|---|---|
document | DocumentRecord | The document. |
score | double | How well it matched; higher is better. The text rank, the cosine similarity, or the fused rank; 0 when listing. |
text_score | double | The full-text rank, when the document matched the text. |
vector_score | double | The cosine similarity, when the document was in the vector list. |
#DocumentRecord
| Field | Type | What it is |
|---|---|---|
index_id | string | The search index's id in the environment, for example articles. |
document_id | string | The document's id. |
document_json | bytes | The document as JSON, base64. |
vector | double[] | The document's embedding; its length is the index's vector dimensions. |
sha256 | string | sha256:<hex> of the document. |
version | uint64 | The version, increasing per document. |
updated_at_unix_ms | int64 | When this version was written, in Unix milliseconds. |
#Errors
UNAUTHENTICATED— No valid key or token was presented.PERMISSION_DENIED— The key lacks the method's permission.INVALID_FIELD— A field failed validation.RESOURCE_NOT_FOUND— The named Resource does not exist or is not visible.
Every error arrives in the body Errors describes.
#Examples
curl -X POST "https://api.data.sylphx.com/v1/search/index-id" \
-H "Authorization: Bearer $SYLPHX_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'