
Elasticsearch Put
CertifiedIndex a document
Elasticsearch Put
Index a document
Indexes or creates a single document in an Elasticsearch index. Accepts a Map or JSON string for value. Default refresh policy is NONE; routing and opType are optional.
type: io.kestra.plugin.elasticsearch.PutExamples
Put a document with a Map
id: elasticsearch_put
namespace: company.team
tasks:
- id: put
type: io.kestra.plugin.elasticsearch.Put
connection:
hosts:
- "http://localhost:9200"
index: "my_index"
key: "my_id"
value:
name: "John Doe"
city: "Paris"
Put a document from a JSON string
id: elasticsearch_put_json
namespace: company.team
inputs:
- id: value
type: JSON
defaults: {"name": "John Doe", "city": "Paris"}
tasks:
- id: put
type: io.kestra.plugin.elasticsearch.Put
connection:
hosts:
- "http://localhost:9200"
index: "my_index"
key: "my_id"
value: "{{ inputs.value }}"
Properties
connection *RequiredNon-dynamic
Elasticsearch connection
Connection settings shared by tasks; hosts are required.
index *Requiredstring
Target index
contentType string
JSONCBORJSONSMILEYAMLValue content type
Content type for value. Only JSON is currently applied; this hint is not yet honored. Default JSON.
key string
Document id
Optional _id; if omitted, Elasticsearch auto-generates one.
opType string
INDEXCREATEUPDATEDELETEOperation type
Allowed: INDEX or CREATE.
refreshPolicy string
NONEIMMEDIATEWAIT_UNTILNONERefresh policy
When to refresh the index after indexing: IMMEDIATE, WAIT_UNTIL, or NONE (default).
routing string
Custom shard routing
Optional routing key hashed to pick the shard instead of using the document id.
value object
Document body
Map or JSON string rendered at runtime and sent as the document source.
Outputs
id string
Document id
result string
CreatedUpdatedDeletedNotFoundNoOpIndexing result
version integer
Document version