You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ReplaceAllObjectsWithTransformation is similar to the `replaceAllObjects` method but requires a Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/) to be created first, in order to transform records before indexing them to Algolia. The `region` must have been passed to the client instantiation method.
604
+
See https://api-clients-automation.netlify.app/docs/add-new-api-client#5-helpers for implementation details.
605
+
606
+
@param indexName string - the index name to replace objects into.
607
+
@param objects []map[string]any - List of objects to replace.
608
+
@param opts ...ReplaceAllObjectsOption - Optional parameters for the request.
609
+
@return *ReplaceAllObjectsResponse - The response of the replace all objects operation.
ReplaceAllObjects replaces all objects (records) in the given `indexName` with the given `objects`. A temporary index is created during this process in order to backup your data.
604
698
See https://api-clients-automation.netlify.app/docs/add-new-api-client#5-helpers for implementation details.
Copy file name to clipboardExpand all lines: templates/php/api.mustache
+66Lines changed: 66 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -537,6 +537,72 @@ use Algolia\AlgoliaSearch\Exceptions\NotFoundException;
537
537
return new SynonymIterator($indexName, $this, $requestOptions);
538
538
}
539
539
540
+
/**
541
+
* Helper: Similar to the `replaceAllObjects` method but requires a Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/) to be created first, in order to transform records before indexing them to Algolia. The `region` must have been passed to the client instantiation method.
542
+
*
543
+
* @param string $indexName The `indexName` to replace `objects` in.
544
+
* @param array $objects The array of `objects` to store in the given Algolia `indexName`.
545
+
* @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.
546
+
* @param array $requestOptions Request options
547
+
*/
548
+
public function replaceAllObjectsWithTransformation($indexName, $objects, $batchSize = 1000, $scopes = ['settings', 'rules', 'synonyms'], $requestOptions = [])
549
+
{
550
+
if (null ==$this->ingestionTransporter) {
551
+
throw new \InvalidArgumentException('`setTransformationRegion` must have been called before calling this method.');
0 commit comments