create_bulk_upload_file: Create Bulk API data file.

Description Usage Arguments Value See Also Examples

View source: R/utils.R

Description

The fastest way to index, delete or update many documents, is via the Bulk API. This function assembles a text file comprising of data and/or actions in the format required by the Bulk API. This is ready to be POSTed to the Bulk API.

Usage

1
2
3

Arguments

metadata

A character vector of Bulk API document information objects, as generated by create_metadata(...).

df

[optional] A data.frame with data for indexing or updating.

Value

The name of the temporary file containing the data for the Elasticsearch Bulk API.

See Also

https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html for more information on the information required by the Elasticsearch Bulk API.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
bulk_upload_info <- create_metadata("index", "iris", "data", n = nrow(iris))
create_bulk_upload_file(bulk_upload_info, iris)
# "/var/folders/__/yz_l30s48xj6m_0059b_2twr0000gn/T//RtmpQnvUOt/file98194322b8"

bulk_delete_info <- create_metadata("delete", "iris", "data", n = nrow(iris))
create_bulk_delete_file(bulk_delete_info)
# "/var/folders/__/yz_l30s48xj6m_0059b_2twr0000gn/T//RtmpQnvUOt/file98194322b8"

## End(Not run)

AlexIoannides/elasticsearchr documentation built on July 31, 2019, 9:36 a.m.