Skip to content

Commit

Permalink
fix(clients): replace all objects (#2762)
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts committed Feb 22, 2024
1 parent a7f8902 commit f3e8940
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ public static async Task<List<long>> ReplaceAllObjectsAsync<T>(this SearchClient
new OperationIndexParams(OperationType.Move, indexName), options, cancellationToken)
.ConfigureAwait(false);

await client.WaitForTaskAsync(indexName, moveResponse.TaskID, requestOptions: options, ct: cancellationToken).ConfigureAwait(false);
await client.WaitForTaskAsync(tmpIndexName, moveResponse.TaskID, requestOptions: options, ct: cancellationToken).ConfigureAwait(false);

return [copyResponse.TaskID, batchResponse.TaskID, moveResponse.TaskID];
}
Expand Down
4 changes: 2 additions & 2 deletions templates/python/search_helpers.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@

responses.append(copy_resp)

await self.wait_for_task(index_name=tmp_index_name, task_id=copy_resp.task_id)
await self.wait_for_task(index_name=index_name, task_id=copy_resp.task_id)

requests: List[BatchRequest] = []

Expand Down Expand Up @@ -253,6 +253,6 @@

responses.append(move_resp)

await self.wait_for_task(index_name=index_name, task_id=move_resp.task_id)
await self.wait_for_task(index_name=tmp_index_name, task_id=move_resp.task_id)

return responses
5 changes: 4 additions & 1 deletion tests/output/csharp/src/ClientExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,10 @@ public async Task ShouldReplaceAllObjects()
r.Uri.AbsolutePath,
"1\\/indexes\\/my-test-index_tmp_[0-9]+\\/task\\/2"
)
|| r.Uri.AbsolutePath.EndsWith("/1/indexes/my-test-index/task/3")
|| Regex.IsMatch(
r.Uri.AbsolutePath,
"1\\/indexes\\/my-test-index_tmp_[0-9]+\\/task\\/3"
)
),
It.IsAny<TimeSpan>(),
It.IsAny<TimeSpan>(),
Expand Down

0 comments on commit f3e8940

Please sign in to comment.