Skip to contents

This function is used to extract data from a JSON file containing the results of an Elasticsearch query. It converts the results into a tibble, then flattens the '_source' column and removes the '_index', '_id', and '_score' columns.

Usage

read_es_query(json_file)

Arguments

json_file

The path to the JSON file containing the Elasticsearch query results.

Value

Returns a tibble containing the data extracted from the query results.

Examples

if (FALSE) {
# Read Elasticsearch query results from a JSON file
query_result <- read_es_query("path/to/query_result.json")

# View the first few rows of data
head(query_result)
}