0.1.0 • Published 5 years ago

reindexer v0.1.0

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

Reindexer tool

Reindex Elastic Search models.

Usage

Create a js file with following content

#!/usr/bin/env node

const Reindexer = require('@carecloud/es-reindexer');
// require the model/schema you would like to reindex.
const schema = require('./bin/reindexer/schema');

const reindexer = new Reindexer();

reindexer.reindex(
  process.env.ES_HOST,  // Elastic Search host, make sure you have it defined in your .env
  process.env.ES_PREFIX, // Elastic Search Prefix, should be defined in .env as well
  process.env.ES_USER,
  process.env.ES_PASS, 
  schema,
  false, // replace current index, true: apply the changes, false: dry run 
  null // path to mapping file
);

Then just run the file on your terminal.