Socket
Socket
Sign inDemoInstall

elasticsearch-module

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    elasticsearch-module

A wrapper around functions of elasticsearch.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
9.01 kB
Created
Weekly downloads
 

Readme

Source

elasticsearch-module

A wrapper around functions of elasticsearch.

NPM

Install

$ npm install --save elasticsearch-module

Initializing



var esModule = require('elasticsearch-module')
    
esModule.init({
  baseUrl: 'http://youip:9200/'
});

Add index

var className = 'product';
var data = { 
    "objectId": "0001", 
    "user": "dilbert", 
    "postDate": "2011-12-15", 
    "body": "Search is hard. Search should be easy." ,
    "title": "On search"
};

esModule.add(className, data).then(function(result){
    //dosomething() ....
},function(err){
    //dosomethingElse() ....
});

var className = 'product';
var _search = 'pretty' -d' { "query": { "fuzzy" : { "description" : "The solar system", "fuzziness": 2 } } }';
//var _search = 'q=body:Search';

esModule.add(className, _search).then(function(result){
    //dosomething() ....
},function(err){
    //dosomethingElse() ....
});

License

MIT

FAQs

Last updated on 15 Nov 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc