OpenSearch

Usage Instructions

Integrate OpenSearch into workflows to search, index, and manage data. Supports document CRUD operations, Query DSL search, bulk operations, index management, and cluster monitoring. Works with self-hosted clusters, Amazon OpenSearch Service domains, and Amazon OpenSearch Serverless collections, using basic auth or AWS Signature Version 4.

Actions

Search documents in OpenSearch using Query DSL. Returns matching documents with scores and metadata.

Input

ParameterTypeRequiredDescription
hoststringYesOpenSearch endpoint URL (e.g., https://localhost:9200 or https://search-my-domain.us-east-1.es.amazonaws.com)
authMethodstringYesAuthentication method: basic_auth, aws_sigv4, or none
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
awsRegionstringNoAWS region of the domain or collection (e.g., us-east-1)
awsServicestringNoAWS service to sign for: es (managed domain) or aoss (serverless collection)
accessKeyIdstringNoAWS access key ID
secretAccessKeystringNoAWS secret access key
sessionTokenstringNoAWS session token, for temporary credentials
indexstringYesIndex name or pattern to search (e.g., "products", "logs-*")
querystringNoQuery DSL as JSON string. Example: {"match":{"title":"search term"}} or {"bool":{"must":[...]}}
fromnumberNoStarting offset for pagination (e.g., 0, 10, 20). Default: 0
sizenumberNoNumber of results to return (e.g., 10, 25, 100). Default: 10
sortstringNoSort specification as JSON string. Example: [{"created_at":{"order":"desc"}}] or [{"_score":"desc"},{"name":"asc"}]
sourceIncludesstringNoComma-separated list of fields to include in _source
sourceExcludesstringNoComma-separated list of fields to exclude from _source
trackTotalHitsbooleanNoCount every matching document instead of stopping at 10,000

Output

ParameterTypeDescription
tooknumberTime in milliseconds the search took
timed_outbooleanWhether the search timed out
hitsobjectSearch results: total (value, relation), max_score, and hits (each with _index, _id, _score, _source)
aggregationsjsonAggregation results, when the query requested any

OpenSearch Index Document

Index (create or replace) a document in OpenSearch. Omit the document ID to let OpenSearch generate one.

Input

ParameterTypeRequiredDescription
hoststringYesOpenSearch endpoint URL (e.g., https://localhost:9200 or https://search-my-domain.us-east-1.es.amazonaws.com)
authMethodstringYesAuthentication method: basic_auth, aws_sigv4, or none
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
awsRegionstringNoAWS region of the domain or collection (e.g., us-east-1)
awsServicestringNoAWS service to sign for: es (managed domain) or aoss (serverless collection)
accessKeyIdstringNoAWS access key ID
secretAccessKeystringNoAWS secret access key
sessionTokenstringNoAWS session token, for temporary credentials
indexstringYesTarget index name (e.g., "products")
documentIdstringNoDocument ID. Omit to auto-generate one
documentstringYesDocument body as JSON string. Example: {"name":"Widget","price":9.99}
refreshstringNoRefresh policy: true, false, or wait_for

Output

ParameterTypeDescription
_indexstringIndex where the document was stored
_idstringDocument ID
_versionnumberDocument version
resultstringOperation result (created or updated)

OpenSearch Get Document

Retrieve a document by ID from an OpenSearch index.

Input

ParameterTypeRequiredDescription
hoststringYesOpenSearch endpoint URL (e.g., https://localhost:9200 or https://search-my-domain.us-east-1.es.amazonaws.com)
authMethodstringYesAuthentication method: basic_auth, aws_sigv4, or none
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
awsRegionstringNoAWS region of the domain or collection (e.g., us-east-1)
awsServicestringNoAWS service to sign for: es (managed domain) or aoss (serverless collection)
accessKeyIdstringNoAWS access key ID
secretAccessKeystringNoAWS secret access key
sessionTokenstringNoAWS session token, for temporary credentials
indexstringYesIndex name (e.g., "products")
documentIdstringYesID of the document to retrieve
sourceIncludesstringNoComma-separated list of fields to include in _source
sourceExcludesstringNoComma-separated list of fields to exclude from _source

Output

ParameterTypeDescription
_indexstringIndex name
_idstringDocument ID
_versionnumberDocument version
foundbooleanWhether the document was found
_sourcejsonDocument content

OpenSearch Update Document

Partially update a document in OpenSearch. Only the given fields change; the rest are kept.

Input

ParameterTypeRequiredDescription
hoststringYesOpenSearch endpoint URL (e.g., https://localhost:9200 or https://search-my-domain.us-east-1.es.amazonaws.com)
authMethodstringYesAuthentication method: basic_auth, aws_sigv4, or none
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
awsRegionstringNoAWS region of the domain or collection (e.g., us-east-1)
awsServicestringNoAWS service to sign for: es (managed domain) or aoss (serverless collection)
accessKeyIdstringNoAWS access key ID
secretAccessKeystringNoAWS secret access key
sessionTokenstringNoAWS session token, for temporary credentials
indexstringYesIndex name (e.g., "products")
documentIdstringYesID of the document to update
documentstringYesPartial document as JSON string. Example: {"price":12.5}
retryOnConflictnumberNoNumber of times to retry when a version conflict occurs

Output

ParameterTypeDescription
_indexstringIndex name
_idstringDocument ID
_versionnumberNew document version
resultstringOperation result (updated or noop)

OpenSearch Delete Document

Delete a document by ID from an OpenSearch index.

Input

ParameterTypeRequiredDescription
hoststringYesOpenSearch endpoint URL (e.g., https://localhost:9200 or https://search-my-domain.us-east-1.es.amazonaws.com)
authMethodstringYesAuthentication method: basic_auth, aws_sigv4, or none
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
awsRegionstringNoAWS region of the domain or collection (e.g., us-east-1)
awsServicestringNoAWS service to sign for: es (managed domain) or aoss (serverless collection)
accessKeyIdstringNoAWS access key ID
secretAccessKeystringNoAWS secret access key
sessionTokenstringNoAWS session token, for temporary credentials
indexstringYesIndex name (e.g., "products")
documentIdstringYesID of the document to delete
refreshstringNoRefresh policy: true, false, or wait_for

Output

ParameterTypeDescription
_indexstringIndex name
_idstringDocument ID
_versionnumberDocument version
resultstringOperation result (deleted or not_found)

OpenSearch Bulk

Run many index, create, update, and delete operations in one OpenSearch request (NDJSON).

Input

ParameterTypeRequiredDescription
hoststringYesOpenSearch endpoint URL (e.g., https://localhost:9200 or https://search-my-domain.us-east-1.es.amazonaws.com)
authMethodstringYesAuthentication method: basic_auth, aws_sigv4, or none
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
awsRegionstringNoAWS region of the domain or collection (e.g., us-east-1)
awsServicestringNoAWS service to sign for: es (managed domain) or aoss (serverless collection)
accessKeyIdstringNoAWS access key ID
secretAccessKeystringNoAWS secret access key
sessionTokenstringNoAWS session token, for temporary credentials
indexstringNoDefault index for operations that do not name one (e.g., "products")
operationsstringYesBulk operations as NDJSON string: an action line, then a document line where the action needs one. Example: {"index":{"_index":"products","_id":"1"}}\n{"name":"Widget"}\n
refreshstringNoRefresh policy: true, false, or wait_for

Output

ParameterTypeDescription
tooknumberTime in milliseconds the bulk request took
errorsbooleanWhether any operation failed
itemsarrayResult of each operation, keyed by action (index, create, update, delete) with _index, _id, result, status, and error when it failed

OpenSearch Count

Count the documents in an OpenSearch index, optionally matching a query.

Input

ParameterTypeRequiredDescription
hoststringYesOpenSearch endpoint URL (e.g., https://localhost:9200 or https://search-my-domain.us-east-1.es.amazonaws.com)
authMethodstringYesAuthentication method: basic_auth, aws_sigv4, or none
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
awsRegionstringNoAWS region of the domain or collection (e.g., us-east-1)
awsServicestringNoAWS service to sign for: es (managed domain) or aoss (serverless collection)
accessKeyIdstringNoAWS access key ID
secretAccessKeystringNoAWS secret access key
sessionTokenstringNoAWS session token, for temporary credentials
indexstringYesIndex name or pattern (e.g., "products", "logs-*")
querystringNoQuery DSL as JSON string. Omit to count every document

Output

ParameterTypeDescription
countnumberNumber of documents matching the query
_shardsobjectShard statistics (total, successful, skipped, failed)

OpenSearch Create Index

Create an OpenSearch index with optional settings and mappings.

Input

ParameterTypeRequiredDescription
hoststringYesOpenSearch endpoint URL (e.g., https://localhost:9200 or https://search-my-domain.us-east-1.es.amazonaws.com)
authMethodstringYesAuthentication method: basic_auth, aws_sigv4, or none
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
awsRegionstringNoAWS region of the domain or collection (e.g., us-east-1)
awsServicestringNoAWS service to sign for: es (managed domain) or aoss (serverless collection)
accessKeyIdstringNoAWS access key ID
secretAccessKeystringNoAWS secret access key
sessionTokenstringNoAWS session token, for temporary credentials
indexstringYesName of the index to create (lowercase, e.g., "products")
settingsstringNoIndex settings as JSON string. Example: {"number_of_shards":1,"number_of_replicas":1}
mappingsstringNoIndex mappings as JSON string. Example: {"properties":{"title":{"type":"text"}}}

Output

ParameterTypeDescription
acknowledgedbooleanWhether the request was acknowledged
shards_acknowledgedbooleanWhether the shards started before the request timed out
indexstringCreated index name

OpenSearch Delete Index

Delete an OpenSearch index and every document in it. This cannot be undone.

Input

ParameterTypeRequiredDescription
hoststringYesOpenSearch endpoint URL (e.g., https://localhost:9200 or https://search-my-domain.us-east-1.es.amazonaws.com)
authMethodstringYesAuthentication method: basic_auth, aws_sigv4, or none
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
awsRegionstringNoAWS region of the domain or collection (e.g., us-east-1)
awsServicestringNoAWS service to sign for: es (managed domain) or aoss (serverless collection)
accessKeyIdstringNoAWS access key ID
secretAccessKeystringNoAWS secret access key
sessionTokenstringNoAWS session token, for temporary credentials
indexstringYesName of the index to delete

Output

ParameterTypeDescription
acknowledgedbooleanWhether the deletion was acknowledged

OpenSearch Get Index

Read the aliases, mappings, and settings of one or more OpenSearch indices.

Input

ParameterTypeRequiredDescription
hoststringYesOpenSearch endpoint URL (e.g., https://localhost:9200 or https://search-my-domain.us-east-1.es.amazonaws.com)
authMethodstringYesAuthentication method: basic_auth, aws_sigv4, or none
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
awsRegionstringNoAWS region of the domain or collection (e.g., us-east-1)
awsServicestringNoAWS service to sign for: es (managed domain) or aoss (serverless collection)
accessKeyIdstringNoAWS access key ID
secretAccessKeystringNoAWS secret access key
sessionTokenstringNoAWS session token, for temporary credentials
indexstringYesIndex name or pattern (e.g., "products", "logs-*")

Output

ParameterTypeDescription
indicesjsonMatched indices keyed by index name, each with its aliases, mappings, and settings

OpenSearch List Indices

List the indices in the OpenSearch cluster with their health, document count, and size.

Input

ParameterTypeRequiredDescription
hoststringYesOpenSearch endpoint URL (e.g., https://localhost:9200 or https://search-my-domain.us-east-1.es.amazonaws.com)
authMethodstringYesAuthentication method: basic_auth, aws_sigv4, or none
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
awsRegionstringNoAWS region of the domain or collection (e.g., us-east-1)
awsServicestringNoAWS service to sign for: es (managed domain) or aoss (serverless collection)
accessKeyIdstringNoAWS access key ID
secretAccessKeystringNoAWS secret access key
sessionTokenstringNoAWS session token, for temporary credentials
includeSystemIndicesbooleanNoInclude indices whose name starts with "." (system and plugin indices)

Output

ParameterTypeDescription
messagestringSummary message about the indices
indicesjsonArray of index information objects (index, health, status, docsCount, storeSize, primaryShards, replicaShards). System indices are omitted unless includeSystemIndices is set.

OpenSearch Cluster Health

Get the health status of the OpenSearch cluster.

Input

ParameterTypeRequiredDescription
hoststringYesOpenSearch endpoint URL (e.g., https://localhost:9200 or https://search-my-domain.us-east-1.es.amazonaws.com)
authMethodstringYesAuthentication method: basic_auth, aws_sigv4, or none
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
awsRegionstringNoAWS region of the domain or collection (e.g., us-east-1)
awsServicestringNoAWS service to sign for: es (managed domain) or aoss (serverless collection)
accessKeyIdstringNoAWS access key ID
secretAccessKeystringNoAWS secret access key
sessionTokenstringNoAWS session token, for temporary credentials
waitForStatusstringNoWait until the cluster reaches this status: green, yellow, or red
clusterTimeoutstringNoHow long OpenSearch waits for the requested status, as a time value (e.g., 30s, 1m). Not named "timeout": the tool transport reserves that name for its client-side deadline.

Output

ParameterTypeDescription
cluster_namestringName of the cluster
statusstringCluster health status: green, yellow, or red
timed_outbooleanWhether the wait for the requested status timed out
number_of_nodesnumberTotal number of nodes in the cluster
number_of_data_nodesnumberNumber of data nodes
active_primary_shardsnumberNumber of active primary shards
active_shardsnumberNumber of active shards
relocating_shardsnumberNumber of shards being relocated
initializing_shardsnumberNumber of shards being initialized
unassigned_shardsnumberNumber of unassigned shards
number_of_pending_tasksnumberNumber of cluster-level changes not yet executed
active_shards_percent_as_numbernumberPercentage of shards that are active

OpenSearch Cluster Stats

Get cluster-wide statistics for OpenSearch: node counts and versions, document counts, storage, and shards.

Input

ParameterTypeRequiredDescription
hoststringYesOpenSearch endpoint URL (e.g., https://localhost:9200 or https://search-my-domain.us-east-1.es.amazonaws.com)
authMethodstringYesAuthentication method: basic_auth, aws_sigv4, or none
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
awsRegionstringNoAWS region of the domain or collection (e.g., us-east-1)
awsServicestringNoAWS service to sign for: es (managed domain) or aoss (serverless collection)
accessKeyIdstringNoAWS access key ID
secretAccessKeystringNoAWS secret access key
sessionTokenstringNoAWS session token, for temporary credentials

Output

ParameterTypeDescription
cluster_namestringName of the cluster
cluster_uuidstringUnique ID of the cluster
statusstringCluster health status
nodesjsonNode statistics (count by role, versions, os, process, jvm, fs, plugins)
indicesjsonIndex statistics (count, docs, store, shards, fielddata, segments)