ropensci / elastic

R client for the Elasticsearch HTTP API
https://docs.ropensci.org/elastic
Other
245 stars 58 forks source link

ingest API #191

Closed sckott closed 5 years ago

sckott commented 6 years ago

https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-apis.html

dbuijs commented 6 years ago

Temporary workaround to use pipelines (that you've already defined):

docs_bulk(my_data_frame, index = "my_index", type = "my_row", query = "pipeline=my_pipeline")
sckott commented 6 years ago

thanks @dbuijs will have a look

sckott commented 5 years ago

SO question related https://stackoverflow.com/questions/51365187/index-files-using-r-and-elastic

Jensxy commented 5 years ago

How to use the workaround for arrays?

sckott commented 5 years ago

done in 6be1f45

sckott commented 5 years ago

@dbuijs @Jensxy just added ingest/pipeline fxns, reinstall remotes::install_github("ropensci/elastic") and see ?ingest

Jensxy commented 5 years ago

Thank you very much @sckott . But how do I load data to an index using the pipeline?

For example, the normal ES statement looks like this

curl -XPUT 'ES_HOST:ES_PORT/test_index/test_type/test_id?pipeline=attachment&pretty' -H 'Content-Type: application/json' -d '{
 "data": "UWJveCBlbmFibGVzIGxhdW5jaGluZyBzdXBwb3J0ZWQsIGZ1bGx5LW1hbmFnZWQsIFJFU1RmdWwgRWxhc3RpY3NlYXJjaCBTZXJ2aWNlIGluc3RhbnRseS4g"
}'

In other words, how do I use the created pipelines? And is it possible to use the attachment processor or the pipeline with arrays?

sckott commented 5 years ago

sorry, not sure how to do that