@@ -297,16 +297,12 @@ public function getAdditionalAttributes(?int $storeId = null): array
297
297
}
298
298
299
299
/**
300
- * @param string $indexName
301
- * @param string $indexNameTmp
302
- * @param int $storeId
303
- * @param bool $saveToTmpIndicesToo
304
- * @return void
305
- * @throws AlgoliaException
300
+ * @param int|null $storeId
301
+ * @return array<string, mixed>
306
302
* @throws LocalizedException
307
303
* @throws NoSuchEntityException
308
304
*/
309
- public function setSettings ( string $ indexName , string $ indexNameTmp , int $ storeId, bool $ saveToTmpIndicesToo = false ): void
305
+ public function getIndexSettings (? int $ storeId = null ): array
310
306
{
311
307
$ searchableAttributes = $ this ->getSearchableAttributes ($ storeId );
312
308
$ customRanking = $ this ->getCustomRanking ($ storeId );
@@ -339,6 +335,23 @@ public function setSettings(string $indexName, string $indexNameTmp, int $storeI
339
335
340
336
$ indexSettings = $ transport ->getData ();
341
337
338
+ return $ indexSettings ;
339
+ }
340
+
341
+ /**
342
+ * @param string $indexName
343
+ * @param string $indexNameTmp
344
+ * @param int $storeId
345
+ * @param bool $saveToTmpIndicesToo
346
+ * @return void
347
+ * @throws AlgoliaException
348
+ * @throws LocalizedException
349
+ * @throws NoSuchEntityException
350
+ */
351
+ public function setSettings (string $ indexName , string $ indexNameTmp , int $ storeId , bool $ saveToTmpIndicesToo = false ): void
352
+ {
353
+ $ indexSettings = $ this ->getIndexSettings ($ storeId );
354
+
342
355
$ this ->algoliaHelper ->setSettings ($ indexName , $ indexSettings , false , true );
343
356
$ this ->logger ->log ('Settings: ' . json_encode ($ indexSettings ));
344
357
if ($ saveToTmpIndicesToo ) {
0 commit comments