Tachyontachyon

Collections

Create, list, fetch, and delete collections.

Create a collection

Requires the admin key.
POST /collections

Request body — a CollectionSchema:

FieldTypeRequiredDescription
namestringyesCollection name
fieldsarray of field schemasyesSee field shape below
typo_toleranceobjectnoSee Typo Tolerance
default_sorting_fieldstringnoField used to break ties / default sort

Each entry in fields:

FieldTypeDefaultDescription
namestringField name
type"text" | "keyword" | "int" | "float" | "bool" | "date"Field type
facetboolfalseUsable in the facet search param
filterboolfalseUsable in a filter expression
sortboolfalseUsable in the sort param
indexbooltrueIndexed for full-text search
optionalbooltrueDocuments may omit this field
boostfloatRelevance multiplier for this field
curl -X POST localhost:8108/collections \
  -H 'Content-Type: application/json' \
  -H 'x-tachyon-api-key: your-admin-key' \
  -d '{
    "name": "products",
    "fields": [
      {"name": "title",       "type": "text"},
      {"name": "description", "type": "text"},
      {"name": "brand",       "type": "keyword", "facet": true},
      {"name": "price",       "type": "int",     "filter": true, "sort": true}
    ]
  }'

Response201 Created, a CollectionView (the schema, flattened, plus stats):

{
  "name": "products",
  "fields": [ "..." ],
  "typo_tolerance": { "enabled": true, "one_typo_min_len": 4, "two_typo_min_len": 8, "max_typos": 2 },
  "default_sorting_field": null,
  "created_at": 1750000000000,
  "num_documents": 0,
  "num_segments": 0
}

List collections

GET /collections

Requires the admin or search key. Returns an array of CollectionView.

Get a collection

GET /collections/{name}

Returns a single CollectionView, or 404 collection_not_found.

Delete a collection

Requires the admin key.
DELETE /collections/{name}

Deletes the collection and all of its documents. Not reversible.

On this page