Skip to content

Commit 6bbe687

Browse files
committed
Add Partial-Update Function
1 parent b885455 commit 6bbe687

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/ElasticquentTrait.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,21 @@ public function removeFromIndex()
326326
return $this->getElasticSearchClient()->delete($this->getBasicEsParams());
327327
}
328328

329+
/**
330+
* Partial Update to Indexed Document
331+
*
332+
* @return array
333+
*/
334+
public function updateIndex()
335+
{
336+
$params = $this->getBasicEsParams();
337+
338+
// Get our document body data.
339+
$params['body']['doc'] = $this->getIndexDocumentData();
340+
341+
return $this->getElasticSearchClient()->update($params);
342+
}
343+
329344
/**
330345
* Get Search Document
331346
*

0 commit comments

Comments
 (0)