Skip to content
Console
Menu

Queues

Workflows

Getting Started

Authentication

KV Store

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.

Shell
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

FieldTypeWhat it is
querystringText to match.
vectordouble[]An embedding to match by nearness.
limituint32At 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:

FieldTypeWhat it is
documentDocumentRecordThe document.
scoredoubleHow 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.