@algolia/client-search 5.50.2 → 5.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,7 +21,7 @@ import {
21
21
  getAlgoliaAgent,
22
22
  shuffle
23
23
  } from "@algolia/client-common";
24
- var apiClientVersion = "5.50.2";
24
+ var apiClientVersion = "5.52.0";
25
25
  function getDefaultHosts(appId) {
26
26
  return [
27
27
  {
@@ -131,14 +131,14 @@ function createSearchClient({
131
131
  * @param waitForTaskOptions - The `waitForTaskOptions` object.
132
132
  * @param waitForTaskOptions.indexName - The `indexName` where the operation was performed.
133
133
  * @param waitForTaskOptions.taskID - The `taskID` returned in the method response.
134
- * @param waitForTaskOptions.maxRetries - The maximum number of retries. 50 by default.
134
+ * @param waitForTaskOptions.maxRetries - The maximum number of retries. 100 by default.
135
135
  * @param waitForTaskOptions.timeout - The function to decide how long to wait between retries.
136
136
  * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
137
137
  */
138
138
  waitForTask({
139
139
  indexName,
140
140
  taskID,
141
- maxRetries = 50,
141
+ maxRetries = 100,
142
142
  timeout = (retryCount) => Math.min(retryCount * 200, 5e3)
143
143
  }, requestOptions) {
144
144
  let retryCount = 0;
@@ -148,7 +148,7 @@ function createSearchClient({
148
148
  aggregator: () => retryCount += 1,
149
149
  error: {
150
150
  validate: () => retryCount >= maxRetries,
151
- message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`
151
+ message: () => `Stopped waiting for the task after ${maxRetries} retries. This does not mean the operation failed; it may still complete. If you need to keep polling, retry with a higher maxRetries.`
152
152
  },
153
153
  timeout: () => timeout(retryCount)
154
154
  });
@@ -159,13 +159,13 @@ function createSearchClient({
159
159
  * @summary Helper method that waits for a task to be published (completed).
160
160
  * @param waitForAppTaskOptions - The `waitForTaskOptions` object.
161
161
  * @param waitForAppTaskOptions.taskID - The `taskID` returned in the method response.
162
- * @param waitForAppTaskOptions.maxRetries - The maximum number of retries. 50 by default.
162
+ * @param waitForAppTaskOptions.maxRetries - The maximum number of retries. 100 by default.
163
163
  * @param waitForAppTaskOptions.timeout - The function to decide how long to wait between retries.
164
164
  * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
165
165
  */
166
166
  waitForAppTask({
167
167
  taskID,
168
- maxRetries = 50,
168
+ maxRetries = 100,
169
169
  timeout = (retryCount) => Math.min(retryCount * 200, 5e3)
170
170
  }, requestOptions) {
171
171
  let retryCount = 0;
@@ -175,7 +175,7 @@ function createSearchClient({
175
175
  aggregator: () => retryCount += 1,
176
176
  error: {
177
177
  validate: () => retryCount >= maxRetries,
178
- message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`
178
+ message: () => `Stopped waiting for the task after ${maxRetries} retries. This does not mean the operation failed; it may still complete. If you need to keep polling, retry with a higher maxRetries.`
179
179
  },
180
180
  timeout: () => timeout(retryCount)
181
181
  });
@@ -188,7 +188,7 @@ function createSearchClient({
188
188
  * @param waitForApiKeyOptions.operation - The `operation` that was done on a `key`.
189
189
  * @param waitForApiKeyOptions.key - The `key` that has been added, deleted or updated.
190
190
  * @param waitForApiKeyOptions.apiKey - Necessary to know if an `update` operation has been processed, compare fields of the response with it.
191
- * @param waitForApiKeyOptions.maxRetries - The maximum number of retries. 50 by default.
191
+ * @param waitForApiKeyOptions.maxRetries - The maximum number of retries. 100 by default.
192
192
  * @param waitForApiKeyOptions.timeout - The function to decide how long to wait between retries.
193
193
  * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getApikey` method and merged with the transporter requestOptions.
194
194
  */
@@ -196,7 +196,7 @@ function createSearchClient({
196
196
  operation,
197
197
  key,
198
198
  apiKey,
199
- maxRetries = 50,
199
+ maxRetries = 100,
200
200
  timeout = (retryCount) => Math.min(retryCount * 200, 5e3)
201
201
  }, requestOptions) {
202
202
  let retryCount = 0;
@@ -204,7 +204,7 @@ function createSearchClient({
204
204
  aggregator: () => retryCount += 1,
205
205
  error: {
206
206
  validate: () => retryCount >= maxRetries,
207
- message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`
207
+ message: () => `Stopped waiting for the API key operation after ${maxRetries} retries. This does not mean the operation failed; it may still complete. If you need to keep polling, retry with a higher maxRetries.`
208
208
  },
209
209
  timeout: () => timeout(retryCount)
210
210
  };
@@ -2016,11 +2016,11 @@ function createSearchClient({
2016
2016
  return transporter.request(request, requestOptions);
2017
2017
  },
2018
2018
  /**
2019
- * Sends multiple search requests to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters. Use the helper `searchForHits` or `searchForFacets` to get the results in a more convenient format, if you already know the return type you want.
2019
+ * Runs multiple search queries against one or more indices in a single API request. Use cases include: - Searching different indices, such as products and marketing content. - Run multiple queries on the same index with different parameters or filters. If you know the expected result type, use the `searchForHits` or `searchForFacets` helper to simplify the response format.
2020
2020
  *
2021
2021
  * Required API Key ACLs:
2022
2022
  * - search
2023
- * @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.
2023
+ * @param searchMethodParams - Multi-query search request body. Results are returned in the same order as the requests.
2024
2024
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2025
2025
  */
2026
2026
  search(searchMethodParams, requestOptions) {