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
| Name | In | Type | Description |
|---|---|---|---|
name | path | string · required | Index name. |
Request body
application/json
| Field | Type | Description |
|---|---|---|
q | string | Text to find. Quotes make a phrase, a leading - excludes a word. Empty: all documents. |
filter | object | Closed filter tree: {"field": f, "eq"|"ne"|"in"|"gt"|"gte"|"lt"|"lte"|"exists": v}, or {"and": [...]}, {"or": [...]}, {"not": {...}}. |
sort | array<object> | Up to 3 sort keys; ties break by relevance then id. |
facets | array<string> | Fields to count values of (up to 100 values each). |
limit | integer | Page size, 1 to 100. |
offset | integer | Results to skip, at most 1000. |
highlight | boolean | Return escaped excerpts with <mark> tags. Default true. |
typo_tolerance | boolean | Match small typos. Default: the index setting. |
Responses
| Status | Description | Body |
|---|---|---|
2XX | Success: the JSON body the route returns (see the description for its fields). | object |
401 | Key missing or invalid | Error |
4XX | Refused: 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"]}'