Documents
Index, fetch, and delete documents within a collection.
Index documents
Requires the admin key.
POST /collections/{name}/documentsAccepts a single flat JSON document object, or a JSON array of documents,
indexed as one batch. id is implicit — don't declare it as a schema field.
Indexing an existing id again replaces that document.
curl -X POST localhost:8108/collections/products/documents \
-H 'Content-Type: application/json' \
-H 'x-tachyon-api-key: your-admin-key' \
-d '[
{"id": "1", "title": "Wireless Mouse", "brand": "Logitech", "price": 2999},
{"id": "2", "title": "Mechanical Keyboard", "brand": "Razer", "price": 8999}
]'Response — a BatchReport. Each document in the batch is indexed
independently, so a failure in one doesn't fail the rest:
{
"num_indexed": 2,
"num_failed": 0,
"results": [
{ "success": true, "id": "1", "error": null, "code": null },
{ "success": true, "id": "2", "error": null, "code": null }
]
}Fetch a document
GET /collections/{name}/documents/{id}Requires the admin or search key. Returns the document, or
404 document_not_found.
Delete a document
Requires the admin key.
DELETE /collections/{name}/documents/{id}Takes effect on subsequent searches immediately.