elasticsearch-local
Run any version of ElasticSearch locally
Usage
0. Install
$ yarn add @shelf/elasticsearch-local --dev
1. Start Elasticsearch
import {start} from '@shelf/elasticsearch-local';
await start({
esVersion: '7.3.0',
port: 9000,
clusterName: 'test',
nodeName: 'test',
indexes: [
{
name: 'your-index',
body: {
settings: {
number_of_shards: '1',
number_of_replicas: '1'
},
aliases: {
'some-acc-id': {}
},
mappings: {
"properties": {
"field1" : {"type" : "text"}
}
}
}
]
});
2. Stop Elasticsearch
import {stop} from '@shelf/elasticsearch-local';
await stop();
Publish
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master
License
MIT © Shelf