Description Usage Arguments Details Value Attachments References Examples
Ingest API operations
1 2 3 4 5 6 7 8 9 | pipeline_create(conn, id, body, ...)
pipeline_attachment(conn, index, id, pipeline, body, type = NULL, ...)
pipeline_get(conn, id, filter_path = NULL, ...)
pipeline_delete(conn, id, body, ...)
pipeline_simulate(conn, body, id = NULL, ...)
|
conn |
an Elasticsearch connection object, see |
id |
(character) one or more pipeline id's. with delete, you can use a wildcard match |
body |
body describing pipeline, see examples and Elasticsearch docs |
... |
Curl args passed on to crul::verb-POST, crul::verb-GET, crul::verb-PUT, or crul::verb-DELETE |
index |
(character) an index. only used in |
pipeline |
(character) a pipeline name. only used in |
type |
(character) a type. only used in |
filter_path |
(character) fields to return. deafults to all if not given |
ingest/pipeline functions available in Elasticsearch v5 and greater
a named list
See https://www.elastic.co/guide/en/elasticsearch/plugins/current/ingest-attachment.html You need to install the attachment processor plugin to be able to use attachments in pipelines
https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-apis.html, https://www.elastic.co/guide/en/elasticsearch/plugins/current/using-ingest-attachment.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | ## Not run:
# connection setup
(x <- connect())
# create
body1 <- '{
"description" : "do a thing",
"version" : 123,
"processors" : [
{
"set" : {
"field": "foo",
"value": "bar"
}
}
]
}'
body2 <- '{
"description" : "do another thing",
"processors" : [
{
"set" : {
"field": "stuff",
"value": "things"
}
}
]
}'
pipeline_create(x, id = 'foo', body = body1)
pipeline_create(x, id = 'bar', body = body2)
# get
pipeline_get(x, id = 'foo')
pipeline_get(x, id = 'bar')
pipeline_get(x, id = 'foo', filter_path = "*.version")
pipeline_get(x, id = c('foo', 'bar')) # get >1
# delete
pipeline_delete(x, id = 'foo')
# simulate
## with pipeline included
body <- '{
"pipeline" : {
"description" : "do another thing",
"processors" : [
{
"set" : {
"field": "stuff",
"value": "things"
}
}
]
},
"docs" : [
{ "_source": {"foo": "bar"} },
{ "_source": {"foo": "world"} }
]
}'
pipeline_simulate(x, body)
## referencing existing pipeline
body <- '{
"docs" : [
{ "_source": {"foo": "bar"} },
{ "_source": {"foo": "world"} }
]
}'
pipeline_simulate(x, body, id = "foo")
# attchments - Note: you need the attachment plugin for this, see above
body1 <- '{
"description" : "do a thing",
"version" : 123,
"processors" : [
{
"attachment" : {
"field" : "data"
}
}
]
}'
pipeline_create(x, "baz", body1)
body_attach <- '{
"data": "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0="
}'
if (!index_exists(x, "boomarang")) index_create(x, "boomarang")
docs_create(x, 'boomarang', id = 1, body = list(title = "New title"))
pipeline_attachment(x, "boomarang", "1", "baz", body_attach)
pipeline_get(x, id = 'baz')
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.