Writes a new document to an index or queries an index in its entirety.
An example workflow of using the Elasticsearch container for either options
id: test2
description: ""
functions:
- id: es
image: direktiv/elasticsearch:v1
states:
- id: hello
type: action
action:
function: es
input: jq(.)
Searches the index and returns all the results.
input:
method: "query"
index: "direktiv"
addresses: ["http://192.168.1.30:9200"]
Stores the record under the index provided.
input:
method: "store"
index: "direktiv"
addresses: ["http://192.168.1.30:9200"]
record:
test: "test2"
thisiscool: "yeahcool"
The output of both these operations returns what elasticsearch sends back.
{
"return": {
"_shards": {
"failed": 0,
"skipped": 0,
"successful": 1,
"total": 1
},
"hits": {
"hits": [
{
"_id": "Ya0eqngBJ4CrZdCbJqyO",
"_index": "direktiv",
"_score": 1,
"_source": {
"test": "test2"
},
"_type": "_doc"
},
{
"_id": "Yq0fqngBJ4CrZdCbZ6xR",
"_index": "direktiv",
"_score": 1,
"_source": {
"test": "test2",
"thisiscool": "yeahcool"
},
"_type": "_doc"
}
],
"max_score": 1,
"total": {
"relation": "eq",
"value": 2
}
},
"timed_out": false,
"took": 1
}
}{
"return": {
"_shards": {
"failed": 0,
"skipped": 0,
"successful": 1,
"total": 1
},
"hits": {
"hits": [
{
"_id": "Ya0eqngBJ4CrZdCbJqyO",
"_index": "direktiv",
"_score": 1,
"_source": {
"test": "test2"
},
"_type": "_doc"
},
{
"_id": "Yq0fqngBJ4CrZdCbZ6xR",
"_index": "direktiv",
"_score": 1,
"_source": {
"test": "test2",
"thisiscool": "yeahcool"
},
"_type": "_doc"
}
],
"max_score": 1,
"total": {
"relation": "eq",
"value": 2
}
},
"timed_out": false,
"took": 1
}
}
{
"return": {
"_id": "Yq0fqngBJ4CrZdCbZ6xR",
"_index": "direktiv",
"_primary_term": 1,
"_seq_no": 1,
"_shards": {
"failed": 0,
"successful": 1,
"total": 2
},
"_type": "_doc",
"_version": 1,
"result": "created"
}
}
In the case that an error is encountered, it will present in the following format:
{
"errorCode": "com.elasticsearch.error",
"errorMsg": "Something went wrong"
}
Content type
Image
Digest
sha256:2d5da7316…
Size
3.2 MB
Last updated
about 4 years ago
docker pull westwind027/elasticsearch