Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

type_remover

Utility function to remove 'type' from bulk load files


Description

Types are being removed from Elasticsearch. This little function aims to help remove "_type" fields from bulk newline-delimited JSON files. See Details.

Usage

type_remover(file)

Arguments

file

(character) a file path, required

Details

Looks for any lines that have an "index" key, then drops any "_type" keys in the hash given by the "index" key.

You can of course manually modify these files as an alternative, in a text editor or with command line tools like sed, etc.

Value

a file path for a temporary file with the types removed

Examples

## Not run: 
z <- system.file("examples/omdb.json", package = "elastic")
readLines(z, 6)
ff <- type_remover(z)
readLines(ff, 6)
unlink(ff)

## End(Not run)

elastic

General Purpose Interface to 'Elasticsearch'

v1.2.0
MIT + file LICENSE
Authors
Scott Chamberlain [aut, cre] (<https://orcid.org/0000-0003-1444-9135>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.