1.0.5 • Published 7 years ago

elasticsearch-mappings v1.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Build Status

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

  1. Add mapping settings to one folder.
  2. File names must match index names and have json format.
  3. 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 /mappings directory!

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.