0.0.1 • Published 7 years ago
@betterthings/reset-es-data v0.0.1
Reset Elasticsearch Data
⚠️ Attention: there are no tests and it was created at 2am
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
0.0.1
7 years ago