@algolia/client-search 5.8.1 → 5.9.1

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.
package/README.md CHANGED
@@ -41,11 +41,11 @@ All of our clients comes with type definition, and are available for both browse
41
41
  ### With a package manager
42
42
 
43
43
  ```bash
44
- yarn add @algolia/client-search@5.8.1
44
+ yarn add @algolia/client-search@5.9.1
45
45
  # or
46
- npm install @algolia/client-search@5.8.1
46
+ npm install @algolia/client-search@5.9.1
47
47
  # or
48
- pnpm add @algolia/client-search@5.8.1
48
+ pnpm add @algolia/client-search@5.9.1
49
49
  ```
50
50
 
51
51
  ### Without a package manager
@@ -53,7 +53,7 @@ pnpm add @algolia/client-search@5.8.1
53
53
  Add the following JavaScript snippet to the <head> of your website:
54
54
 
55
55
  ```html
56
- <script src="https://cdn.jsdelivr.net/npm/@algolia/client-search@5.8.1/dist/builds/browser.umd.js"></script>
56
+ <script src="https://cdn.jsdelivr.net/npm/@algolia/client-search@5.9.1/dist/builds/browser.umd.js"></script>
57
57
  ```
58
58
 
59
59
  ### Usage
package/dist/browser.d.ts CHANGED
@@ -283,6 +283,10 @@ type BaseSearchResponse = Record<string, any> & {
283
283
  */
284
284
  automaticRadius?: string;
285
285
  exhaustive?: Exhaustive;
286
+ /**
287
+ * Rules applied to the query.
288
+ */
289
+ appliedRules?: Array<Record<string, unknown>>;
286
290
  /**
287
291
  * See the `facetsCount` field of the `exhaustive` object in the response.
288
292
  */
@@ -630,7 +634,7 @@ type BaseGetApiKeyResponse = {
630
634
  /**
631
635
  * API key.
632
636
  */
633
- value?: string;
637
+ value: string;
634
638
  /**
635
639
  * Timestamp when the object was created, in milliseconds since the Unix epoch.
636
640
  */
@@ -754,7 +758,7 @@ type GetObjectsResponse<T = Record<string, any>> = {
754
758
  /**
755
759
  * Retrieved records.
756
760
  */
757
- results: T[];
761
+ results?: T[];
758
762
  };
759
763
 
760
764
  /**
@@ -1337,7 +1341,7 @@ type IndexSettingsAsSearchParams = {
1337
1341
  disableExactOnAttributes?: Array<string>;
1338
1342
  exactOnSingleWordQuery?: ExactOnSingleWordQuery;
1339
1343
  /**
1340
- * Alternatives of query words that should be considered as exact matches by the Exact ranking criterion. - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY/NYC\" are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY/New York\" are considered exact matches.
1344
+ * Determine which plurals and synonyms should be considered an exact matches. By default, Algolia treats singular and plural forms of a word, and single-word synonyms, as [exact](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#exact) matches when searching. For example: - \"swimsuit\" and \"swimsuits\" are treated the same - \"swimsuit\" and \"swimwear\" are treated the same (if they are [synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms)). - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY\" = \"NYC\", are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY\" = \"New York\", are considered exact matches.
1341
1345
  */
1342
1346
  alternativesAsExact?: Array<AlternativesAsExact>;
1343
1347
  /**
@@ -1611,7 +1615,7 @@ type SearchDictionaryEntriesResponse = {
1611
1615
  */
1612
1616
  hits: Array<DictionaryEntry>;
1613
1617
  /**
1614
- * Requested page of the API response.
1618
+ * Requested page of the API response. Algolia uses `page` and `hitsPerPage` to control how search results are displayed ([paginated](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/)). - `hitsPerPage`: sets the number of search results (_hits_) displayed per page. - `page`: specifies the page number of the search results you want to retrieve. Page numbering starts at 0, so the first page is `page=0`, the second is `page=1`, and so on. For example, to display 10 results per page starting from the third page, set `hitsPerPage` to 10 and `page` to 2.
1615
1619
  */
1616
1620
  page: number;
1617
1621
  /**
@@ -1903,7 +1907,7 @@ type SearchUserIdsResponse = {
1903
1907
  */
1904
1908
  page: number;
1905
1909
  /**
1906
- * Maximum number of hits per page.
1910
+ * Maximum number of hits per page. Algolia uses `page` and `hitsPerPage` to control how search results are displayed ([paginated](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/)). - `hitsPerPage`: sets the number of search results (_hits_) displayed per page. - `page`: specifies the page number of the search results you want to retrieve. Page numbering starts at 0, so the first page is `page=0`, the second is `page=1`, and so on. For example, to display 10 results per page starting from the third page, set `hitsPerPage` to 10 and `page` to 2.
1907
1911
  */
1908
1912
  hitsPerPage: number;
1909
1913
  /**
@@ -1930,7 +1934,7 @@ type BaseIndexSettings = {
1930
1934
  */
1931
1935
  unretrievableAttributes?: Array<string>;
1932
1936
  /**
1933
- * Words for which you want to turn off [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/). This also turns off [word splitting and concatenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation/) for the specified words.
1937
+ * Creates a list of [words which require exact matches](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#turn-off-typo-tolerance-for-certain-words). This also turns off [word splitting and concatenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation/) for the specified words.
1934
1938
  */
1935
1939
  disableTypoToleranceOnWords?: Array<string>;
1936
1940
  /**
@@ -1962,7 +1966,7 @@ type BaseIndexSettings = {
1962
1966
  */
1963
1967
  numericAttributesForFiltering?: Array<string>;
1964
1968
  /**
1965
- * Controls which separators are indexed. Separators are all non-letter characters except spaces and currency characters, such as $€£¥. By default, separator characters aren\'t indexed. With `separatorsToIndex`, Algolia treats separator characters as separate words. For example, a search for `C#` would report two matches.
1969
+ * Control which non-alphanumeric characters are indexed. By default, Algolia ignores [non-alphanumeric characters](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/how-to/how-to-search-in-hyphenated-attributes/#handling-non-alphanumeric-characters) like hyphen (`-`), plus (`+`), and parentheses (`(`,`)`). To include such characters, define them with `separatorsToIndex`. Separators are all non-letter characters except spaces and currency characters, such as $€£¥. With `separatorsToIndex`, Algolia treats separator characters as separate words. For example, in a search for \"Disney+\", Algolia considers \"Disney\" and \"+\" as two separate words.
1966
1970
  */
1967
1971
  separatorsToIndex?: string;
1968
1972
  /**
@@ -2222,11 +2226,11 @@ type SearchRulesParams = {
2222
2226
  */
2223
2227
  context?: string;
2224
2228
  /**
2225
- * Requested page of the API response.
2229
+ * Requested page of the API response. Algolia uses `page` and `hitsPerPage` to control how search results are displayed ([paginated](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/)). - `hitsPerPage`: sets the number of search results (_hits_) displayed per page. - `page`: specifies the page number of the search results you want to retrieve. Page numbering starts at 0, so the first page is `page=0`, the second is `page=1`, and so on. For example, to display 10 results per page starting from the third page, set `hitsPerPage` to 10 and `page` to 2.
2226
2230
  */
2227
2231
  page?: number;
2228
2232
  /**
2229
- * Maximum number of hits per page.
2233
+ * Maximum number of hits per page. Algolia uses `page` and `hitsPerPage` to control how search results are displayed ([paginated](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/)). - `hitsPerPage`: sets the number of search results (_hits_) displayed per page. - `page`: specifies the page number of the search results you want to retrieve. Page numbering starts at 0, so the first page is `page=0`, the second is `page=1`, and so on. For example, to display 10 results per page starting from the third page, set `hitsPerPage` to 10 and `page` to 2.
2230
2234
  */
2231
2235
  hitsPerPage?: number;
2232
2236
  /**
@@ -3033,7 +3037,7 @@ type ReplaceAllObjectsOptions = {
3033
3037
  batchSize?: number;
3034
3038
  };
3035
3039
 
3036
- declare const apiClientVersion = "5.8.1";
3040
+ declare const apiClientVersion = "5.9.1";
3037
3041
  declare function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
3038
3042
  transporter: _algolia_client_common.Transporter;
3039
3043
  /**
@@ -19,7 +19,7 @@ import {
19
19
  getAlgoliaAgent,
20
20
  shuffle
21
21
  } from "@algolia/client-common";
22
- var apiClientVersion = "5.8.1";
22
+ var apiClientVersion = "5.9.1";
23
23
  function getDefaultHosts(appId) {
24
24
  return [
25
25
  {