grapes-index-grapes: Index a data frame.

Description Usage Arguments Details See Also Examples

Description

Inserting records (or documents) into Elasticsearch is referred to as "indexing' the data. This function considers each row of a data frame as a document to be indexed into an Elasticsearch index.

Usage

1
rescource %index% df

Arguments

rescource

An elastic_rescource object that contains the information on the Elasticsearch cluster, index and document type, where the indexed data will reside. If this does not already exist, it will be created automatically.

df

data.frame whose rows will be indexed as documents in the Elasticsearch cluster.

Details

If the data frame contains a column named 'id', then this will be used to assign document ids. Otherwise, Elasticsearch will automatically assigne the documents random ids.

See Also

https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html

Examples

1
2
3
4
## Not run: 
elastic("http://localhost:9200", "iris", "data") %index% iris

## End(Not run)

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