SearchIndexTool
Execute OpenSearch query DSL searches on specified indices to retrieve matching documents. Supports JSON and CSV output formats.
Instructions
Searches an index using a query written in query domain-specific language (DSL) in OpenSearch. PREREQUISITE: You need to know the mappings of the index before constructing queries.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | Yes | The name of the index to search in | |
| query_dsl | Yes | The search query in OpenSearch query DSL format. For keyword-type fields (mapping shows "type": "keyword"), use field name DIRECTLY - do NOT add .keyword suffix. For text-type fields with .keyword subfields, use the .keyword suffix for exact matches. For date/time range queries, MUST include "format" parameter (commonly "format": "strict_date_optional_time||epoch_millis"), e.g. {"range": {"timestamp": {"gte": "2025-12-29T17:15:12Z", "lte": "2025-12-30T08:15:12Z", "format": "strict_date_optional_time||epoch_millis"}}}; if using non-ISO formats, adjust "format" accordingly. | |
| format | No | Output format: "json" or "csv" | json |
| size | No | Number of search results to return. The maximum allowed value is 100, unless overridden by configuration. |