Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
arsen committed Apr 30, 2018
1 parent 9cf4050 commit c50dd2c
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,46 @@
# elastic-tools
CLI Utilities to export/import JSON from elasticsearch

CLI Utilities to export/import JSON from elasticsearch

## Usage

### Exporting data to json

```bash
elastic-export --host 127.0.0.1:9200 --index MyIndex --out ./data.json
```

The \_id of the document from elastic's index will be part of the body of the exported document:

For example, this document from elastic:

```json
{
"_index": "users",
"_type": "_doc",
"_id": "1",
"_score": 1,
"_source": {
"active": true,
"name": "User 1",
"email": "email1"
}
}
```
will be exported to JSON like this:

```json
{
"_id": "1",
"active": true,
"name": "User 1",
"email": "email1"
}
```


### Importing data from json array

```bash
elastic-import --host 127.0.0.1:9200 --index MyIndex --data ./data.json
```
```

0 comments on commit c50dd2c

Please sign in to comment.