Permalink
Browse files

syntax highlighting

  • Loading branch information...
1 parent 0306243 commit 6c0c127ab001dc9363542ae8b6c4db5e43a05d9a @ferhatsb ferhatsb committed Jun 21, 2012
Showing with 12 additions and 1 deletion.
  1. +12 −1 README.md
View
@@ -9,23 +9,29 @@ npm install elasticsearchclient
## Executing commands on elasticsearch
+
+```javascript
ElasticSearchClient = require('elasticsearchclient');
var serverOptions = {
host: 'localhost',
port: 9200,
};
+```
OR specify multiple hosts
+```javascript
var serverOptions = {
hosts:[
{
host: 'localhost',
port: 9200
}]
};
+```
+```javascript
var elasticSearchClient = new ElasticSearchClient(serverOptions);
var qryObj = {
@@ -62,8 +68,13 @@ commands.push({field1:'value',field2:'value'})
.on('error', function(error){})
.exec();
+```
+
Twitter stream:
Seems to be a problem in the es with deleting streams. May require a node restart for modifications/deletes to take effect
+
+
+```javascript
elasticSearchClient.createOrModifyTwitterRiver(riverName, riverData)
.on('data', function (data) {
console.log(data)
@@ -74,7 +85,7 @@ Seems to be a problem in the es with deleting streams. May require a node restar
console.log(error)
assert.ok(false)
}).exec()
-
+```
## What can i do?

0 comments on commit 6c0c127

Please sign in to comment.