deepstream.io-storage-elasticsearch
v1.0.1
Published
A storage connector for deepstream and elasticsearch
Downloads
5
Maintainers
Readme
deepstream.io-storage-elasticsearch
deepstream storage connector for elasticsearch
This connector uses the npm elasticsearch package. Please have a look there for detailed options.
##Configuration Options
plugins:
storage:
name: elasticsearch
options:
host: ${ELASTICSEARCH_HOST}
database: 'someDb'
defaultTable: 'someTable'
splitChar: '/'
{
//The host that elasticsearch should use
host: 'localhost:9200',
//(Optional, no default). The authentication to elasticsearch
auth: 'user:password',
//(Optional, defaults to 'deepstream'). This is the index in elasticsearch,
//using database for consistency across all plugins.
database: 'someDb',
//(Optional, defaults to 'deepstream_records'). This is the type in elasticsearch,
//using table for consistency across all plugins
defaultTable: 'someTable',
//(Optional, defaults to 1000). This is the ping timeout used
//when doing the initial ping to ensure the connection is setup correctly
pingTimeout: 200,
/* (Optional) A character that's used as part of the
* record names to split it into a tabel and an id part, e.g.
*
* books/dream-of-the-red-chamber
*
* would create a type called 'books' and store the record under the name
* 'dream-of-the-red-chamber'
*/
splitChar: '/'
}
##Basic Setup
var Deepstream = require( 'deepstream.io' ),
ElasticSearchStorageConnector = require( 'deepstream.io-storage-elasticsearch' ),
server = new Deepstream();
server.set( 'storage', new ElasticSearchStorageConnector( {
host: 'localhost:5672',
pingTimeout: 200,
splitChar: '/'
}));
server.start();