Quick Reference
A compact reference for common hlquery operations and modern routes.
Core Endpoints
| Method | Endpoint | Purpose |
|---|---|---|
| GET | /health | Health check |
| GET | /ready | Readiness check |
| GET | /status | Server status |
| GET | /stats | Runtime statistics |
| GET | /metrics | Metrics |
| GET | /metrics/history | Historical metrics |
| GET | /connections | Active connections |
| GET | /collections | List collections |
| POST | /collections | Create collection |
| GET | /collections/distributed | List collections across links |
| GET | /collections/{collection} | Get collection |
| DELETE | /collections/{collection} | Delete collection |
| GET | /collections/{collection}/lang | Get collection language |
| POST | /collections/{collection}/update | Update collection schema |
| GET | /collections/{collection}/documents | List documents |
| POST | /collections/{collection}/documents | Add document |
| DELETE | /collections/{collection}/documents | Delete by filter |
| POST | /collections/{collection}/documents/import | Bulk import |
| GET | /collections/{collection}/documents/{id} | Get document |
| PUT | /collections/{collection}/documents/{id} | Update document |
| DELETE | /collections/{collection}/documents/{id} | Delete document |
| GET/POST | /collections/{collection}/documents/search | Search |
| GET/POST | /collections/{collection}/vector_search | Vector search |
| GET/POST | /collections/{collection}/search | Vector search alias |
| GET/POST | /multi_search | Batch search |
| GET/POST | /search | Global search |
| GET/POST | /sql | SQL-style query |
Create a Collection
curl -X POST http://localhost:9200/collections \
-H "Content-Type: application/json" \
-d '{
"name": "products",
"fields": [
{"name": "title", "type": "string"},
{"name": "description", "type": "string"},
{"name": "price", "type": "float"},
{"name": "category", "type": "string"},
{"name": "embedding", "type": "float[]"}
]
}'
Add a Document
curl -X POST http://localhost:9200/collections/products/documents \
-H "Content-Type: application/json" \
-d '{
"id": "prod_001",
"title": "Laptop",
"description": "Portable workstation",
"price": 999.99,
"category": "electronics"
}'
Search
curl "http://localhost:9200/collections/products/documents/search?q=laptop&query_by=title,description&limit=10"
Search with Filters and Sort
curl "http://localhost:9200/collections/products/documents/search?q=laptop&filter_by=price:>500&sort_by=price:asc"
Search with POST
curl -X POST http://localhost:9200/collections/products/documents/search \
-H "Content-Type: application/json" \
-d '{
"q": "laptop",
"query_by": "title,description",
"filter_by": "category:electronics",
"sort_by": "price:asc",
"limit": 10
}'
Search All Collections
# Merged GET search across every accessible collection
curl "http://localhost:9200/search?q=research&query_by=title,content&limit=20&offset=0"
# Restrict the merged search to two collections
curl "http://localhost:9200/search?q=research&collections=universities,science&limit=20"
curl -X POST http://localhost:9200/search \
-H "Content-Type: application/json" \
-d '{
"collections": ["universities", "science"],
"q": "research",
"query_by": "title,content",
"limit": 20,
"offset": 0
}'
The response is one globally sorted page. Each hit has document._collection.
limit applies to the merged result, and offset + limit may not exceed 10000.
Vector Search
curl -X POST http://localhost:9200/collections/products/vector_search \
-H "Content-Type: application/json" \
-d '{
"vector_query": {
"field": "embedding",
"vector": [0.12, 0.44, 0.31],
"k": 10
}
}'
Multi-search
curl -X POST http://localhost:9200/multi_search \
-H "Content-Type: application/json" \
-d '{
"searches": [
{"collection": "products", "q": "laptop", "query_by": "title,description"},
{"collection": "articles", "q": "hardware", "query_by": "title,content"}
]
}'
SQL
curl "http://localhost:9200/sql?sql=SELECT%20*%20FROM%20products%20LIMIT%203%3B"
curl -X POST http://localhost:9200/sql \
-H "Content-Type: application/json" \
-d '{"exec":"INSERT INTO products (id, title, price) VALUES (\"prod_10\", \"Keyboard\", 49.99);"}'
Bulk Import
curl -X POST http://localhost:9200/collections/products/documents/import \
-H "Content-Type: application/json" \
-d '[
{"id":"prod_001","title":"Laptop","price":999.99},
{"id":"prod_002","title":"Mouse","price":29.99}
]'
Update or Delete by Query
curl -X POST http://localhost:9200/collections/products/documents/_update_by_query \
-H "Content-Type: application/json" \
-d '{"filter_by":"category:electronics","set":{"in_stock":true}}'
curl -X POST http://localhost:9200/collections/products/documents/_delete_by_query \
-H "Content-Type: application/json" \
-d '{"filter_by":"discontinued:true"}'
Dictionaries and Relevance
| Method | Endpoint | Purpose |
|---|---|---|
| GET | /synonyms | List all synonyms |
| GET | /synonyms/global | List global synonyms |
| POST/PUT | /synonyms/global/{id} | Upsert global synonym |
| GET | /collections/{collection}/synonyms | List collection synonyms |
| POST/PUT | /collections/{collection}/synonyms/{id} | Upsert collection synonym |
| GET | /stopwords | List all stopwords |
| GET | /stopwords/global | List global stopwords |
| POST | /stopwords/global | Create global stopword |
| GET | /collections/{collection}/stopwords | List collection stopwords |
| POST | /collections/{collection}/stopwords | Create collection stopword |
| GET | /collections/{collection}/overrides | List overrides |
| POST/PUT | /collections/{collection}/overrides/{id} | Upsert override |
| GET | /aliases | List aliases |
| GET | /collections/{collection}/aliases | List aliases for a collection |
| POST/PUT | /aliases/{alias} | Upsert alias |
Admin and Runtime
| Method | Endpoint | Purpose |
|---|---|---|
| GET | /keys | List API keys |
| POST | /keys | Create API key |
| GET/PUT/DELETE | /keys/{id} | Manage API key |
| GET | /users | List users |
| POST | /users | Create user |
| GET/PUT/DELETE | /users/{name} | Manage user |
| POST | /flush | Flush all data |
| GET | /admin/storage_status | Storage status |
| GET | /links | Cluster links |
| POST | /links/connect | Add runtime link |
| POST | /links/disconnect | Remove runtime link |
| GET | /modules | List modules |
| POST | /loadmodule/{module} | Load module |
| POST | /unloadmodule/{module} | Unload module |
Search Parameters
| Parameter | Description |
|---|---|
q | Query text. |
query_by | Comma-separated fields to search. |
filter_by | Filter expression. |
sort_by | Sort expression such as price:asc. |
facet_by | Comma-separated facet fields. |
limit | Maximum number of results. |
offset | Number of results to skip. |
page | Page number where supported. |
per_page | Page size where supported. |
distributed | Search execution override where supported. |
Query Syntax
| Type | Syntax | Example |
|---|---|---|
| Term | term | laptop |
| Phrase | "exact phrase" | "gaming laptop" |
| Field | field:value | title:laptop |
| Range | field:[min TO max] | price:[100 TO 500] |
| Wildcard | term* | lap* |
| Regex | field:/pattern/ | title:/lap.*/ |
| Fuzzy | term~ | laptop~ |
| Boost | term^2 | laptop^2 |
| Required | +term | +laptop |
| Excluded | -term | -apple |
| Boolean | AND, OR, NOT | laptop AND gaming |
Common Errors
| Status | Cause |
|---|---|
400 | Invalid JSON or request parameter. |
401 | Missing or invalid authentication. |
403 | Token is not allowed to use the route. |
404 | Collection, document, or resource was not found. |
405 | Method does not match the route. |
409 | Resource already exists or conflicts. |
503 | Startup, metadata scan, or sync state is blocking the operation. |