For AI agents: this page is also available as Markdown at /docs/collections.md. Every docs page is: add .md to its URL. llms.txt lists them all.
Collections
A collection is a named set of documents with a schema. Ordinary search requests read one collection (with SQL you name it in FROM). Use multi-collection queries to combine or join several collections in one request. You create, size and delete data per collection. Collections are isolated: no query can reach another organization's data, or a collection you have no role on. Every collection belongs to one organization; there are no shared or public collections.
#Names
A collection name starts with a lowercase letter and then uses only lowercase letters, digits and underscores: ^[a-z][a-z0-9_]*$.
| Valid | Invalid |
|---|---|
books | Books (uppercase) |
beir_scifact | beir-scifact (hyphen) |
logs2026 | 2026_logs (starts with a digit) |
Names are unique within an organization, and the same name can exist in different organizations. A name that breaks the rule is rejected with 400 invalid_collection_name; creating one that already exists answers 409 already_exists. Names cannot be changed: to rename a collection, create a new one and reload your data.
#Create a collection
Creating a collection needs the editor role. Your plan sets how many collections you can have, and creating one more answers 403 limit_exceeded. See Pricing and Limits and errors.
curl -X PUT https://api.warpsearch.io/v1/collections/books \
-H "Authorization: Bearer $WARPSEARCH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"description": "Book catalog",
"class": "search",
"labels": {"team": "catalog", "env": "prod"},
"metadata": {"team": "catalog"},
"schema": {
"fields": {
"title": {"type": "text", "analyzer": {"tokenizer": "unicode_word", "filters": ["nfkc_cf", "fold"]}},
"genre": "string",
"year": "int",
"embedding": {"type": "vector", "dims": 384, "metric": "cosine"}
}
}
}'
Compatible with Elasticsearch clients and tools:
curl -X PUT https://api.warpsearch.io/compat/es/books \
-H "Authorization: Bearer $WARPSEARCH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mappings": {
"properties": {
"title": {"type": "text"},
"genre": {"type": "keyword"},
"year": {"type": "integer"},
"embedding": {"type": "dense_vector", "dims": 384, "similarity": "cosine"}
}
}
}'
Compatible with OpenSearch clients and tools:
curl -X PUT https://api.warpsearch.io/compat/opensearch/books \
-H "Authorization: Bearer $WARPSEARCH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"settings": {"index": {"knn": true}},
"mappings": {
"properties": {
"title": {"type": "text"},
"genre": {"type": "keyword"},
"year": {"type": "integer"},
"embedding": {"type": "knn_vector", "dimension": 384,
"method": {"name": "hnsw", "space_type": "cosinesimil"}}
}
}
}'
The body is optional, and so is every key in it:
| Key | Meaning |
|---|---|
description | Free text, up to 2000 characters. |
class | What the collection is for: search (the default), knowledge, stream, archive or queries. See Collection classes. Fixed at creation. |
labels | Up to 64 string key/value pairs, such as {"env": "prod"}. Keys are up to 63 letters, digits, -, _ or ., optionally with a DNS-style prefix and /. Keys starting warpsearch.io/ are reserved. |
metadata | A JSON object of your own, up to 16 KB. Use it for owner, environment or anything you want to find later. |
schema | The fields and templates of the collection, as a JSON object. See Schemas and field types. |
clone | Copy another collection of your organization: {"from": "books", "documents": true}. See Clone a collection. |
The Elasticsearch and OpenSearch tabs send their own mapping format to the compatible endpoint, which translates it into a schema. mappings and settings are not keys of the WarpSearch create call.
You can also create collections in the management console under Collections, with the MCP create_collection tool (which takes the same schema), or, for existing Elasticsearch and OpenSearch clients, through the compatible PUT /{index} or _bulk API when your key may create collections. A turbopuffer namespace is created by its first write; see turbopuffer compatibility. Plain POST to /v1/collections/{c}/documents does not create a collection; it answers 404 for one that does not exist.
#Collection classes
The class lets WarpSearch pick storage and lifecycle defaults for the collection's purpose, most visibly how long it stays warm. It also sets the billing rates: search and knowledge collections bill data queried at the Search rate, and stream collections at the Stream rate, with a lower write rate. See Pricing. An unknown class answers 400 invalid_class.
| Class | For | Warmth |
|---|---|---|
search | Catalog, site and app search, records | Released after 15 minutes idle; Always warm offered |
knowledge | RAG chunks, embeddings, hybrid search | Released after 15 minutes idle; Always warm offered |
stream | Logs, events, SIEM, metrics | Only recent partitions stay on NVMe; older ones load on demand when a query's time range reaches them |
archive | Compliance, legal hold, rarely queried history | Never warm; a cold launch is slow |
queries | Registered queries for the Match API (reverse search); its schema describes the documents to match | Registered queries stay ready to match; holds no documents |
A new collection can be written to straight away. Define the fields you care about up front: you can add fields later, but changes that would break documents already stored are refused. See Schemas and field types.
#List and describe
curl https://api.warpsearch.io/v1/collections \
-H "Authorization: Bearer $WARPSEARCH_API_KEY"
curl https://api.warpsearch.io/v1/collections/books \
-H "Authorization: Bearer $WARPSEARCH_API_KEY"
The first call lists the collections your key can see. A collection you hold no role on is not in the list, and asking for it answers 404, the same as for a name that does not exist. The second call describes one collection:
| Field | Meaning |
|---|---|
name, class, description, labels, metadata | What you set at creation (labels and metadata can change). |
engine_version | Present when WarpSearch pins the collection to an engine version. |
fields | Each field's name, type and whether it is multi-valued. GET /v1/collections/{c}/schema returns the full schema. |
doc_count, size_bytes, stats_at, stats_status | Size figures, cached and refreshed about once a minute. stats_status is unknown until measured, current for a recent measurement, or stale after five minutes without fresh stats. Counts are omitted when unknown or stale; a reported zero means a measured empty collection. stats_at records the last measurement and remains present when stale. |
created_at, created_by | When and by whom (a user or an API key). |
time_field, message_field, default_fields, id_field | Defaults the query languages use, for example which fields a bare Lucene term searches. |
sources | Whether the collection keeps each document's original body (its source), set by its class. Only a collection that keeps sources can be cloned with its documents or recovered. |
damaged | Present and true when the collection's storage is damaged and it may not load. See Recover a damaged collection. |
clone | Present on a collection made by a clone: from, documents, state (pending, running, done, failed or cancelled), docs_total, docs_done, docs_lost, deletes_unknown, error, started_at and finished_at. |
The console shows the same figures on each collection's page, and GET /v1/usage shows organization totals against your plan's limits.
#The collection page in the console
Each collection's page in the console has these tabs:
- Overview: document count, storage, query volume, latency (p50, p95, p99) and documents ingested over the last 24 hours, 7 days or 30 days, plus the collection's class, fields and plan limits. An empty collection shows the API calls to add documents and search them.
- Documents: run a query in any language, browse and export documents, open one document, or patch or delete many at once.
- Schema: the collection's fields and their types. Editors can add fields here.
- Relevance (Search, eCommerce and Knowledge collections, on paid plans): your top searches, searches that found nothing and searches that found little, a preview of any search, and the synonyms, rules and ranking settings that tune it.
- Settings: description, labels, metadata, cloning and deleting the collection.
Search and Add documents in the page header open the query tool and a paste-or-upload dialog from any tab. Traffic and latency figures are sample data for now; the page labels them until the engine reports real ones.
#Change a collection
PATCH changes the description, metadata and labels. Metadata and labels merge key by key, and setting a key to null removes it:
curl -X PATCH https://api.warpsearch.io/v1/collections/books \
-H "Authorization: Bearer $WARPSEARCH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"metadata": {"team": null, "owner": "search"}}'
To add fields, send a schema with the new definitions to PUT /v1/collections/{c}/schema. The response is the resulting schema:
curl -X PUT https://api.warpsearch.io/v1/collections/books/schema \
-H "Authorization: Bearer $WARPSEARCH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"fields": {"rating": "float"}}'
Read it back with GET /v1/collections/{c}/schema (add Accept: application/yaml for YAML). Reading needs viewer; writing needs editor. See Schemas and field types for what can and cannot change.
#Clone a collection
A clone creates a new collection from an existing one in your organization. Use it for a backup before a risky change, a trial of new relevance settings, or to promote a staging collection to production. It copies:
- the schema, exactly as the source has it;
- the synonyms, rules and search settings;
- the description, class, labels and metadata, unless the create call sets its own;
- with
"documents": true, every document, as it was at the source's last commit.
curl -X PUT https://api.warpsearch.io/v1/collections/books_backup \
-H "Authorization: Bearer $WARPSEARCH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"clone": {"from": "books", "documents": true}, "description": "Before the spring reindex"}'
Key of clone | Meaning |
|---|---|
from | The collection to copy. You need read access to it. |
documents | true copies the documents too. Defaults to false: schema and relevance settings only. |
recover | How hard to try when the source is damaged: auto (the default), scan or off. See Recover a damaged collection. |
Creating a clone needs the editor role and counts against your plan's collections like any other create. In the console, use Clone on the collection's row or on its Settings tab.
What to know:
- The copy is a snapshot. Documents are copied as of the source's last commit when the clone starts. Later writes to the source are not copied.
- Writes wait until it is done. A clone with documents copies them in the background. Until it finishes, writes and schema changes to the new collection answer
409 collection_cloning; searches work and see the documents copied so far.GET /v1/collections/{c}shows progress inclone(docs_doneofdocs_total), and the console shows it on the collection. - Documents are indexed again. Each document gets the same id and body, but its
_version_starts over in the new collection. - To stop a clone, delete the new collection. A failed clone keeps the schema, settings and whatever was copied; delete it and clone again.
- Partitioned collections (and their partitions) cannot be cloned yet, and a clone cannot set
partitioning. - Stream collections keep no sources. The
streamclass does not store each document's original body (logs at scale would be stored twice), sosourcesisfalseand only their schema and settings can be cloned: a clone with documents answers409 source_not_stored. A clone into a stream collection works; the new collection's class decides whether it keeps sources. - A clone's
schemacomes from the source and cannot be combined with your ownschema, except when recovering a source whose schema is unreadable.
#Recover a damaged collection
Documents' sources are stored apart from the search index, in a format where each block carries its own checksum. When a collection's index is damaged and it no longer loads (it shows "damaged": true, and searches may answer 503 recovery_required), its documents can usually still be read back. Recovery is a clone with documents into a new collection; the console offers it as Recover on the damaged collection, into <name>_recovered by default.
curl -X PUT https://api.warpsearch.io/v1/collections/books_recovered \
-H "Authorization: Bearer $WARPSEARCH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"clone": {"from": "books", "documents": true, "recover": "auto"}}'
Recovery reads in tiers and uses the first one that works:
- Index: when the source opens cleanly, the normal clone.
- File list (
recover: "auto"): the source's last commit lists its segments, which documents are live and where each one's source is. Deletes are honored. - Scan (
recover: "scan"only): reads every stored source file and keeps the newest version of each document. Use it whenautofails because the commit's file list is unreadable.
recover: "off" fails unless the source opens cleanly. When the recovery finishes, clone may report:
docs_lost: documents in damaged blocks that could not be read, and were not copied.deletes_unknown: true: a scan could not see which documents were deleted, so documents you deleted from the source may be back. Find and delete them again.
Check the recovered collection (counts, a few searches), point your application at it, then delete the damaged one. If even the source's schema is unreadable, the create answers with an error; send your own schema beside clone to recover into it.
#Delete a collection
curl -X DELETE https://api.warpsearch.io/v1/collections/books \
-H "Authorization: Bearer $WARPSEARCH_API_KEY"
curl -X DELETE https://api.warpsearch.io/compat/es/books \
-H "Authorization: Bearer $WARPSEARCH_API_KEY"
curl -X DELETE https://api.warpsearch.io/compat/opensearch/books \
-H "Authorization: Bearer $WARPSEARCH_API_KEY"
This deletes the collection and every document in it. There is no undo: to keep a copy, clone it with its documents first. You can then create a new collection with the same name only after background deletion finishes; until then creation answers 409 collection_deleting. Deleting returns 202 and needs the admin role.
Coming soon: opening and closing a collection at runtime, to pause a collection without deleting it.
#Idle collections and cold starts
WarpSearch does not keep compute attached to a collection nobody is using. After a period without requests the collection is unloaded to durable storage, and the next request loads it again. While it loads, the request can answer 503 with code warming_up and a Retry-After header. This is normal, and the wait is not billed. Retry after the number of seconds in the header:
curl -i https://api.warpsearch.io/v1/search/books \
-H "Authorization: Bearer $WARPSEARCH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"language": "lucene", "query": "title:dune"}'
# HTTP/1.1 503 Service Unavailable
# Retry-After: 5
# {"code":"warming_up","detail":"the collection is loading; retry shortly", ...}
Build retry-with-backoff into any client that talks to a collection that may be idle, and see Pricing for Always warm, which keeps a collection loaded. Free accounts do not include Always warm.
A free collection that is not queried or written for 30 days is deleted, and its schema is kept so you can create it again; see Pricing.
#Roles on collections
Your API key's role decides what you can do with a collection:
| Action | Role needed |
|---|---|
| List and describe | viewer |
| Search, count, translate, get by id | viewer |
| Index, replace and delete documents, refresh | writer |
| Create, change schema, description, metadata or labels, force merge | editor |
| Delete | admin |
A role that is too low answers 403 forbidden with a message naming the role you need. See API keys, roles and rate limits.