From ce6792b0a714eef5e280178a75d61e2a94d261aa Mon Sep 17 00:00:00 2001 From: basemkhirat Date: Sat, 18 Mar 2017 13:01:28 +0200 Subject: [PATCH] update bulk docs --- readme.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/readme.md b/readme.md index a454d1e..91228ad 100755 --- a/readme.md +++ b/readme.md @@ -852,6 +852,15 @@ ES::type("my_type")->id(3)->update([ # [id is required] ``` + +```php +# Bulk update + +ES::type("my_type")->bulk(function ($bulk){ + $bulk->id(10)->update(["title" => "Test document 1","content" => "Sample content 1"]); + $bulk->id(11)->update(["title" => "Test document 2","content" => "Sample content 2"]); +}); +``` ##### Incrementing field ```php @@ -913,6 +922,15 @@ ES::type("my_type")->id(3)->delete(); # [id is required] ``` +```php +# Bulk delete + +ES::type("my_type")->bulk(function ($bulk){ + $bulk->id(10)->delete(); + $bulk->id(11)->delete(); +}); +``` + ## Releases See [Change Log](https://github.com/basemkhirat/elasticsearch/blob/master/CHANGELOG.md).