File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ See the examples and tests with the official Elasticsearch-js client.
13
13
# Examples:
14
14
15
15
## Stream random records into Elasticsearch
16
- ```
16
+ ``` js
17
17
var WritableBulk = require (' elasticsearch-streams' ).WritableBulk ;
18
18
var client = new require (' elasticsearch' ).Client ();
19
19
@@ -38,14 +38,14 @@ https://github.com/joyent/node/issues/5315#issuecomment-16670354
38
38
39
39
For example to close the ES client as soon as we are done:
40
40
41
- ```
41
+ ``` js
42
42
ws .on (' close' , function () {
43
43
client .close ();
44
44
});
45
45
```
46
46
47
47
## Stream search results from Elasticsearch
48
- ```
48
+ ``` js
49
49
var ReadableSearch = require (' elasticsearch-streams' ).ReadableSearch ;
50
50
var client = new require (' elasticsearch' ).Client ();
51
51
@@ -72,7 +72,7 @@ rs.pipe(ws).on('close', done);
72
72
73
73
If we want to start the stream at an offset and define a limit:
74
74
75
- ```
75
+ ``` js
76
76
var offset = 7 ;
77
77
var limit = 21 ;
78
78
var page = 12 ;
@@ -90,7 +90,7 @@ var searchExec = function searchExec(from, callback) {
90
90
```
91
91
92
92
## Stream scroll/scan results from Elasticsearch
93
- ```
93
+ ``` js
94
94
var scrollExec = function scrollExec (from , callback ) {
95
95
if (this .scroll_id ) {
96
96
return client .scroll ({
@@ -116,7 +116,7 @@ rs = new ReadableSearch(scrollExec);
116
116
```
117
117
118
118
## Stream IDs into Elasticsearch multi-get and get documents out.
119
- ```
119
+ ``` js
120
120
var mgetExec = function (docs , callback ) {
121
121
client .mget ({
122
122
index: ' myindex' ,
You can’t perform that action at this time.
0 commit comments