A client for Elastic Search
A node.js client for elasticsearch (http://www.elasticsearch.com).
npm install elasticsearchclient
ElasticSearchClient = ;var serverOptions =host: 'localhost'port: 9200pathPrefix:'optional pathPrefix'secure: true||false//Optional basic HTTP Authauth:username: processenvES_USERNAMEpassword: processenvES_PASSWORD;
OR specify multiple hosts
var serverOptions =hosts:host: 'localhost'port: 9200;
var elasticSearchClient = serverOptions;var qryObj =field : termelasticSearchClient//Canonical searchelasticSearchClient//Search call as a reusable object with a canonical callbackmySearchCall = elasticSearchClient;//Do it oncemySearchCall//Do it twicemySearchCallelasticSearchClientindexindexName typeName document id options//Bulk index examplevar commands =commandscommandselasticSearchClient;
Twitter stream: Seems to be a problem in the es with deleting streams. May require a node restart for modifications/deletes to take effect
Run code coverage by executing:
$npm run-script coverage
Most of the API (http://www.elasticsearch.org/guide/reference/api/) is implemented.
Copyright (c) 2011 Phillip Rosen
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.