Skip to content

Commit

Permalink
Merge pull request #7 from gsf/readme-update
Browse files Browse the repository at this point in the history
Readme update
  • Loading branch information
ncb000gt committed Mar 26, 2013
2 parents 7d60ab1 + d7a9085 commit 3c2b0c1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 28 deletions.
52 changes: 25 additions & 27 deletions README.md
Original file line number Original file line Diff line number Diff line change
@@ -1,48 +1,46 @@
node-elasticsearch node-elasticsearch
============ ==================


This is a module around the REST API for [Elastic Search](http://www.elasticsearch.org/) built for NodeJS. This is a Node.js module for the [elasticsearch](http://www.elasticsearch.org/) REST API.




Details Usage
============= =====


This works with node 0.4.x and with 0.2.x. I needed it for both and so wrote an [http compatability layer](http://github.com/ncb000gt/node-http_compat). ```js
var elasticsearch = require('elasticsearch');
var es = elasticsearch({index: 'kitteh'});


es.query({query: {field: {field1: 'hai'}}}, function(err, results) {
console.log(results);
});
```


Usage
=============


var lib = require('elasticsearch'), sys = require('sys'); //replace sys with util if you're on node 0.4.x API
lib.createClient(function(client) { ===
client.query({query: {field: {field1: 'hai'}}}, function(err, results) {
console.log(sys.inspect(results, true, 10));
});
});


TBD


API
==============


*Will go here when I'm ready to post it.* Testing
=======

```
npm install
npm test
```




Requirements Requirements
============= ============


* NodeJS * Node.js
* Elastic Search * elasticsearch
* nodeunit (for testing)
* The need for search * The need for search




License License
============= =======


MIT MIT


Trademarks?
============

Node.js™ is an official trademark of Joyent. This module is not formally related to or endorsed by the official Joyent Node.js open source or commercial project
2 changes: 1 addition & 1 deletion lib/elasticsearch.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var utils = require('./utils'),
Index = require('./index'); Index = require('./index');


function ElasticSearch(args) { function ElasticSearch(args) {
var opts = args[0], var opts = args[0] || {},
cb = ((args.length>1)?args[1]:undefined); cb = ((args.length>1)?args[1]:undefined);
if (!(opts.index)) { if (!(opts.index)) {
throw new Error('Must specify an index for ES.'); throw new Error('Must specify an index for ES.');
Expand Down

0 comments on commit 3c2b0c1

Please sign in to comment.