Raw Query
Try it
Section titled “Try it”POST /:handle/queryForwards a raw Elasticsearch query DSL body to the configured index and returns the raw Elasticsearch response. Use this when you need full control over the query.
Path parameters
Section titled “Path parameters”| Parameter | Type | Description |
|---|---|---|
handle | string | Index handle as configured in config.yaml |
Request body
Section titled “Request body”A JSON object containing a valid Elasticsearch query DSL body:
{ "query": { "bool": { "must": [ { "match": { "title": "castle" } } ], "filter": [ { "term": { "placeCountry": "Scotland" } } ] } }, "size": 5}Response
Section titled “Response”Returns the raw Elasticsearch search response, including hits, _shards, took, etc.
Examples
Section titled “Examples”curl -X POST "https://search-api-elysia-production.up.railway.app/collections/query" \ -H "Content-Type: application/json" \ -d '{ "query": { "match_all": {} }, "size": 1 }'# Aggregation querycurl -X POST "https://search-api-elysia-production.up.railway.app/collections/query" \ -H "Content-Type: application/json" \ -d '{ "size": 0, "aggs": { "countries": { "terms": { "field": "placeCountry", "size": 10 } } } }'Error responses
Section titled “Error responses”| Status | Condition |
|---|---|
401 | Missing or invalid bearer token |
404 | Index handle not found |