Reset Elasticsearch Data
A utility to index and reset the data in your local Elasticsearch based on a certain directory structure. It can be used to reset the database during local development / testing.
Important: Elasticsearch needs to listen at localhost:9200
.
reset-es-data
takes the data
directory of the current working directory and
does the following:
- for each
data/<index>
folder it first deletes and then creates the index<index>
with the mapping stored indata/<index>/_mapping.json
- for each
data/<index>/<type>/<id>.json
file it indexes the document
Running the tool at the following directory structure will create the index
users
and add alice
and bob
to the users/default
type.
data
users
_mapping.json
default
alice.json
bob.json
Authors
- Florian Hämmerle (@lusbuab) - Better Things Digital