@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.
@@ -7,7 +7,7 @@ import {
7
7
  getAlgoliaAgent,
8
8
  shuffle
9
9
  } from "@algolia/client-common";
10
- var apiClientVersion = "5.50.2";
10
+ var apiClientVersion = "5.52.0";
11
11
  function getDefaultHosts(appId) {
12
12
  return [
13
13
  {
@@ -117,14 +117,14 @@ function createSearchClient({
117
117
  * @param waitForTaskOptions - The `waitForTaskOptions` object.
118
118
  * @param waitForTaskOptions.indexName - The `indexName` where the operation was performed.
119
119
  * @param waitForTaskOptions.taskID - The `taskID` returned in the method response.
120
- * @param waitForTaskOptions.maxRetries - The maximum number of retries. 50 by default.
120
+ * @param waitForTaskOptions.maxRetries - The maximum number of retries. 100 by default.
121
121
  * @param waitForTaskOptions.timeout - The function to decide how long to wait between retries.
122
122
  * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
123
123
  */
124
124
  waitForTask({
125
125
  indexName,
126
126
  taskID,
127
- maxRetries = 50,
127
+ maxRetries = 100,
128
128
  timeout = (retryCount) => Math.min(retryCount * 200, 5e3)
129
129
  }, requestOptions) {
130
130
  let retryCount = 0;
@@ -134,7 +134,7 @@ function createSearchClient({
134
134
  aggregator: () => retryCount += 1,
135
135
  error: {
136
136
  validate: () => retryCount >= maxRetries,
137
- message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`
137
+ 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.`
138
138
  },
139
139
  timeout: () => timeout(retryCount)
140
140
  });
@@ -145,13 +145,13 @@ function createSearchClient({
145
145
  * @summary Helper method that waits for a task to be published (completed).
146
146
  * @param waitForAppTaskOptions - The `waitForTaskOptions` object.
147
147
  * @param waitForAppTaskOptions.taskID - The `taskID` returned in the method response.
148
- * @param waitForAppTaskOptions.maxRetries - The maximum number of retries. 50 by default.
148
+ * @param waitForAppTaskOptions.maxRetries - The maximum number of retries. 100 by default.
149
149
  * @param waitForAppTaskOptions.timeout - The function to decide how long to wait between retries.
150
150
  * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
151
151
  */
152
152
  waitForAppTask({
153
153
  taskID,
154
- maxRetries = 50,
154
+ maxRetries = 100,
155
155
  timeout = (retryCount) => Math.min(retryCount * 200, 5e3)
156
156
  }, requestOptions) {
157
157
  let retryCount = 0;
@@ -161,7 +161,7 @@ function createSearchClient({
161
161
  aggregator: () => retryCount += 1,
162
162
  error: {
163
163
  validate: () => retryCount >= maxRetries,
164
- message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`
164
+ 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.`
165
165
  },
166
166
  timeout: () => timeout(retryCount)
167
167
  });
@@ -174,7 +174,7 @@ function createSearchClient({
174
174
  * @param waitForApiKeyOptions.operation - The `operation` that was done on a `key`.
175
175
  * @param waitForApiKeyOptions.key - The `key` that has been added, deleted or updated.
176
176
  * @param waitForApiKeyOptions.apiKey - Necessary to know if an `update` operation has been processed, compare fields of the response with it.
177
- * @param waitForApiKeyOptions.maxRetries - The maximum number of retries. 50 by default.
177
+ * @param waitForApiKeyOptions.maxRetries - The maximum number of retries. 100 by default.
178
178
  * @param waitForApiKeyOptions.timeout - The function to decide how long to wait between retries.
179
179
  * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getApikey` method and merged with the transporter requestOptions.
180
180
  */
@@ -182,7 +182,7 @@ function createSearchClient({
182
182
  operation,
183
183
  key,
184
184
  apiKey,
185
- maxRetries = 50,
185
+ maxRetries = 100,
186
186
  timeout = (retryCount) => Math.min(retryCount * 200, 5e3)
187
187
  }, requestOptions) {
188
188
  let retryCount = 0;
@@ -190,7 +190,7 @@ function createSearchClient({
190
190
  aggregator: () => retryCount += 1,
191
191
  error: {
192
192
  validate: () => retryCount >= maxRetries,
193
- message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`
193
+ 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.`
194
194
  },
195
195
  timeout: () => timeout(retryCount)
196
196
  };
@@ -2002,11 +2002,11 @@ function createSearchClient({
2002
2002
  return transporter.request(request, requestOptions);
2003
2003
  },
2004
2004
  /**
2005
- * 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.
2005
+ * 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.
2006
2006
  *
2007
2007
  * Required API Key ACLs:
2008
2008
  * - search
2009
- * @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.
2009
+ * @param searchMethodParams - Multi-query search request body. Results are returned in the same order as the requests.
2010
2010
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2011
2011
  */
2012
2012
  search(searchMethodParams, requestOptions) {