Hanzo
OpenapiIndex

Searches an index, forgiving typos.

Searches an index, forgiving typos. Ranks the org's documents in one index against `q` and answers the matching documents whole, most relevant first.

POST /v1/index/indexes/{uid}/search

Addresshttps://api.hanzo.ai/v1/index/indexes/{uid}/search
MethodPOST
Operationpost_index_indexes_by_uid_search
AuthAuthorization: Bearer $HANZO_API_KEY

Searches an index, forgiving typos.

Ranks the org's documents in one index against q and answers the matching documents whole, most relevant first. A prefix matches, so a partial word finds the documents containing it, and filter narrows the result to documents whose filterable attributes match — which is how a caller scopes results to one end user within its own org.

estimatedTotalHits is the dialect's name for the count; every hit is materialised here, so for this page it is exact. An index this org does not hold answers 404 carrying the dialect's index_not_found.

Request

5 fields, body application/json (required).

FieldInTypeRequiredDescription
uidpathstringyes
filterbodyanyFilter narrows the hits, in the dialect's filter syntax: a string, or an array of strings combined with AND.
limitbodyintegerLimit is how many hits to return.
offsetbodyintegerOffset is where to start.
qbodystringQ is the search text.

Response

StatusBodyMeaning
200indexHitsok

200 body — 6 fields.

FieldInTypeAlwaysDescription
estimatedTotalHitsbodyintegerEstimatedTotalHits is the dialect's name for the match count.
hitsbodyany[]Hits are the matching documents, most relevant first, exactly as stored.
limitbodyintegerLimit is how many hits this page could hold.
offsetbodyintegerOffset is where this page starts.
processingTimeMsbodyintegerProcessingTimeMs is how long the query took, in milliseconds.
querybodystringQuery echoes the search terms, which is what a client renders above the results.

Failure carries the platform error shape — see Errors.

Examples

hanzo index indexes search <uid>

Index API · All Hanzo APIs · Interactive reference

How is this guide?

On this page