Package Exports
- @travetto/model-elasticsearch
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@travetto/model-elasticsearch) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
travetto: Model-Elasticsearch
This module provides an elasticsearch-based implementation of ModelSource for the Model module. This source allows the Model module to read, write and query against elasticserch. In development mode, the ModelSource will also modify the elasticsearch schema in real time to minimize impact to development.
All that is needed to use the ModelSource is to register it with the Dependency Injection module.
export class Init {
@InjectableFactory()
static getModelSource(conf: ModelElasticsearchConfig): ModelSource {
return new ModelElasticsearchSource(conf);
}
}where the ModelElasticsearchConfig is defined by:
@Config('model.elasticsearch')
export class ModelElasticsearchConfig {
hosts = ['127.0.0.1'];
port = 9200;
options = {};
namespace = 'app';
}and can be overridden via environment variables or config files, as defined in Config.
NOTE During testing, the source will automatically spin up an elasticsearch server via a docker container if you are not already running the service.