Skip to content
This repository has been archived by the owner on Jul 9, 2018. It is now read-only.

Elasticsearch backing for the travetto model module, with real-time modeling support for Elasticsearch mappings.

Notifications You must be signed in to change notification settings

travetto/model-elasticsearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Elasticsearch backing for the travetto model module, with real-time modeling support for Elasticsearch mappings.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published