Search
Query a collection, and get autocomplete suggestions.
Search
Requires the admin or search key.
GET /collections/{name}/searchQuery parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
q | string | — | The search query |
query_by | string | all text fields | Comma-separated text fields to search |
filter | string | — | Filter expression — see Filtering |
sort | string | relevance | Sort expression — see Sorting |
facet | string | — | Comma-separated facet fields — see Faceting |
limit | int | 10 | Results per page, max 250 |
offset | int | 0 | Results to skip; offset + limit capped at 10,000 |
prefix | bool | true | Treat the last token as a prefix match |
typo_tolerance | bool | collection setting | Override typo tolerance for this query |
match_mode | "all" | "any" | "all" | Whether every query_by term must match |
curl 'localhost:8108/collections/products/search?q=wireless+mouse&filter=price:<5000&sort=_text_match:desc' \
-H 'x-tachyon-api-key: your-search-key'Response — a SearchResponse:
{
"found": 1,
"found_is_exact": true,
"search_time_ms": 0,
"hits": [
{ "document": { "id": "1", "title": "Wireless Mouse", "price": 2999 }, "text_match": 554.788 }
],
"facets": null
}| Field | Description |
|---|---|
found | Total matching documents |
found_is_exact | Whether found is an exact count |
search_time_ms | Server-side query time |
hits[].document | The full indexed document |
hits[].text_match | BM25 relevance score |
facets | Per-field value → count, present only if facet was passed |
There is no highlighting field in the response — see Searching → Highlighting.
Autocomplete
Requires the admin or search key.
GET /collections/{name}/suggestCompletes the last token of q, prefix- and typo-tolerant.
| Parameter | Type | Default | Description |
|---|---|---|---|
q | string | — | Partial query to complete |
query_by | string | all text fields | Comma-separated fields to draw suggestions from |
limit | int | 5 | Max suggestions, max 50 |
typo_tolerance | bool | collection setting | Override typo tolerance |
curl 'localhost:8108/collections/products/suggest?q=key&query_by=title'{
"suggestions": [
{ "text": "keyboard", "count": 128, "typos": 0 }
],
"search_time_ms": 0
}count is the term's document frequency. Exact prefix matches are ranked
before typo-corrected ones, then by count descending, then alphabetically.