# A DSL I wrote for bulk loading elasticsearch data

**URL:** <https://discuss.elastic.co/t/a-dsl-i-wrote-for-bulk-loading-elasticsearch-data/11588>\
**Category:** Elasticsearch\
**Created:** [April 15, 2013, 3:03pm UTC](https://discuss.elastic.co/t/a-dsl-i-wrote-for-bulk-loading-elasticsearch-data/11588 "2013-04-15T15:03:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Cholakian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian/32/1712_2.png) [@Andrew\_Cholakian](https://discuss.elastic.co/u/Andrew_Cholakian)\
**Post date:** [April 15, 2013, 3:03pm UTC](https://discuss.elastic.co/t/a-dsl-i-wrote-for-bulk-loading-elasticsearch-data/11588/1 "2013-04-15T15:03:03Z")

</div>

Hey guys, thought others might find this useful. I wrote a DSL for bulk  
loading data into elasticsearch from the CLI. It comes in a single .jar  
with a very human readable syntax. While es\_dump\_restore looks nice I  
needed a tool with no dependencies except java. It can be found  
here: [https://github.com/andrewvc/elastic-loader](https://github.com/andrewvc/elastic-loader)

An example import file might look something like:

# Issue an HTTP Request, without stopping due to failure

TRY DELETE /foo

# Issue an HTTP request that will stop the import if it fails

POST /foo {"\_mapping": {}}

# Bulk index items of type bar into the foo index

BULK INDEX foo/bar  
{"user": "foo", "\_id": 1}  
{"user": "baz", "\_id": 3}

# Bulk index items of type baz into the foo index

BULK INDEX foo/baz  
{"ohai": "bort"}  
{"ohai": "there", "\_id": 1}  
DELETE /foo/baz/1

The tool itself is written in clojure, and should be pretty snappy.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dancer](https://avatars.discourse-cdn.com/v4/letter/d/e5b9ba/32.png) [@dancer](https://discuss.elastic.co/u/dancer)\
**Post date:** [June 25, 2013, 2:53am UTC](https://discuss.elastic.co/t/a-dsl-i-wrote-for-bulk-loading-elasticsearch-data/11588/2 "2013-06-25T02:53:44Z")

</div>

sounds good  
it's use http, and I want to kown how it could insert into ES in one minute.  
thanks.  
在 2013年4月15日星期一UTC+8下午11时03分03秒，Andrew Cholakian写道：

> Hey guys, thought others might find this useful. I wrote a DSL for bulk  
> loading data into elasticsearch from the CLI. It comes in a single .jar  
> with a very human readable syntax. While es\_dump\_restore looks nice I  
> needed a tool with no dependencies except java. It can be found here:  
> [GitHub - andrewvc/elastic-loader: A tool for loading data into elastic-search in bulk](https://github.com/andrewvc/elastic-loader)
> 
> An example import file might look something like:
> 
> # Issue an HTTP Request, without stopping due to failure
> 
> TRY DELETE /foo
> 
> # Issue an HTTP request that will stop the import if it fails
> 
> POST /foo {"\_mapping": {}}
> 
> # Bulk index items of type bar into the foo index
> 
> BULK INDEX foo/bar  
> {"user": "foo", "\_id": 1}  
> {"user": "baz", "\_id": 3}
> 
> # Bulk index items of type baz into the foo index
> 
> BULK INDEX foo/baz  
> {"ohai": "bort"}  
> {"ohai": "there", "\_id": 1}  
> DELETE /foo/baz/1
> 
> The tool itself is written in clojure, and should be pretty snappy.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:29am UTC](https://discuss.elastic.co/t/a-dsl-i-wrote-for-bulk-loading-elasticsearch-data/11588/3 "2017-07-06T02:29:39Z")

</div>


