Elasticsearch

Use Elasticsearch to search with Query DSL, manage documents and indexes, run bulk operations, and inspect cluster health. The block supports self-hosted and Elastic Cloud deployments.

Usage Instructions

Integrate Elasticsearch into workflows for powerful search, indexing, and data management. Supports document CRUD operations, advanced search queries, bulk operations, index management, and cluster monitoring. Works with both self-hosted and Elastic Cloud deployments.

Actions

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

Input

ParameterTypeRequiredDescription
deploymentTypestringYesDeployment type: self_hosted or cloud
hoststringNoElasticsearch host URL (for self-hosted)
cloudIdstringNoElastic Cloud ID (for cloud deployments)
authMethodstringYesAuthentication method: api_key or basic_auth
apiKeystringNoElasticsearch API key
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
indexstringYesIndex name to search (e.g., "products", "logs-2024")
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":"desc"}] or [{"_score":"desc"},{"name":"asc"}]
sourceIncludesstringNoComma-separated list of fields to include in _source
sourceExcludesstringNoComma-separated list of fields to exclude from _source
trackTotalHitsbooleanNoTrack accurate total hit count (default: true)

Output

ParameterTypeDescription
tooknumberTime in milliseconds the search took
timed_outbooleanWhether the search timed out
hitsobjectSearch results with total count and matching documents
aggregationsjsonAggregation results if any

Elasticsearch Index Document

Index (create or update) a document in Elasticsearch.

Input

ParameterTypeRequiredDescription
deploymentTypestringYesDeployment type: self_hosted or cloud
hoststringNoElasticsearch host URL (for self-hosted)
cloudIdstringNoElastic Cloud ID (for cloud deployments)
authMethodstringYesAuthentication method: api_key or basic_auth
apiKeystringNoElasticsearch API key
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
indexstringYesTarget index name (e.g., "products", "logs-2024")
documentIdstringNoDocument ID (e.g., "abc123", "user_456"). Auto-generated if not provided
documentstringYesDocument body as JSON string
refreshstringNoRefresh policy: true, false, or wait_for

Output

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

Elasticsearch Get Document

Retrieve a document by ID from Elasticsearch.

Input

ParameterTypeRequiredDescription
deploymentTypestringYesDeployment type: self_hosted or cloud
hoststringNoElasticsearch host URL (for self-hosted)
cloudIdstringNoElastic Cloud ID (for cloud deployments)
authMethodstringYesAuthentication method: api_key or basic_auth
apiKeystringNoElasticsearch API key
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
indexstringYesIndex name (e.g., "products", "logs-2024")
documentIdstringYesDocument ID to retrieve (e.g., "abc123", "user_456")
sourceIncludesstringNoComma-separated list of fields to include
sourceExcludesstringNoComma-separated list of fields to exclude

Output

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

Elasticsearch Update Document

Partially update a document in Elasticsearch using doc merge.

Input

ParameterTypeRequiredDescription
deploymentTypestringYesDeployment type: self_hosted or cloud
hoststringNoElasticsearch host URL (for self-hosted)
cloudIdstringNoElastic Cloud ID (for cloud deployments)
authMethodstringYesAuthentication method: api_key or basic_auth
apiKeystringNoElasticsearch API key
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
indexstringYesIndex name (e.g., "products", "logs-2024")
documentIdstringYesDocument ID to update (e.g., "abc123", "user_456")
documentstringYesPartial document to merge as JSON string
retryOnConflictnumberNoNumber of retries on version conflict

Output

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

Elasticsearch Delete Document

Delete a document from Elasticsearch by ID.

Input

ParameterTypeRequiredDescription
deploymentTypestringYesDeployment type: self_hosted or cloud
hoststringNoElasticsearch host URL (for self-hosted)
cloudIdstringNoElastic Cloud ID (for cloud deployments)
authMethodstringYesAuthentication method: api_key or basic_auth
apiKeystringNoElasticsearch API key
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
indexstringYesIndex name (e.g., "products", "logs-2024")
documentIdstringYesDocument ID to delete (e.g., "abc123", "user_456")
refreshstringNoRefresh policy: true, false, or wait_for

Output

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

Elasticsearch Bulk Operations

Perform multiple index, create, delete, or update operations in a single request for high performance.

Input

ParameterTypeRequiredDescription
deploymentTypestringYesDeployment type: self_hosted or cloud
hoststringNoElasticsearch host URL (for self-hosted)
cloudIdstringNoElastic Cloud ID (for cloud deployments)
authMethodstringYesAuthentication method: api_key or basic_auth
apiKeystringNoElasticsearch API key
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
indexstringNoDefault index for operations (e.g., "products", "logs-2024")
operationsstringYesBulk operations as NDJSON string. Each operation is two lines: action metadata and optional document. Example: {"index":{"_index":"products","_id":"1"}}\n{"name":"Widget"}\n
refreshstringNoRefresh policy: true, false, or wait_for

Output

ParameterTypeDescription
tooknumberTime in milliseconds the bulk operation took
errorsbooleanWhether any operation had an error
itemsarrayResults for each operation

