Overview
This node interacts with the OpenSearch API, specifically focusing on managing indices and documents within those indices. The "Get" operation for the "Index" resource retrieves detailed information about a specified index in an OpenSearch cluster.
Common scenarios where this node is beneficial include:
- Retrieving metadata and configuration details of an existing index.
- Inspecting index settings, mappings, and aliases to understand its structure.
- Debugging or auditing index configurations programmatically.
- Automating monitoring or reporting tasks related to OpenSearch indices.
For example, a user might want to fetch the settings of an index named "products" to verify if certain analyzers or mappings are correctly applied before running search queries.
Properties
| Name | Meaning |
|---|---|
| Index ID | The unique identifier (name) of the index to retrieve information from. |
| Additional Fields | Optional parameters to customize the retrieval behavior: - Allow No Indices: Whether to allow missing or closed indices without error (true/false). Defaults to true. - Expand Wildcards: Types of indices wildcard expressions can match. Options: All, Closed, Hidden, None, Open. Defaults to All. - Flat Settings: Return settings in a flat format (true/false). Defaults to false. - Ignore Unavailable: Whether to ignore unavailable indices instead of returning an error (true/false). Defaults to false. - Include Defaults: Include all default settings in the response (true/false). Defaults to false. - Local: Retrieve information only from the local node (true/false). Defaults to false. - Master Timeout: Time to wait for connection to master node before failing (e.g., "1m"). |
Output
The output JSON contains detailed information about the requested index, structured as follows:
id: The index name (same as the requested Index ID).- Other fields correspond to the index's properties returned by OpenSearch, such as:
- Mappings
- Settings
- Aliases
The exact structure depends on the OpenSearch API response but typically includes nested objects describing the index configuration.
No binary data output is produced by this operation.
Dependencies
- Requires an active connection to an OpenSearch cluster.
- Needs an API authentication token or API key credential configured in n8n to authorize requests.
- Uses internal helper functions to make HTTP requests to the OpenSearch REST API.
Troubleshooting
Common Issues:
- Providing an incorrect or non-existent Index ID will result in an error indicating the index was not found.
- Misconfigured additional fields (e.g., invalid time format for Master Timeout) may cause request failures.
- Network connectivity issues to the OpenSearch cluster will prevent successful retrieval.
Error Messages:
- Errors from the OpenSearch API are surfaced with their type and reason. For example, a "resource_not_found_exception" indicates the index does not exist.
- Timeout errors may occur if the master node does not respond within the specified Master Timeout period.
Resolutions:
- Verify the Index ID spelling and existence in the OpenSearch cluster.
- Check and correct any optional parameter values.
- Ensure network access and valid credentials are properly set up in n8n.