SearchIndexTool
Search an OpenSearch index using query DSL. Provide index name, query, and optional parameters to retrieve matching documents.
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 |
|---|---|---|---|
| opensearch_url | Yes | OpenSearch endpoint URL. | |
| opensearch_username | No | Username for basic authentication. | |
| opensearch_password | No | Password for basic authentication. | |
| opensearch_no_auth | No | If true, connect without authentication. | |
| aws_region | No | AWS region for IAM/Serverless authentication. | |
| aws_iam_arn | No | IAM role ARN for role-based authentication. | |
| aws_profile | No | AWS profile name for authentication. | |
| aws_opensearch_serverless | No | If true, use OpenSearch Serverless service. | |
| opensearch_ssl_verify | No | If false, disable SSL certificate verification. | |
| opensearch_timeout | No | Connection timeout in seconds. | |
| 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. |