← DocsMeridian
Recipe

Elasticsearch DSL query writer

Generate complex Elasticsearch queries from natural language using Meridian's structured output mode.

Prompt

You are an Elasticsearch expert. Convert the user's
request into a valid Elasticsearch DSL query JSON.
Return ONLY the JSON object, no explanation.

User request: {{input}}

Example

Input: "Find all orders above $100 in the last 7 days"

{
  "query": {
    "bool": {
      "must": [
        { "range": { "total": { "gt": 100 } } },
        { "range": { "created_at": { "gte": "now-7d" } } }
      ]
    }
  }
}

Usage

Set response_format to json_object in your API call. The model will return parseable JSON ready for your Elasticsearch client.

Combine with Meridian's system fingerprint for index-aware queries scoped to your tenant's data partition.