Galon Cloud
Galon API v1

/search/indexes/{name}/query

Base URL https://api.galon.ai/v1 · export GALON_API_BASE="https://api.galon.ai/v1"

POST /search/indexes/{name}/query

Search an index

Full-text search with filters, sorting, facets, pagination and highlights. Use when the user looks something up in the app's own data. Before: search_get_index for the fields. Returns hits (id, score, document, highlights), total, facets, took_ms and the receipt. Scope: search:query.

API key (Bearer), on the public API endpoint.

Parameters

NameInTypeDescription
namepathstring · requiredIndex name.

Request body

application/json

FieldTypeDescription
qstringText to find. Quotes make a phrase, a leading - excludes a word. Empty: all documents.
filterobjectClosed filter tree: {"field": f, "eq"|"ne"|"in"|"gt"|"gte"|"lt"|"lte"|"exists": v}, or {"and": [...]}, {"or": [...]}, {"not": {...}}.
sortarray<object>Up to 3 sort keys; ties break by relevance then id.
facetsarray<string>Fields to count values of (up to 100 values each).
limitintegerPage size, 1 to 100.
offsetintegerResults to skip, at most 1000.
highlightbooleanReturn escaped excerpts with <mark> tags. Default true.
typo_tolerancebooleanMatch small typos. Default: the index setting.

Responses

StatusDescriptionBody
2XXSuccess: the JSON body the route returns (see the description for its fields).object
401Key missing or invalidError
4XXRefused: act on detail.code, then follow detail.next_action (404 not_found while the service is not open to the account).Error

Examples

curl

curl -X POST "$GALON_API_BASE/search/indexes/<name>/query" \
  -H "Authorization: Bearer $GALON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"q": "string", "filter": {}, "sort": [{"field": "string"}], "facets": ["string"]}'