elasticsearch-mappings
v1.0.5
Published
Easy to use elasticsearch schema/mappings uploader writen in nodejs.
Maintainers
Readme
ElasticSearch - Mappings
A simple elasticsearch helper CLI tool, written in nodejs.
Use to upload index mappings to database in a simple way.
How to Use
- Add mapping settings to one folder.
- File names must match index names and have
jsonformat. - Everything else happens automatically.
elasticsearch-mappings create [path] [-h] [-f]
elasticsearch-mappings delete [index]Options:
Create:
[path]: optional path to a mappings file or directory (current directory will be used by default).[-h, --host]: optional elasticsearch host parameter (default: localhost:9200)[-f, --force]: force recreation of indices.
Delete:
[index]: optional index name (all indices will be delete by default).
Files
A file named foo.json inside /mappings folder will result in the creation
of an index named foo and will have settings described in a file.
NOTE: elasticsearch-mappings by default doesn't look for/mappingsdirectory!
elasticsearch-mappings support all settings options defined in elasticsearch reference.
Reference: mappings
Example
Running elasticsearch-mappings create ./example will create two indices, bar and foo.
Running elasticsearch-mappings create ./example/bar.json will create only one index, bar.
Running elasticsearch-mappings delete bar will delete only one index, bar.
Running elasticsearch-mappings delete will delete all/both indexes, bar and foo.
Contribution
- Fork the repo.
- Change the code.
- Create a PR.
If you find a bug, please open an issue or create a PR.
