Skip to content

Commit 5566fde

Browse files
feat(php): waitForTasks param for various SearchClient methods (#3565) (generated) [skip ci]
Co-authored-by: Aykut Ersoy <[email protected]>
1 parent d0e4f4e commit 5566fde

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

clients/algoliasearch-client-php/lib/Api/SearchClient.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2956,10 +2956,11 @@ public function replaceAllObjects($indexName, $objects, $batchSize = 1000, $requ
29562956
* @param string $indexName the `indexName` to replace `objects` in
29572957
* @param array $objects the array of `objects` to store in the given Algolia `indexName`
29582958
* @param array $requestOptions Request options
2959+
* @param bool $waitForTasks Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable
29592960
*/
2960-
public function saveObjects($indexName, $objects, $requestOptions = [])
2961+
public function saveObjects($indexName, $objects, $requestOptions = [], $waitForTasks = false)
29612962
{
2962-
return $this->chunkedBatch($indexName, $objects, 'addObject', false, 1000, $requestOptions);
2963+
return $this->chunkedBatch($indexName, $objects, 'addObject', $waitForTasks, 1000, $requestOptions);
29632964
}
29642965

29652966
/**
@@ -2968,16 +2969,17 @@ public function saveObjects($indexName, $objects, $requestOptions = [])
29682969
* @param string $indexName the `indexName` to delete `objectIDs` from
29692970
* @param array $objectIDs the `objectIDs` to delete
29702971
* @param array $requestOptions Request options
2972+
* @param bool $waitForTasks Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable
29712973
*/
2972-
public function deleteObjects($indexName, $objectIDs, $requestOptions = [])
2974+
public function deleteObjects($indexName, $objectIDs, $requestOptions = [], $waitForTasks = false)
29732975
{
29742976
$objects = [];
29752977

29762978
foreach ($objectIDs as $id) {
29772979
$objects[] = ['objectID' => $id];
29782980
}
29792981

2980-
return $this->chunkedBatch($indexName, $objects, 'deleteObject', false, 1000, $requestOptions);
2982+
return $this->chunkedBatch($indexName, $objects, 'deleteObject', $waitForTasks, 1000, $requestOptions);
29812983
}
29822984

29832985
/**
@@ -2987,10 +2989,11 @@ public function deleteObjects($indexName, $objectIDs, $requestOptions = [])
29872989
* @param array $objects the array of `objects` to store in the given Algolia `indexName`
29882990
* @param bool $createIfNotExists To be provided if non-existing objects are passed, otherwise, the call will fail..
29892991
* @param array $requestOptions Request options
2992+
* @param bool $waitForTasks Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable
29902993
*/
2991-
public function partialUpdateObjects($indexName, $objects, $createIfNotExists, $requestOptions = [])
2994+
public function partialUpdateObjects($indexName, $objects, $createIfNotExists, $requestOptions = [], $waitForTasks = false)
29922995
{
2993-
return $this->chunkedBatch($indexName, $objects, (true == $createIfNotExists) ? 'partialUpdateObject' : 'partialUpdateObjectNoCreate', false, 1000, $requestOptions);
2996+
return $this->chunkedBatch($indexName, $objects, (true == $createIfNotExists) ? 'partialUpdateObject' : 'partialUpdateObjectNoCreate', $waitForTasks, 1000, $requestOptions);
29942997
}
29952998

29962999
/**
@@ -2999,7 +3002,7 @@ public function partialUpdateObjects($indexName, $objects, $createIfNotExists, $
29993002
* @param string $indexName the `indexName` to replace `objects` in
30003003
* @param array $objects the array of `objects` to store in the given Algolia `indexName`
30013004
* @param array $action the `batch` `action` to perform on the given array of `objects`, defaults to `addObject`
3002-
* @param array $waitForTasks whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable
3005+
* @param bool $waitForTasks whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable
30033006
* @param array $batchSize The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
30043007
* @param array $requestOptions Request options
30053008
*/

0 commit comments

Comments
 (0)