jack-db-elasticsearch

Jack-Stack Plugin for Elasticsearch

Usage no npm install needed!

<script type="module">
  import jackDbElasticsearch from 'https://cdn.skypack.dev/jack-db-elasticsearch';
</script>

README

jack-db-elasticsearch

NPM version Downloads

This Jack-Stack Plugin is used to add create jack.db.elasticsearch.

jack.add(require('jack-db-elasticsearch'));

Configuration

You can either pass in your configuration:

var jack = require('jack-stack');
var elasticsearch = require('jack-db-elasticsearch');

jack.add(elasticsearch.configure({
  url: '1.1.1.1', // Some IP
  port: '1234', // Some PORT
  hash: 'q="something"', // Some optional hash
}));

Or you can use node-config and set the config variables in your config/ files:

module.exports = {
  db: {
    elasticsearch: {
      url: '1.1.1.1', // Some IP
      port: '1234', // Some PORT
      hash: 'q="something"', // Some optional hash
    },
  }
};

Options

You can either set the host parameter:

elasticsearch.configure({
  host: 'https://full:path@to.domain:port'
})

or you can use the url and port (and optional hash) options:

elasticsearch.configure({
  url: '1.1.1.1', // Some IP
  port: '1234', // Some PORT
  hash: 'q="something"', // Some optional hash
});

This uses the format: host = config.url + ':' + config.port + (config.hash || '')