Skip to content

Commit a21b36c

Browse files
committed
Merge pull request #5 from stevenay/master
Add Partial-Update Function
2 parents d0072bc + 6bbe687 commit a21b36c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/ElasticquentTrait.php

+15
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,21 @@ public function removeFromIndex()
333333
return $this->getElasticSearchClient()->delete($this->getBasicEsParams());
334334
}
335335

336+
/**
337+
* Partial Update to Indexed Document
338+
*
339+
* @return array
340+
*/
341+
public function updateIndex()
342+
{
343+
$params = $this->getBasicEsParams();
344+
345+
// Get our document body data.
346+
$params['body']['doc'] = $this->getIndexDocumentData();
347+
348+
return $this->getElasticSearchClient()->update($params);
349+
}
350+
336351
/**
337352
* Get Search Document
338353
*

0 commit comments

Comments
 (0)