0.2.3 • Published 7 years ago

waterline-elasticsearch-dynamic-index v0.2.3

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

waterline-elasticsearch-dynamic-index

Provides easy access to elasticsearch from Sails.js & Waterline.

Installation

To install this adapter, run:

$ npm install waterline-elasticsearch-dynamic-index

Configuration in Sails

In production.js or development.js

connections: {
    elastic: {
            adapter: 'waterline-elasticsearch-dynamic-index',
            connection: function () {
                var conn = {
                    hosts: [
                        'http://user:changeme@elastic01.local:9200',
                        'http://user:changeme@elastic02:9200'
                    ],
                    requestTimeout: 30000
                };

                return conn;
            },
            index: "default_index"
        }
}

In your Model:

connection: 'elastic',

This adapter exposes the following methods:

find()
  • Status
    • Done
findOne()
  • Status
    • Done
create()
  • Status
    • Done
update()
  • Status
    • Done
destroy()
  • Status
    • Done