Skip to content
Console
Menu

Queues

Workflows

Getting Started

Authentication

KV Store

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

FieldTypeWhat it is
index_idstringThe search index's id. Required.
querystringText 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.
vectordouble[]An embedding to match by cosine similarity; its length is the index's vector dimensions.
limituint32At most this many hits, 1 to 100; unset is 20.
offsetuint32Hits to skip; offset + limit is at most 1000.
filtersSearchFilter[]Conditions every hit meets, at most 16.
vector_weightdoubleThe vector list's share of a hybrid score, 0 to 1; unset is 0.5.
prefixboolWhether the query's last word also matches as a word prefix; unset is true.

#SearchFilter

FieldTypeWhat it is
fieldstringA dot path of object keys, for example price.amount; at most 8 keys. Required.
opstringeq, 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_jsonstringThe 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

FieldTypeWhat it is
hitsSearchHit[]The hits, best first.

#SearchHit

FieldTypeWhat it is
documentDocumentRecordThe document.
scoredoubleHow well it matched; higher is better. The text rank, the cosine similarity, or the fused rank; 0 when listing.
text_scoredoubleThe full-text rank, when the document matched the text.
vector_scoredoubleThe cosine similarity, when the document was in the vector list.

#DocumentRecord

FieldTypeWhat it is
index_idstringThe search index's id in the environment, for example articles.
document_idstringThe document's id.
document_jsonbytesThe document as JSON, base64.
vectordouble[]The document's embedding; its length is the index's vector dimensions.
sha256stringsha256:<hex> of the document.
versionuint64The version, increasing per document.
updated_at_unix_msint64When this version was written, in Unix milliseconds.

#Errors

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 '{}'