added docs to the repo
This commit is contained in:
21
docs/_examples/bulk.asciidoc
Normal file
21
docs/_examples/bulk.asciidoc
Normal file
@ -0,0 +1,21 @@
|
||||
.Perform three operations in a single request
|
||||
[source,js]
|
||||
---------
|
||||
client.bulk({
|
||||
body: [
|
||||
// action description
|
||||
{ index: { _index: 'myindex', _type: 'mytype', _id: 1 } },
|
||||
// the document to index
|
||||
{ title: 'foo' },
|
||||
// action description
|
||||
{ update: { _index: 'myindex', _type: 'mytype', _id: 2 } },
|
||||
// the document to update
|
||||
{ doc: { title: 'foo' } },
|
||||
// action description
|
||||
{ delete: { _index: 'myindex', _type: 'mytype', _id: 3 } },
|
||||
// no document needed for this delete
|
||||
]
|
||||
}, function (err, resp) {
|
||||
// ...
|
||||
});
|
||||
---------
|
||||
Reference in New Issue
Block a user