Elasticsearch Count

Count documents matching a query in Elasticsearch.

Input

ParameterTypeRequiredDescription
deploymentTypestringYesDeployment type: self_hosted or cloud
hoststringNoElasticsearch host URL (for self-hosted)
cloudIdstringNoElastic Cloud ID (for cloud deployments)
authMethodstringYesAuthentication method: api_key or basic_auth
apiKeystringNoElasticsearch API key
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
indexstringYesIndex name to count documents in (e.g., "products", "logs-2024")
querystringNoQuery DSL to filter documents (JSON string). Example: {"match":{"status":"active"}}

Output

ParameterTypeDescription
countnumberNumber of documents matching the query
_shardsobjectShard statistics

Elasticsearch Create Index

Create a new index with optional settings and mappings.

Input

ParameterTypeRequiredDescription
deploymentTypestringYesDeployment type: self_hosted or cloud
hoststringNoElasticsearch host URL (for self-hosted)
cloudIdstringNoElastic Cloud ID (for cloud deployments)
authMethodstringYesAuthentication method: api_key or basic_auth
apiKeystringNoElasticsearch API key
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
indexstringYesIndex name to create (e.g., "products", "logs-2024")
settingsstringNoIndex settings as JSON string
mappingsstringNoIndex mappings as JSON string

Output

ParameterTypeDescription
acknowledgedbooleanWhether the request was acknowledged
shards_acknowledgedbooleanWhether the shards were acknowledged
indexstringCreated index name

Elasticsearch Delete Index

Delete an index and all its documents. This operation is irreversible.

Input

ParameterTypeRequiredDescription
deploymentTypestringYesDeployment type: self_hosted or cloud
hoststringNoElasticsearch host URL (for self-hosted)
cloudIdstringNoElastic Cloud ID (for cloud deployments)
authMethodstringYesAuthentication method: api_key or basic_auth
apiKeystringNoElasticsearch API key
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
indexstringYesIndex name to delete (e.g., "products", "logs-2024")

Output

ParameterTypeDescription
acknowledgedbooleanWhether the deletion was acknowledged

Elasticsearch Get Index

Retrieve index information including settings, mappings, and aliases.

Input

ParameterTypeRequiredDescription
deploymentTypestringYesDeployment type: self_hosted or cloud
hoststringNoElasticsearch host URL (for self-hosted)
cloudIdstringNoElastic Cloud ID (for cloud deployments)
authMethodstringYesAuthentication method: api_key or basic_auth
apiKeystringNoElasticsearch API key
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
indexstringYesIndex name to retrieve info for (e.g., "products", "logs-2024")

Output

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

Elasticsearch Cluster Health

Get the health status of the Elasticsearch cluster.

Input

ParameterTypeRequiredDescription
deploymentTypestringYesDeployment type: self_hosted or cloud
hoststringNoElasticsearch host URL (for self-hosted)
cloudIdstringNoElastic Cloud ID (for cloud deployments)
authMethodstringYesAuthentication method: api_key or basic_auth
apiKeystringNoElasticsearch API key
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
waitForStatusstringNoWait until cluster reaches this status: green, yellow, or red
clusterTimeoutstringNoHow long Elasticsearch waits for the cluster to reach the requested status, as an Elasticsearch time value (e.g., 30s, 1m). Not named "timeout": that name is reserved by the tool transport as a client-side abort deadline in milliseconds.

Output

ParameterTypeDescription
cluster_namestringName of the cluster
statusstringCluster health status: green, yellow, or red
number_of_nodesnumberTotal number of nodes in the cluster
number_of_data_nodesnumberNumber of data nodes
active_shardsnumberNumber of active shards
unassigned_shardsnumberNumber of unassigned shards

Elasticsearch Cluster Stats

Get comprehensive statistics about the Elasticsearch cluster.

Input

ParameterTypeRequiredDescription
deploymentTypestringYesDeployment type: self_hosted or cloud
hoststringNoElasticsearch host URL (for self-hosted)
cloudIdstringNoElastic Cloud ID (for cloud deployments)
authMethodstringYesAuthentication method: api_key or basic_auth
apiKeystringNoElasticsearch API key
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth

Output

ParameterTypeDescription
cluster_namestringName of the cluster
statusstringCluster health status
nodesobjectNode statistics including count and versions
indicesobjectIndex statistics including document count and store size

Elasticsearch List Indices

List all indices in the Elasticsearch cluster with their health, status, and statistics.

Input

ParameterTypeRequiredDescription
deploymentTypestringYesDeployment type: self_hosted or cloud
hoststringNoElasticsearch host URL (for self-hosted)
cloudIdstringNoElastic Cloud ID (for cloud deployments)
authMethodstringYesAuthentication method: api_key or basic_auth
apiKeystringNoElasticsearch API key
usernamestringNoUsername for basic auth
passwordstringNoPassword for basic auth
includeSystemIndicesbooleanNoInclude Elasticsearch system indices (names starting with "."). Omitted by default.

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.