Skip to content

Commit e7fd2dc

Browse files
algolia-botmillotp
andcommitted
chore: generated code for commit 07266f2. [skip ci]
Co-authored-by: Pierre Millot <[email protected]>
1 parent 07266f2 commit e7fd2dc

File tree

16 files changed

+1048
-34
lines changed

16 files changed

+1048
-34
lines changed

clients/algoliasearch-client-csharp/algoliasearch/Utils/SearchClientExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ public async Task<List<BatchResponse>> ChunkedBatchAsync<T>(string indexName, IE
518518
responses.Add(batchResponse);
519519
}
520520

521-
if (waitForTasks)
521+
if (waitForTasks)
522522
{
523523
foreach (var batch in responses)
524524
{

clients/algoliasearch-client-go/algolia/search/api_search.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/api/SearchClient.java

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6334,6 +6334,17 @@ public <T> ReplaceAllObjectsResponse replaceAllObjects(String indexName, Iterabl
63346334
return replaceAllObjects(indexName, objects, batchSize, null);
63356335
}
63366336

6337+
/**
6338+
* Helper: Saves the given array of objects in the given index. The `chunkedBatch` helper is used
6339+
* under the hood, which creates a `batch` requests with at most 1000 objects in it.
6340+
*
6341+
* @param indexName The `indexName` to replace `objects` in.
6342+
* @param objects The array of `objects` to store in the given Algolia `indexName`.
6343+
*/
6344+
public <T> List<BatchResponse> saveObjects(String indexName, Iterable<T> objects) {
6345+
return saveObjects(indexName, objects, null);
6346+
}
6347+
63376348
/**
63386349
* Helper: Saves the given array of objects in the given index. The `chunkedBatch` helper is used
63396350
* under the hood, which creates a `batch` requests with at most 1000 objects in it.
@@ -6347,6 +6358,17 @@ public <T> List<BatchResponse> saveObjects(String indexName, Iterable<T> objects
63476358
return chunkedBatch(indexName, objects, Action.ADD_OBJECT, false, 1000, requestOptions);
63486359
}
63496360

6361+
/**
6362+
* Helper: Deletes every records for the given objectIDs. The `chunkedBatch` helper is used under
6363+
* the hood, which creates a `batch` requests with at most 1000 objectIDs in it.
6364+
*
6365+
* @param indexName The `indexName` to delete `objectIDs` from.
6366+
* @param objectIDs The array of `objectIDs` to delete from the `indexName`.
6367+
*/
6368+
public List<BatchResponse> deleteObjects(String indexName, List<String> objectIDs) {
6369+
return deleteObjects(indexName, objectIDs, null);
6370+
}
6371+
63506372
/**
63516373
* Helper: Deletes every records for the given objectIDs. The `chunkedBatch` helper is used under
63526374
* the hood, which creates a `batch` requests with at most 1000 objectIDs in it.
@@ -6368,6 +6390,20 @@ public List<BatchResponse> deleteObjects(String indexName, List<String> objectID
63686390
return chunkedBatch(indexName, objects, Action.DELETE_OBJECT, false, 1000, requestOptions);
63696391
}
63706392

6393+
/**
6394+
* Helper: Replaces object content of all the given objects according to their respective
6395+
* `objectID` field. The `chunkedBatch` helper is used under the hood, which creates a `batch`
6396+
* requests with at most 1000 objects in it.
6397+
*
6398+
* @param indexName The `indexName` to update `objects` in.
6399+
* @param objects The array of `objects` to update in the given Algolia `indexName`.
6400+
* @param createIfNotExists To be provided if non-existing objects are passed, otherwise, the call
6401+
* will fail.
6402+
*/
6403+
public <T> List<BatchResponse> partialUpdateObjects(String indexName, Iterable<T> objects, boolean createIfNotExists) {
6404+
return partialUpdateObjects(indexName, objects, createIfNotExists, null);
6405+
}
6406+
63716407
/**
63726408
* Helper: Replaces object content of all the given objects according to their respective
63736409
* `objectID` field. The `chunkedBatch` helper is used under the hood, which creates a `batch`

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2888,7 +2888,7 @@ public function replaceAllObjects($indexName, $objects, $batchSize = 1000, $requ
28882888
[
28892889
'operation' => 'copy',
28902890
'destination' => $tmpIndexName,
2891-
'scope' => ['settings', 'synonyms', 'rules'],
2891+
'scope' => ['settings', 'rules', 'synonyms'],
28922892
],
28932893
$requestOptions
28942894
);
@@ -2902,7 +2902,7 @@ public function replaceAllObjects($indexName, $objects, $batchSize = 1000, $requ
29022902
[
29032903
'operation' => 'copy',
29042904
'destination' => $tmpIndexName,
2905-
'scope' => ['settings', 'synonyms', 'rules'],
2905+
'scope' => ['settings', 'rules', 'synonyms'],
29062906
],
29072907
$requestOptions
29082908
);
@@ -2936,7 +2936,7 @@ public function replaceAllObjects($indexName, $objects, $batchSize = 1000, $requ
29362936
*/
29372937
public function saveObjects($indexName, $objects)
29382938
{
2939-
return chunkedBatch($indexName, $objects, 'addObject', false, 1000, $requestOptions);
2939+
return $this->chunkedBatch($indexName, $objects, 'addObject', false, 1000, $requestOptions);
29402940
}
29412941

29422942
/**
@@ -2945,17 +2945,16 @@ public function saveObjects($indexName, $objects)
29452945
* @param string $indexName the `indexName` to delete `objectIDs` from
29462946
* @param array $objectIDs the `objectIDs` to delete
29472947
* @param array $requestOptions Request options
2948-
* @param mixed $objects
29492948
*/
2950-
public function deleteObjects($indexName, $objects)
2949+
public function deleteObjects($indexName, $objectIDs)
29512950
{
29522951
$objects = [];
29532952

2954-
foreach ($id as $objectIDs) {
2953+
foreach ($objectIDs as $id) {
29552954
$objects[] = ['objectID' => $id];
29562955
}
29572956

2958-
return chunkedBatch($indexName, $objects, 'deleteObjects', false, 1000, $requestOptions);
2957+
return $this->chunkedBatch($indexName, $objects, 'deleteObject', false, 1000, $requestOptions);
29592958
}
29602959

29612960
/**
@@ -2968,7 +2967,7 @@ public function deleteObjects($indexName, $objects)
29682967
*/
29692968
public function partialUpdateObjects($indexName, $objects, $createIfNotExists)
29702969
{
2971-
return chunkedBatch($indexName, $objects, (true == $createIfNotExists) ? 'partialUpdateObject' : 'partialUpdateObjectNoCreate', false, 1000, $requestOptions);
2970+
return $this->chunkedBatch($indexName, $objects, (true == $createIfNotExists) ? 'partialUpdateObject' : 'partialUpdateObjectNoCreate', false, 1000, $requestOptions);
29722971
}
29732972

29742973
/**

clients/algoliasearch-client-python/algoliasearch/search/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,8 @@ async def partial_update_objects(
482482
index_name=index_name,
483483
objects=objects,
484484
action=Action.PARTIALUPDATEOBJECT
485-
and create_if_not_exists
486-
or Action.PARTIALUPDATEOBJECTNOCREATE,
485+
if create_if_not_exists
486+
else Action.PARTIALUPDATEOBJECTNOCREATE,
487487
)
488488

489489
async def chunked_batch(
@@ -540,8 +540,8 @@ async def _copy() -> UpdatedAtResponse:
540540
destination=tmp_index_name,
541541
scope=[
542542
ScopeType("settings"),
543-
ScopeType("synonyms"),
544543
ScopeType("rules"),
544+
ScopeType("synonyms"),
545545
],
546546
),
547547
request_options=request_options,

clients/algoliasearch-client-ruby/lib/algolia/api/search_client.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3284,8 +3284,8 @@ def replace_all_objects(index_name, objects, batch_size = 1000, request_options
32843284
destination: tmp_index_name,
32853285
scope: [
32863286
Search::ScopeType::SETTINGS,
3287-
Search::ScopeType::SYNONYMS,
3288-
Search::ScopeType::RULES
3287+
Search::ScopeType::RULES,
3288+
Search::ScopeType::SYNONYMS
32893289
]
32903290
),
32913291
request_options
@@ -3309,8 +3309,8 @@ def replace_all_objects(index_name, objects, batch_size = 1000, request_options
33093309
destination: tmp_index_name,
33103310
scope: [
33113311
Search::ScopeType::SETTINGS,
3312-
Search::ScopeType::SYNONYMS,
3313-
Search::ScopeType::RULES
3312+
Search::ScopeType::RULES,
3313+
Search::ScopeType::SYNONYMS
33143314
]
33153315
),
33163316
request_options

specs/bundled/search.yml

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3366,7 +3366,7 @@ paths:
33663366
'400':
33673367
$ref: '#/components/responses/IndexNotFound'
33683368
/saveObjects:
3369-
post:
3369+
get:
33703370
x-helper: true
33713371
tags:
33723372
- search
@@ -3379,18 +3379,24 @@ paths:
33793379
parameters:
33803380
- in: query
33813381
name: indexName
3382-
description: The `indexName` to delete `objectIDs` from.
3382+
description: The `indexName` to save `objects` into.
33833383
required: true
33843384
schema:
33853385
type: string
33863386
- in: query
3387-
name: objectIDs
3388-
description: The objectIDs to delete.
3387+
name: objects
3388+
description: The objects to save in the index.
33893389
required: true
33903390
schema:
33913391
type: array
33923392
items:
3393-
type: string
3393+
type: object
3394+
- in: query
3395+
name: requestOptions
3396+
description: The request options to pass to the `batch` method.
3397+
required: false
3398+
schema:
3399+
type: object
33943400
responses:
33953401
'200':
33963402
description: OK
@@ -3428,6 +3434,12 @@ paths:
34283434
type: array
34293435
items:
34303436
type: string
3437+
- in: query
3438+
name: requestOptions
3439+
description: The request options to pass to the `batch` method.
3440+
required: false
3441+
schema:
3442+
type: object
34313443
responses:
34323444
'200':
34333445
description: OK
@@ -3456,18 +3468,18 @@ paths:
34563468
parameters:
34573469
- in: query
34583470
name: indexName
3459-
description: The `indexName` to delete `objectIDs` from.
3471+
description: The `indexName` where to update `objects`.
34603472
required: true
34613473
schema:
34623474
type: string
34633475
- in: query
3464-
name: objectIDs
3465-
description: The objectIDs to delete.
3476+
name: objects
3477+
description: The objects to update.
34663478
required: true
34673479
schema:
34683480
type: array
34693481
items:
3470-
type: string
3482+
type: object
34713483
- in: query
34723484
name: createIfNotExists
34733485
description: >-
@@ -3476,6 +3488,12 @@ paths:
34763488
required: false
34773489
schema:
34783490
type: boolean
3491+
- in: query
3492+
name: requestOptions
3493+
description: The request options to pass to the `batch` method.
3494+
required: false
3495+
schema:
3496+
type: object
34793497
responses:
34803498
'200':
34813499
description: OK

0 commit comments

Comments
 (0)