Skip to content

sjovanovic/fortune-elastic-adapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 

Repository files navigation

Fortune ElasticSearch adapter

This is an ElasticSearch adapter for Fortune.js.

Features

  • uses official elasticsearch client
  • Buffer fields are saved as non indexed arrays in ElasticSearch
$ npm install fortune-elastic-adapter

Usage

This adapter works in Node.js only:

const fortune = require('fortune')
const elasticAdapter = require('fortune-elastic-adapter')

const store = fortune(recordTypes, {
  adapter: [ elasticAdapter, {
    /**
     * ElasticSearch adapter. Available options:
     *
     * - `hosts`:       ElasticSearch hosts array. Default: `["http://localhost:9200"]`.
     * - `index`:       Name of the ElasticSearch index. Default: `fortune`.
     * - `log`:         Log level. One of: `debug`, `trace`, `error`, `warning`. Default: `error`.
     * - `apiVersion`:  ElasticSearch API version. Default: `2.4`.
     */
    hosts: ["http://localhost:9200"]
  } ]
})

For full list of options read the official elasticsearch client configuration options

License

This software is licensed under the MIT license.

About

ElasticSearch adapter for Fortune.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published