# Elasticsearch

Elasticsearch is a distributed, RESTful search and analytics engine capable of addressing a growing number of use cases. It provides real-time search and analytics for all types of data.

- **Category:** databases
- **Auth:** API_KEY, BASIC
- **Composio Managed App Available?** N/A
- **Tools:** 4
- **Triggers:** 0
- **Slug:** `ELASTICSEARCH`
- **Version:** 20260227_00

## Tools

### Get Index Schema

**Slug:** `ELASTICSEARCH_GET_INDEX_SCHEMA`

Tool to get the complete schema/mapping of a specific Elasticsearch index. Use when you need to understand the structure, field types, and mappings of an index.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `index_name` | string | Yes | The name of the index to get schema information for. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Indices

**Slug:** `ELASTICSEARCH_LIST_INDICES`

Tool to list all available Elasticsearch indices. Use when you need to get a list of indices in your Elasticsearch cluster, optionally filtering by pattern, health status, or other criteria.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `index` | string | No | A comma-separated string of index names or wildcard expressions to limit the returned information. For example, 'my-index-*,another-index'. If not provided, information for all indices is returned. |
| `health` | string ("green" | "yellow" | "red") | No | The health status to filter indices by (green, yellow, or red). |
| `sort_by` | string | No | A comma-separated string of column names to sort by. For example, 'index,health'. |
| `expand_wildcards` | string ("open" | "closed" | "hidden" | "none" | "all") | No | Type of index that wildcard patterns can match. Supports comma-separated values, e.g., 'open,hidden'. 'all' matches all indices by default. |
| `include_primary_shards_only` | boolean | No | If true, only shows information about primary shards. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Ping Cluster

**Slug:** `ELASTICSEARCH_PING_CLUSTER`

Tool to ping the Elasticsearch cluster and check if it is running. Use when you need to verify cluster connectivity and health status before performing operations.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Query Index

**Slug:** `ELASTICSEARCH_QUERY_INDEX`

Tool to query an Elasticsearch index with various filters, time ranges, and pagination support. Use when you need to search for documents in an index with complex filtering criteria.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `from` | integer | No | Starting offset for pagination (default: 0) |
| `size` | integer | No | Number of results to return (default: 10, max: 1000 to prevent context overload) |
| `sort` | array | No | Sort order for results |
| `query` | string | No | Free text search query (uses query_string query) |
| `fields` | array | No | Specific fields to return (if not specified, returns all fields) |
| `highlight` | boolean | No | Enable highlighting for search terms |
| `index_name` | string | Yes | The name of the index to query. Must be a non-empty string. |
| `time_filter` | object | No | Time-based filter for timestamp fields |
| `term_filters` | array | No | Exact term filters for specific field values |
| `range_filters` | array | No | Range filters for numeric or date fields |
| `include_aggregations` | boolean | No | Include aggregations in the response |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
