Skip to content

Excel/CSV/BulkJSON downloads on Elasticsearch.

License

NotificationsYou must be signed in to change notification settings

codelibs/elasticsearch-dataformat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elasticsearch Data Format Plugin

Overview

Elasticsearch Data Format Plugin provides a feature to allow you to download a response of a search result as several formats other than JSON. The supported formats are CSV, Excel, JSON(Bulk) and JSON(Object List).

Version

Versions in Maven Repository

Issues/Questions

Please file an issue.

Installation

$ $ES_HOME/bin/elasticsearch-plugin install org.codelibs:elasticsearch-dataformat:7.6.0

Supported Output Formats

This plugin allows you to download data as a format you want. By default, the 100 first hits are returned. You can customize hits returned with from and size query parameters. If you want to download all data, use scroll=1m query parameter.

CSV

$ curl -o /tmp/data.csv -XGET "localhost:9200/{index}/{type}/_data?format=csv&source=..."
Request ParameterTypeDescription
append.headerbooleanAppend column headers if true
fields_namestringchoose the fields to dump
sourcestringQuery DSL
csv.separatorstringSeparate character in CSV
csv.quotestringQuote character in CSV
csv.escapestringEscape character in CSV
csv.nullStringstringString if a value is null
csv.encodingstringEncoding for CSV

Excel

$ curl -o /tmp/data.xls -XGET "localhost:9200/{index}/{type}/_data?format=xls&source=..."
Request ParameterTypeDescription
append.headerbooleanAppend column headers if true
fields_namestringchoose the fields to dump
sourcestringQuery DSL

Excel 2007

$ curl -o /tmp/data.xlsx -XGET "localhost:9200/{index}/{type}/_data?format=xlsx&source=..."
Request ParameterTypeDescription
sourcestringQuery DSL

JSON (Elasticsearch Bulk format)

$ curl -o /tmp/data.json -XGET "localhost:9200/{index}/{type}/_data?format=json&source=..."
Request ParameterTypeDescription
sourcestringQuery DSL
bulk.indexstringIndex name in Bulk file
bulk.typestringType name in Bulk file

JSON (Object List format)

$ curl -o /tmp/data.json -XGET "localhost:9200/{index}/{type}/_data?format=jsonlist&source=..."
Request ParameterTypeDescription
sourcestringQuery DSL