Tachyontachyon

Collections

Schemas, field types, and flags — and the endpoints that manage them.

A collection is created with a name and a list of field definitions. The schema is fixed at creation time; there is currently no endpoint to modify a collection's fields after it's created.

{
  "name": "products",
  "fields": [
    { "name": "title", "type": "text" },
    { "name": "brand", "type": "keyword", "facet": true },
    { "name": "price", "type": "int", "filter": true, "sort": true }
  ],
  "default_sorting_field": "price"
}

Field types

TypeDescription
textTokenized, full-text searchable
keywordExact-value string, not tokenized — good for filter/facet
intWhole number
floatFloating-point number
booltrue / false
dateDate/time value

There is no array/multi-value type name — a field's cardinality is inferred from the values you index into it.

Field flags

Every flag defaults to false except index and optional, which default to true.

FlagDefaultEffect
facetfalseField can be passed to the facet search parameter
filterfalseField can be used in a filter expression
sortfalseField can be used in the sort parameter
indextrueField is indexed for full-text search
optionaltrueDocuments may omit this field
boostOptional per-field relevance multiplier (float)

A field must be declared with filter: true, facet: true, or sort: true to be usable that way — using an undeclared field in a filter, sort, or facet parameter returns a 400 invalid_query error.

Typo tolerance and default sort

typo_tolerance and default_sorting_field are set per collection at creation time:

  • typo_tolerance — see Typo Tolerance for the full config shape.
  • default_sorting_field — used to break ties, or as the sort order when a search doesn't specify sort explicitly.

Managing collections

MethodEndpointDescription
POST/collectionsCreate a collection
GET/collectionsList all collections
GET/collections/{name}Get one collection's schema and stats
DELETE/collections/{name}Delete a collection and its data

GET/POST responses include num_documents and num_segments alongside the schema. Full parameter and response details: API Reference → Collections.

On this page