Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

elasticsearch-module

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elasticsearch-module

A wrapper around functions of elasticsearch.

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
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

Package last updated on 15 Nov 2016

Did you know?

Socket

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