@algolia/composition 1.13.0 → 1.15.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.
- package/README.md +4 -4
- package/dist/browser.d.ts +946 -30
- package/dist/builds/browser.js +467 -2
- package/dist/builds/browser.js.map +1 -1
- package/dist/builds/browser.min.js +1 -1
- package/dist/builds/browser.min.js.map +1 -1
- package/dist/builds/browser.umd.js +3 -3
- package/dist/builds/fetch.js +467 -2
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +466 -1
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +467 -2
- package/dist/builds/node.js.map +1 -1
- package/dist/builds/worker.js +467 -2
- package/dist/builds/worker.js.map +1 -1
- package/dist/fetch.d.ts +946 -30
- package/dist/node.d.cts +946 -30
- package/dist/node.d.ts +946 -30
- package/dist/src/compositionClient.cjs +466 -1
- package/dist/src/compositionClient.cjs.map +1 -1
- package/dist/src/compositionClient.js +467 -2
- package/dist/src/compositionClient.js.map +1 -1
- package/dist/worker.d.ts +946 -30
- package/package.json +7 -7
package/dist/browser.d.ts
CHANGED
|
@@ -1,6 +1,513 @@
|
|
|
1
1
|
import * as _algolia_client_common from '@algolia/client-common';
|
|
2
2
|
import { CreateClientOptions, RequestOptions, ClientOptions } from '@algolia/client-common';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Type of Composition Batch operation.
|
|
6
|
+
*/
|
|
7
|
+
type Action = 'upsert' | 'delete';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Adds the provided metadata to each injected hit via an `_extra` attribute.
|
|
11
|
+
*/
|
|
12
|
+
type InjectedItemHitsMetadata = {
|
|
13
|
+
/**
|
|
14
|
+
* When true, the `_injectedItemKey` field is set in the `_extra` object of each affected hit.
|
|
15
|
+
*/
|
|
16
|
+
addItemKey?: boolean | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* The user-defined key-value pairs that will be placed in the `_extra` field of each affected hit.
|
|
19
|
+
*/
|
|
20
|
+
extra?: {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
} | undefined;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Used to add metadata to the results of the injectedItem.
|
|
27
|
+
*/
|
|
28
|
+
type InjectedItemMetadata = {
|
|
29
|
+
hits?: InjectedItemHitsMetadata | undefined;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
type AdvancedSyntaxFeatures = 'exactPhrase' | 'excludeWords';
|
|
33
|
+
|
|
34
|
+
type AlternativesAsExact = 'ignorePlurals' | 'singleWordSynonym' | 'multiWordsSynonym' | 'ignoreConjugations';
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Determines how many records of a group are included in the search results. Records with the same value for the `attributeForDistinct` attribute are considered a group. The `distinct` setting controls how many members of the group are returned. This is useful for [deduplication and grouping](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/#introducing-algolias-distinct-feature). The `distinct` setting is ignored if `attributeForDistinct` is not set.
|
|
38
|
+
*/
|
|
39
|
+
type Distinct = boolean | number;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Determines how the [Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes) is computed when the search query has only one word. - `attribute`. The Exact ranking criterion is 1 if the query word and attribute value are the same. For example, a search for \"road\" will match the value \"road\", but not \"road trip\". - `none`. The Exact ranking criterion is ignored on single-word searches. - `word`. The Exact ranking criterion is 1 if the query word is found in the attribute value. The query word must have at least 3 characters and must not be a stop word. Only exact matches will be highlighted, partial and prefix matches won\'t.
|
|
43
|
+
*/
|
|
44
|
+
type ExactOnSingleWordQuery = 'attribute' | 'none' | 'word';
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Filter the search by facet values, so that only records with the same facet values are retrieved. **Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.** - `[filter1, filter2]` is interpreted as `filter1 AND filter2`. - `[[filter1, filter2], filter3]` is interpreted as `filter1 OR filter2 AND filter3`. - `facet:-value` is interpreted as `NOT facet:value`. While it\'s best to avoid attributes that start with a `-`, you can still filter them by escaping with a backslash: `facet:\\-value`.
|
|
48
|
+
*/
|
|
49
|
+
type FacetFilters = Array<FacetFilters> | string;
|
|
50
|
+
|
|
51
|
+
type BooleanString = 'true' | 'false';
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* ISO code for a supported language.
|
|
55
|
+
*/
|
|
56
|
+
type SupportedLanguage = 'af' | 'ar' | 'az' | 'bg' | 'bn' | 'ca' | 'cs' | 'cy' | 'da' | 'de' | 'el' | 'en' | 'eo' | 'es' | 'et' | 'eu' | 'fa' | 'fi' | 'fo' | 'fr' | 'ga' | 'gl' | 'he' | 'hi' | 'hu' | 'hy' | 'id' | 'is' | 'it' | 'ja' | 'ka' | 'kk' | 'ko' | 'ku' | 'ky' | 'lt' | 'lv' | 'mi' | 'mn' | 'mr' | 'ms' | 'mt' | 'nb' | 'nl' | 'no' | 'ns' | 'pl' | 'ps' | 'pt' | 'pt-br' | 'qu' | 'ro' | 'ru' | 'sk' | 'sq' | 'sv' | 'sw' | 'ta' | 'te' | 'th' | 'tl' | 'tn' | 'tr' | 'tt' | 'uk' | 'ur' | 'uz' | 'zh';
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Treat singular, plurals, and other forms of declensions as equivalent. You should only use this feature for the languages used in your index.
|
|
60
|
+
*/
|
|
61
|
+
type IgnorePlurals = Array<SupportedLanguage> | BooleanString | boolean;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Filter by numeric facets. **Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.** You can use numeric comparison operators: `<`, `<=`, `=`, `!=`, `>`, `>=`. Comparisons are precise up to 3 decimals. You can also provide ranges: `facet:<lower> TO <upper>`. The range includes the lower and upper boundaries. The same combination rules apply as for `facetFilters`.
|
|
65
|
+
*/
|
|
66
|
+
type NumericFilters = Array<NumericFilters> | string;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Filters to promote or demote records in the search results. Optional filters work like facet filters, but they don\'t exclude records from the search results. Records that match the optional filter rank before records that don\'t match. If you\'re using a negative filter `facet:-value`, matching records rank after records that don\'t match. - Optional filters don\'t work on virtual replicas. - Optional filters are applied _after_ sort-by attributes. - Optional filters are applied _before_ custom ranking attributes (in the default [ranking](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/)). - Optional filters don\'t work with numeric attributes.
|
|
70
|
+
*/
|
|
71
|
+
type OptionalFilters = Array<OptionalFilters> | string;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn\'t include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words).
|
|
75
|
+
*/
|
|
76
|
+
type OptionalWords = string | Array<string>;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Determines if and how query words are interpreted as prefixes. By default, only the last query word is treated as a prefix (`prefixLast`). To turn off prefix search, use `prefixNone`. Avoid `prefixAll`, which treats all query words as prefixes. This might lead to counterintuitive results and makes your search slower. For more information, see [Prefix searching](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/prefix-searching/).
|
|
80
|
+
*/
|
|
81
|
+
type QueryType = 'prefixLast' | 'prefixAll' | 'prefixNone';
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Removes stop words from the search query. Stop words are common words like articles, conjunctions, prepositions, or pronouns that have little or no meaning on their own. In English, \"the\", \"a\", or \"and\" are stop words. You should only use this feature for the languages used in your index.
|
|
85
|
+
*/
|
|
86
|
+
type RemoveStopWords = Array<SupportedLanguage> | boolean;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Strategy for removing words from the query when it doesn\'t return any results. This helps to avoid returning empty search results. - `none`. No words are removed when a query doesn\'t return results. - `lastWords`. Treat the last (then second to last, then third to last) word as optional, until there are results or at most 5 words have been removed. - `firstWords`. Treat the first (then second, then third) word as optional, until there are results or at most 5 words have been removed. - `allOptional`. Treat all words as optional. For more information, see [Remove words to improve results](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/in-depth/why-use-remove-words-if-no-results/).
|
|
90
|
+
*/
|
|
91
|
+
type RemoveWordsIfNoResults = 'none' | 'lastWords' | 'firstWords' | 'allOptional';
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* - `min`. Return matches with the lowest number of typos. For example, if you have matches without typos, only include those. But if there are no matches without typos (with 1 typo), include matches with 1 typo (2 typos). - `strict`. Return matches with the two lowest numbers of typos. With `strict`, the Typo ranking criterion is applied first in the `ranking` setting.
|
|
95
|
+
*/
|
|
96
|
+
type TypoToleranceEnum = 'min' | 'strict' | 'true' | 'false';
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Whether [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/) is enabled and how it is applied. If typo tolerance is true, `min`, or `strict`, [word splitting and concatenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation/) are also active.
|
|
100
|
+
*/
|
|
101
|
+
type TypoTolerance = boolean | TypoToleranceEnum;
|
|
102
|
+
|
|
103
|
+
type BaseInjectionQueryParameters = {
|
|
104
|
+
/**
|
|
105
|
+
* Whether to support phrase matching and excluding words from search queries Use the `advancedSyntaxFeatures` parameter to control which feature is supported.
|
|
106
|
+
*/
|
|
107
|
+
advancedSyntax?: boolean | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* Advanced search syntax features you want to support - `exactPhrase`. Phrases in quotes must match exactly. For example, `sparkly blue \"iPhone case\"` only returns records with the exact string \"iPhone case\" - `excludeWords`. Query words prefixed with a `-` must not occur in a record. For example, `search -engine` matches records that contain \"search\" but not \"engine\" This setting only has an effect if `advancedSyntax` is true.
|
|
110
|
+
*/
|
|
111
|
+
advancedSyntaxFeatures?: Array<AdvancedSyntaxFeatures> | undefined;
|
|
112
|
+
/**
|
|
113
|
+
* Whether to allow typos on numbers in the search query Turn off this setting to reduce the number of irrelevant matches when searching in large sets of similar numbers.
|
|
114
|
+
*/
|
|
115
|
+
allowTyposOnNumericTokens?: boolean | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* 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.
|
|
118
|
+
*/
|
|
119
|
+
alternativesAsExact?: Array<AlternativesAsExact> | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Whether this search will be included in Analytics.
|
|
122
|
+
*/
|
|
123
|
+
analytics?: boolean | undefined;
|
|
124
|
+
/**
|
|
125
|
+
* Whether the best matching attribute should be determined by minimum proximity This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting.
|
|
126
|
+
*/
|
|
127
|
+
attributeCriteriaComputedByMinProximity?: boolean | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* Attributes to highlight By default, all searchable attributes are highlighted. Use `*` to highlight all attributes or use an empty array `[]` to turn off highlighting. Attribute names are case-sensitive With highlighting, strings that match the search query are surrounded by HTML tags defined by `highlightPreTag` and `highlightPostTag`. You can use this to visually highlight matching parts of a search query in your UI For more information, see [Highlighting and snippeting](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/highlighting-snippeting/js/).
|
|
130
|
+
*/
|
|
131
|
+
attributesToHighlight?: Array<string> | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* Attributes to include in the API response To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included.
|
|
134
|
+
*/
|
|
135
|
+
attributesToRetrieve?: Array<string> | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* Attributes for which to enable snippets. Attribute names are case-sensitive Snippets provide additional context to matched words. If you enable snippets, they include 10 words, including the matched word. The matched word will also be wrapped by HTML tags for highlighting. You can adjust the number of words with the following notation: `ATTRIBUTE:NUMBER`, where `NUMBER` is the number of words to be extracted.
|
|
138
|
+
*/
|
|
139
|
+
attributesToSnippet?: Array<string> | undefined;
|
|
140
|
+
/**
|
|
141
|
+
* Whether to include a `queryID` attribute in the response The query ID is a unique identifier for a search query and is required for tracking [click and conversion events](https://www.algolia.com/guides/sending-events/getting-started/).
|
|
142
|
+
*/
|
|
143
|
+
clickAnalytics?: boolean | undefined;
|
|
144
|
+
/**
|
|
145
|
+
* Whether to split compound words in the query into their building blocks For more information, see [Word segmentation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#splitting-compound-words). Word segmentation is supported for these languages: German, Dutch, Finnish, Swedish, and Norwegian. Decompounding doesn\'t work for words with [non-spacing mark Unicode characters](https://www.charactercodes.net/category/non-spacing_mark). For example, `Gartenstühle` won\'t be decompounded if the `ü` consists of `u` (U+0075) and `◌̈` (U+0308).
|
|
146
|
+
*/
|
|
147
|
+
decompoundQuery?: boolean | undefined;
|
|
148
|
+
/**
|
|
149
|
+
* Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking.
|
|
150
|
+
*/
|
|
151
|
+
disableExactOnAttributes?: Array<string> | undefined;
|
|
152
|
+
/**
|
|
153
|
+
* Attributes for which you want to turn off [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/). Attribute names are case-sensitive Returning only exact matches can help when - [Searching in hyphenated attributes](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/how-to/how-to-search-in-hyphenated-attributes/). - Reducing the number of matches when you have too many. This can happen with attributes that are long blocks of text, such as product descriptions Consider alternatives such as `disableTypoToleranceOnWords` or adding synonyms if your attributes have intentional unusual spellings that might look like typos.
|
|
154
|
+
*/
|
|
155
|
+
disableTypoToleranceOnAttributes?: Array<string> | undefined;
|
|
156
|
+
distinct?: Distinct | undefined;
|
|
157
|
+
/**
|
|
158
|
+
* Whether to enable A/B testing for this search.
|
|
159
|
+
*/
|
|
160
|
+
enableABTest?: boolean | undefined;
|
|
161
|
+
/**
|
|
162
|
+
* Whether to enable Personalization.
|
|
163
|
+
*/
|
|
164
|
+
enablePersonalization?: boolean | undefined;
|
|
165
|
+
/**
|
|
166
|
+
* Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/) This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard.
|
|
167
|
+
*/
|
|
168
|
+
enableReRanking?: boolean | undefined;
|
|
169
|
+
/**
|
|
170
|
+
* Whether to enable rules.
|
|
171
|
+
*/
|
|
172
|
+
enableRules?: boolean | undefined;
|
|
173
|
+
exactOnSingleWordQuery?: ExactOnSingleWordQuery | undefined;
|
|
174
|
+
facetFilters?: FacetFilters | undefined;
|
|
175
|
+
/**
|
|
176
|
+
* Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `<facet>:<lower> TO <upper>` where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive). - **Facet filters.** `<facet>:<value>` where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value. - **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive). - **Boolean filters.** `<facet>: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can\'t use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can\'t combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/).
|
|
177
|
+
*/
|
|
178
|
+
filters?: string | undefined;
|
|
179
|
+
/**
|
|
180
|
+
* Whether the search response should include detailed ranking information.
|
|
181
|
+
*/
|
|
182
|
+
getRankingInfo?: boolean | undefined;
|
|
183
|
+
/**
|
|
184
|
+
* HTML tag to insert after the highlighted parts in all highlighted results and snippets.
|
|
185
|
+
*/
|
|
186
|
+
highlightPostTag?: string | undefined;
|
|
187
|
+
/**
|
|
188
|
+
* HTML tag to insert before the highlighted parts in all highlighted results and snippets.
|
|
189
|
+
*/
|
|
190
|
+
highlightPreTag?: string | undefined;
|
|
191
|
+
ignorePlurals?: IgnorePlurals | undefined;
|
|
192
|
+
/**
|
|
193
|
+
* Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values).
|
|
194
|
+
*/
|
|
195
|
+
maxFacetHits?: number | undefined;
|
|
196
|
+
/**
|
|
197
|
+
* Minimum proximity score for two matching words This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score.
|
|
198
|
+
*/
|
|
199
|
+
minProximity?: number | undefined;
|
|
200
|
+
/**
|
|
201
|
+
* Minimum number of characters a word in the search query must contain to accept matches with [one typo](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos).
|
|
202
|
+
*/
|
|
203
|
+
minWordSizefor1Typo?: number | undefined;
|
|
204
|
+
/**
|
|
205
|
+
* Minimum number of characters a word in the search query must contain to accept matches with [two typos](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos).
|
|
206
|
+
*/
|
|
207
|
+
minWordSizefor2Typos?: number | undefined;
|
|
208
|
+
/**
|
|
209
|
+
* ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches) - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`.
|
|
210
|
+
*/
|
|
211
|
+
naturalLanguages?: Array<SupportedLanguage> | undefined;
|
|
212
|
+
numericFilters?: NumericFilters | undefined;
|
|
213
|
+
optionalFilters?: OptionalFilters | undefined;
|
|
214
|
+
optionalWords?: OptionalWords | null | undefined;
|
|
215
|
+
/**
|
|
216
|
+
* Whether to include this search when calculating processing-time percentiles.
|
|
217
|
+
*/
|
|
218
|
+
percentileComputation?: boolean | undefined;
|
|
219
|
+
/**
|
|
220
|
+
* Impact that Personalization should have on this search The higher this value is, the more Personalization determines the ranking compared to other factors. For more information, see [Understanding Personalization impact](https://www.algolia.com/doc/guides/personalization/personalizing-results/in-depth/configuring-personalization/#understanding-personalization-impact).
|
|
221
|
+
*/
|
|
222
|
+
personalizationImpact?: number | undefined;
|
|
223
|
+
/**
|
|
224
|
+
* Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries This setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals` settings. This setting also sets a dictionary for word detection in the logogram-based [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) languages. To support this, you must place the CJK language **first** **You should always specify a query language.** If you don\'t specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages/), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/).
|
|
225
|
+
*/
|
|
226
|
+
queryLanguages?: Array<SupportedLanguage> | undefined;
|
|
227
|
+
queryType?: QueryType | undefined;
|
|
228
|
+
removeStopWords?: RemoveStopWords | undefined;
|
|
229
|
+
removeWordsIfNoResults?: RemoveWordsIfNoResults | undefined;
|
|
230
|
+
/**
|
|
231
|
+
* Whether to replace a highlighted word with the matched synonym By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of \"house\" are replaced by \"home\" in the highlighted response.
|
|
232
|
+
*/
|
|
233
|
+
replaceSynonymsInHighlight?: boolean | undefined;
|
|
234
|
+
/**
|
|
235
|
+
* Properties to include in the API response of search and browse requests By default, all response properties are included. To reduce the response size, you can select which properties should be included An empty list may lead to an empty API response (except properties you can\'t exclude) You can\'t exclude these properties: `message`, `warning`, `cursor`, `abTestVariantID`, or any property added by setting `getRankingInfo` to true Your search depends on the `hits` field. If you omit this field, searches won\'t return any results. Your UI might also depend on other properties, for example, for pagination. Before restricting the response size, check the impact on your search experience.
|
|
236
|
+
*/
|
|
237
|
+
responseFields?: Array<string> | undefined;
|
|
238
|
+
/**
|
|
239
|
+
* Whether to restrict highlighting and snippeting to items that at least partially matched the search query. By default, all items are highlighted and snippeted.
|
|
240
|
+
*/
|
|
241
|
+
restrictHighlightAndSnippetArrays?: boolean | undefined;
|
|
242
|
+
/**
|
|
243
|
+
* Restricts a search to a subset of your searchable attributes. Attribute names are case-sensitive.
|
|
244
|
+
*/
|
|
245
|
+
restrictSearchableAttributes?: Array<string> | undefined;
|
|
246
|
+
/**
|
|
247
|
+
* Assigns a rule context to the search query [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules.
|
|
248
|
+
*/
|
|
249
|
+
ruleContexts?: Array<string> | undefined;
|
|
250
|
+
/**
|
|
251
|
+
* String used as an ellipsis indicator when a snippet is truncated.
|
|
252
|
+
*/
|
|
253
|
+
snippetEllipsisText?: string | undefined;
|
|
254
|
+
/**
|
|
255
|
+
* Whether to take into account an index\'s synonyms for this search.
|
|
256
|
+
*/
|
|
257
|
+
synonyms?: boolean | undefined;
|
|
258
|
+
typoTolerance?: TypoTolerance | undefined;
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
type ExternalOrdering = 'default' | 'userDefined';
|
|
262
|
+
|
|
263
|
+
type External = {
|
|
264
|
+
/**
|
|
265
|
+
* Composition Index name.
|
|
266
|
+
*/
|
|
267
|
+
index: string;
|
|
268
|
+
params?: BaseInjectionQueryParameters | undefined;
|
|
269
|
+
ordering?: ExternalOrdering | undefined;
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Injected items will originate from externally provided objectIDs (that must exist in the index) given at runtime in the run request payload.
|
|
274
|
+
*/
|
|
275
|
+
type ExternalSource = {
|
|
276
|
+
external: External;
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
type Search = {
|
|
280
|
+
/**
|
|
281
|
+
* Composition Index name.
|
|
282
|
+
*/
|
|
283
|
+
index: string;
|
|
284
|
+
params?: BaseInjectionQueryParameters | undefined;
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Injected items will originate from a search request performed on the specified index.
|
|
289
|
+
*/
|
|
290
|
+
type SearchSource = {
|
|
291
|
+
search: Search;
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
type InjectedItemSource = SearchSource | ExternalSource;
|
|
295
|
+
|
|
296
|
+
type InjectedItem = {
|
|
297
|
+
/**
|
|
298
|
+
* injected Item unique identifier.
|
|
299
|
+
*/
|
|
300
|
+
key: string;
|
|
301
|
+
source: InjectedItemSource;
|
|
302
|
+
position: number;
|
|
303
|
+
length: number;
|
|
304
|
+
metadata?: InjectedItemMetadata | undefined;
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
type MainInjectionQueryParameters = BaseInjectionQueryParameters & Record<string, unknown>;
|
|
308
|
+
|
|
309
|
+
type CompositionSourceSearch = {
|
|
310
|
+
/**
|
|
311
|
+
* Composition Main Index name.
|
|
312
|
+
*/
|
|
313
|
+
index: string;
|
|
314
|
+
params?: MainInjectionQueryParameters | undefined;
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
type CompositionSource = {
|
|
318
|
+
search: CompositionSourceSearch;
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
type Main = {
|
|
322
|
+
source: CompositionSource;
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
type Injection = {
|
|
326
|
+
main: Main;
|
|
327
|
+
/**
|
|
328
|
+
* list of injected items of the current Composition.
|
|
329
|
+
*/
|
|
330
|
+
injectedItems?: Array<InjectedItem> | undefined;
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
type CompositionBehavior = {
|
|
334
|
+
injection: Injection;
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
type Composition = {
|
|
338
|
+
/**
|
|
339
|
+
* Composition unique identifier.
|
|
340
|
+
*/
|
|
341
|
+
objectID: string;
|
|
342
|
+
/**
|
|
343
|
+
* Composition name.
|
|
344
|
+
*/
|
|
345
|
+
name: string;
|
|
346
|
+
/**
|
|
347
|
+
* Composition description.
|
|
348
|
+
*/
|
|
349
|
+
description?: string | undefined;
|
|
350
|
+
behavior: CompositionBehavior;
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Operation arguments when deleting.
|
|
355
|
+
*/
|
|
356
|
+
type DeleteCompositionAction = {
|
|
357
|
+
/**
|
|
358
|
+
* Composition unique identifier.
|
|
359
|
+
*/
|
|
360
|
+
objectID: string;
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
type BatchCompositionAction = Composition | DeleteCompositionAction;
|
|
364
|
+
|
|
365
|
+
type MultipleBatchRequest = {
|
|
366
|
+
action: Action;
|
|
367
|
+
body: BatchCompositionAction;
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Batch parameters.
|
|
372
|
+
*/
|
|
373
|
+
type BatchParams = {
|
|
374
|
+
requests: Array<MultipleBatchRequest>;
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Effect of the rule.
|
|
379
|
+
*/
|
|
380
|
+
type CompositionRuleConsequence = {
|
|
381
|
+
behavior: CompositionBehavior;
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Which part of the search query the pattern should match: - `startsWith`. The pattern must match the beginning of the query. - `endsWith`. The pattern must match the end of the query. - `is`. The pattern must match the query exactly. - `contains`. The pattern must match anywhere in the query. Empty queries are only allowed as patterns with `anchoring: is`.
|
|
386
|
+
*/
|
|
387
|
+
type Anchoring = 'is' | 'startsWith' | 'endsWith' | 'contains';
|
|
388
|
+
|
|
389
|
+
type Condition = {
|
|
390
|
+
/**
|
|
391
|
+
* Query pattern that triggers the rule. You can use either a literal string, or a special pattern `{facet:ATTRIBUTE}`, where `ATTRIBUTE` is a facet name. The rule is triggered if the query matches the literal string or a value of the specified facet. For example, with `pattern: {facet:genre}`, the rule is triggered when users search for a genre, such as \"comedy\".
|
|
392
|
+
*/
|
|
393
|
+
pattern?: string | undefined;
|
|
394
|
+
anchoring?: Anchoring | undefined;
|
|
395
|
+
/**
|
|
396
|
+
* An additional restriction that only triggers the rule, when the search has the same value as `ruleContexts` parameter. For example, if `context: mobile`, the rule is only triggered when the search request has a matching `ruleContexts: mobile`. A rule context must only contain alphanumeric characters.
|
|
397
|
+
*/
|
|
398
|
+
context?: string | undefined;
|
|
399
|
+
/**
|
|
400
|
+
* Filters that trigger the rule. You can add add filters using the syntax `facet:value` so that the rule is triggered, when the specific filter is selected. You can use `filters` on its own or combine it with the `pattern` parameter.
|
|
401
|
+
*/
|
|
402
|
+
filters?: string | undefined;
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
type TimeRange = {
|
|
406
|
+
/**
|
|
407
|
+
* When the rule should start to be active, in Unix epoch time.
|
|
408
|
+
*/
|
|
409
|
+
from?: number | undefined;
|
|
410
|
+
/**
|
|
411
|
+
* When the rule should stop to be active, in Unix epoch time.
|
|
412
|
+
*/
|
|
413
|
+
until?: number | undefined;
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
type CompositionRule = {
|
|
417
|
+
/**
|
|
418
|
+
* Composition rule unique identifier.
|
|
419
|
+
*/
|
|
420
|
+
objectID: string;
|
|
421
|
+
/**
|
|
422
|
+
* Conditions that trigger a composition rule.
|
|
423
|
+
*/
|
|
424
|
+
conditions: Array<Condition>;
|
|
425
|
+
consequence: CompositionRuleConsequence;
|
|
426
|
+
/**
|
|
427
|
+
* Description of the rule\'s purpose to help you distinguish between different rules.
|
|
428
|
+
*/
|
|
429
|
+
description?: string | undefined;
|
|
430
|
+
/**
|
|
431
|
+
* Whether the rule is active.
|
|
432
|
+
*/
|
|
433
|
+
enabled?: boolean | undefined;
|
|
434
|
+
/**
|
|
435
|
+
* Time periods when the rule is active.
|
|
436
|
+
*/
|
|
437
|
+
validity?: Array<TimeRange> | undefined;
|
|
438
|
+
/**
|
|
439
|
+
* A list of tags.
|
|
440
|
+
*/
|
|
441
|
+
tags?: Array<string> | undefined;
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Task status, `published` if the task is completed, `notPublished` otherwise.
|
|
446
|
+
*/
|
|
447
|
+
type TaskStatus = 'published' | 'notPublished';
|
|
448
|
+
|
|
449
|
+
type GetTaskResponse = {
|
|
450
|
+
status: TaskStatus;
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
type ListCompositionsResponse = {
|
|
454
|
+
/**
|
|
455
|
+
* All compositions in your Algolia application.
|
|
456
|
+
*/
|
|
457
|
+
items: Array<Composition>;
|
|
458
|
+
/**
|
|
459
|
+
* Number of pages.
|
|
460
|
+
*/
|
|
461
|
+
nbPages: number;
|
|
462
|
+
/**
|
|
463
|
+
* Current page.
|
|
464
|
+
*/
|
|
465
|
+
page: number;
|
|
466
|
+
/**
|
|
467
|
+
* Number of items per page.
|
|
468
|
+
*/
|
|
469
|
+
hitsPerPage: number;
|
|
470
|
+
/**
|
|
471
|
+
* Number of items.
|
|
472
|
+
*/
|
|
473
|
+
nbHits: number;
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
type MultipleBatchResponse = {
|
|
477
|
+
/**
|
|
478
|
+
* Task IDs. One for each index.
|
|
479
|
+
*/
|
|
480
|
+
taskID: {
|
|
481
|
+
[key: string]: number;
|
|
482
|
+
};
|
|
483
|
+
};
|
|
484
|
+
|
|
485
|
+
type RulesMultipleBatchResponse = {
|
|
486
|
+
/**
|
|
487
|
+
* Unique identifier of a task. A successful API response means that a task was added to a queue. It might not run immediately. You can check the task\'s progress with the [`task` operation](#tag/Indices/operation/getTask) and this `taskID`.
|
|
488
|
+
*/
|
|
489
|
+
taskID: number;
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
type SearchCompositionRulesResponse = {
|
|
493
|
+
/**
|
|
494
|
+
* Composition rules that matched the search criteria.
|
|
495
|
+
*/
|
|
496
|
+
hits: Array<CompositionRule>;
|
|
497
|
+
/**
|
|
498
|
+
* Number of composition rules that matched the search criteria.
|
|
499
|
+
*/
|
|
500
|
+
nbHits: number;
|
|
501
|
+
/**
|
|
502
|
+
* Current page.
|
|
503
|
+
*/
|
|
504
|
+
page: number;
|
|
505
|
+
/**
|
|
506
|
+
* Number of pages.
|
|
507
|
+
*/
|
|
508
|
+
nbPages: number;
|
|
509
|
+
};
|
|
510
|
+
|
|
4
511
|
type FacetHits = {
|
|
5
512
|
/**
|
|
6
513
|
* Facet value.
|
|
@@ -565,21 +1072,52 @@ type SearchPagination = {
|
|
|
565
1072
|
*/
|
|
566
1073
|
nbPages: number;
|
|
567
1074
|
/**
|
|
568
|
-
* Number of hits per page.
|
|
1075
|
+
* Number of hits per page.
|
|
1076
|
+
*/
|
|
1077
|
+
hitsPerPage: number;
|
|
1078
|
+
};
|
|
1079
|
+
|
|
1080
|
+
type SearchResultsItem<T = Record<string, unknown>> = BaseSearchResponse & SearchPagination & SearchHits<T> & ResultsCompositionsResponse;
|
|
1081
|
+
|
|
1082
|
+
type SearchResults<T = Record<string, unknown>> = {
|
|
1083
|
+
/**
|
|
1084
|
+
* Search results.
|
|
1085
|
+
*/
|
|
1086
|
+
results: SearchResultsItem<T>[];
|
|
1087
|
+
};
|
|
1088
|
+
|
|
1089
|
+
type SearchResponse<T = Record<string, unknown>> = CompositionBaseSearchResponse & SearchResults<T>;
|
|
1090
|
+
|
|
1091
|
+
type TaskIDResponse = {
|
|
1092
|
+
/**
|
|
1093
|
+
* Unique identifier of a task. A successful API response means that a task was added to a queue. It might not run immediately. You can check the task\'s progress with the [`task` operation](#tag/Indices/operation/getTask) and this `taskID`.
|
|
569
1094
|
*/
|
|
570
|
-
|
|
1095
|
+
taskID: number;
|
|
571
1096
|
};
|
|
572
1097
|
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
1098
|
+
/**
|
|
1099
|
+
* Operation arguments when deleting.
|
|
1100
|
+
*/
|
|
1101
|
+
type DeleteCompositionRuleAction = {
|
|
576
1102
|
/**
|
|
577
|
-
*
|
|
1103
|
+
* Composition rule unique identifier.
|
|
578
1104
|
*/
|
|
579
|
-
|
|
1105
|
+
objectID: string;
|
|
580
1106
|
};
|
|
581
1107
|
|
|
582
|
-
type
|
|
1108
|
+
type RulesBatchCompositionAction = CompositionRule | DeleteCompositionRuleAction;
|
|
1109
|
+
|
|
1110
|
+
type RulesMultipleBatchRequest = {
|
|
1111
|
+
action: Action;
|
|
1112
|
+
body: RulesBatchCompositionAction;
|
|
1113
|
+
};
|
|
1114
|
+
|
|
1115
|
+
/**
|
|
1116
|
+
* Composition rules batch parameters.
|
|
1117
|
+
*/
|
|
1118
|
+
type CompositionRulesBatchParams = {
|
|
1119
|
+
requests?: Array<RulesMultipleBatchRequest> | undefined;
|
|
1120
|
+
};
|
|
583
1121
|
|
|
584
1122
|
/**
|
|
585
1123
|
* Range object with lower and upper values in meters to define custom ranges.
|
|
@@ -627,28 +1165,8 @@ type ExternalInjectedItem = {
|
|
|
627
1165
|
items: Array<ExternalInjection>;
|
|
628
1166
|
};
|
|
629
1167
|
|
|
630
|
-
/**
|
|
631
|
-
* Filter the search by facet values, so that only records with the same facet values are retrieved. **Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.** - `[filter1, filter2]` is interpreted as `filter1 AND filter2`. - `[[filter1, filter2], filter3]` is interpreted as `filter1 OR filter2 AND filter3`. - `facet:-value` is interpreted as `NOT facet:value`. While it\'s best to avoid attributes that start with a `-`, you can still filter them by escaping with a backslash: `facet:\\-value`.
|
|
632
|
-
*/
|
|
633
|
-
type FacetFilters = Array<FacetFilters> | string;
|
|
634
|
-
|
|
635
1168
|
type InsideBoundingBox = string | Array<Array<number>>;
|
|
636
1169
|
|
|
637
|
-
/**
|
|
638
|
-
* Filter by numeric facets. **Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.** You can use numeric comparison operators: `<`, `<=`, `=`, `!=`, `>`, `>=`. Comparisons are precise up to 3 decimals. You can also provide ranges: `facet:<lower> TO <upper>`. The range includes the lower and upper boundaries. The same combination rules apply as for `facetFilters`.
|
|
639
|
-
*/
|
|
640
|
-
type NumericFilters = Array<NumericFilters> | string;
|
|
641
|
-
|
|
642
|
-
/**
|
|
643
|
-
* Filters to promote or demote records in the search results. Optional filters work like facet filters, but they don\'t exclude records from the search results. Records that match the optional filter rank before records that don\'t match. If you\'re using a negative filter `facet:-value`, matching records rank after records that don\'t match. - Optional filters don\'t work on virtual replicas. - Optional filters are applied _after_ sort-by attributes. - Optional filters are applied _before_ custom ranking attributes (in the default [ranking](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/)). - Optional filters don\'t work with numeric attributes.
|
|
644
|
-
*/
|
|
645
|
-
type OptionalFilters = Array<OptionalFilters> | string;
|
|
646
|
-
|
|
647
|
-
/**
|
|
648
|
-
* ISO code for a supported language.
|
|
649
|
-
*/
|
|
650
|
-
type SupportedLanguage = 'af' | 'ar' | 'az' | 'bg' | 'bn' | 'ca' | 'cs' | 'cy' | 'da' | 'de' | 'el' | 'en' | 'eo' | 'es' | 'et' | 'eu' | 'fa' | 'fi' | 'fo' | 'fr' | 'ga' | 'gl' | 'he' | 'hi' | 'hu' | 'hy' | 'id' | 'is' | 'it' | 'ja' | 'ka' | 'kk' | 'ko' | 'ku' | 'ky' | 'lt' | 'lv' | 'mi' | 'mn' | 'mr' | 'ms' | 'mt' | 'nb' | 'nl' | 'no' | 'ns' | 'pl' | 'ps' | 'pt' | 'pt-br' | 'qu' | 'ro' | 'ru' | 'sk' | 'sq' | 'sv' | 'sw' | 'ta' | 'te' | 'th' | 'tl' | 'tn' | 'tr' | 'tt' | 'uk' | 'ur' | 'uz' | 'zh';
|
|
651
|
-
|
|
652
1170
|
type Params = {
|
|
653
1171
|
/**
|
|
654
1172
|
* Search query.
|
|
@@ -748,6 +1266,33 @@ type RequestBody = {
|
|
|
748
1266
|
params?: Params | undefined;
|
|
749
1267
|
};
|
|
750
1268
|
|
|
1269
|
+
/**
|
|
1270
|
+
* Composition Rules search parameters.
|
|
1271
|
+
*/
|
|
1272
|
+
type SearchCompositionRulesParams = {
|
|
1273
|
+
/**
|
|
1274
|
+
* Search query for rules.
|
|
1275
|
+
*/
|
|
1276
|
+
query?: string | undefined;
|
|
1277
|
+
anchoring?: Anchoring | undefined;
|
|
1278
|
+
/**
|
|
1279
|
+
* Only return composition rules that match the context (exact match).
|
|
1280
|
+
*/
|
|
1281
|
+
context?: string | undefined;
|
|
1282
|
+
/**
|
|
1283
|
+
* 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.
|
|
1284
|
+
*/
|
|
1285
|
+
page?: number | undefined;
|
|
1286
|
+
/**
|
|
1287
|
+
* 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.
|
|
1288
|
+
*/
|
|
1289
|
+
hitsPerPage?: number | undefined;
|
|
1290
|
+
/**
|
|
1291
|
+
* If `true`, return only enabled composition rules. If `false`, return only inactive composition rules. By default, _all_ composition rules are returned.
|
|
1292
|
+
*/
|
|
1293
|
+
enabled?: boolean | null | undefined;
|
|
1294
|
+
};
|
|
1295
|
+
|
|
751
1296
|
type SearchForFacetValuesParams = {
|
|
752
1297
|
/**
|
|
753
1298
|
* Search query.
|
|
@@ -764,6 +1309,178 @@ type SearchForFacetValuesRequest = {
|
|
|
764
1309
|
params?: SearchForFacetValuesParams | undefined;
|
|
765
1310
|
};
|
|
766
1311
|
|
|
1312
|
+
/**
|
|
1313
|
+
* Properties for the `customDelete` method.
|
|
1314
|
+
*/
|
|
1315
|
+
type CustomDeleteProps = {
|
|
1316
|
+
/**
|
|
1317
|
+
* Path of the endpoint, for example `1/newFeature`.
|
|
1318
|
+
*/
|
|
1319
|
+
path: string;
|
|
1320
|
+
/**
|
|
1321
|
+
* Query parameters to apply to the current query.
|
|
1322
|
+
*/
|
|
1323
|
+
parameters?: {
|
|
1324
|
+
[key: string]: any;
|
|
1325
|
+
} | undefined;
|
|
1326
|
+
};
|
|
1327
|
+
/**
|
|
1328
|
+
* Properties for the `customGet` method.
|
|
1329
|
+
*/
|
|
1330
|
+
type CustomGetProps = {
|
|
1331
|
+
/**
|
|
1332
|
+
* Path of the endpoint, for example `1/newFeature`.
|
|
1333
|
+
*/
|
|
1334
|
+
path: string;
|
|
1335
|
+
/**
|
|
1336
|
+
* Query parameters to apply to the current query.
|
|
1337
|
+
*/
|
|
1338
|
+
parameters?: {
|
|
1339
|
+
[key: string]: any;
|
|
1340
|
+
} | undefined;
|
|
1341
|
+
};
|
|
1342
|
+
/**
|
|
1343
|
+
* Properties for the `customPost` method.
|
|
1344
|
+
*/
|
|
1345
|
+
type CustomPostProps = {
|
|
1346
|
+
/**
|
|
1347
|
+
* Path of the endpoint, for example `1/newFeature`.
|
|
1348
|
+
*/
|
|
1349
|
+
path: string;
|
|
1350
|
+
/**
|
|
1351
|
+
* Query parameters to apply to the current query.
|
|
1352
|
+
*/
|
|
1353
|
+
parameters?: {
|
|
1354
|
+
[key: string]: any;
|
|
1355
|
+
} | undefined;
|
|
1356
|
+
/**
|
|
1357
|
+
* Parameters to send with the custom request.
|
|
1358
|
+
*/
|
|
1359
|
+
body?: Record<string, unknown> | undefined;
|
|
1360
|
+
};
|
|
1361
|
+
/**
|
|
1362
|
+
* Properties for the `customPut` method.
|
|
1363
|
+
*/
|
|
1364
|
+
type CustomPutProps = {
|
|
1365
|
+
/**
|
|
1366
|
+
* Path of the endpoint, for example `1/newFeature`.
|
|
1367
|
+
*/
|
|
1368
|
+
path: string;
|
|
1369
|
+
/**
|
|
1370
|
+
* Query parameters to apply to the current query.
|
|
1371
|
+
*/
|
|
1372
|
+
parameters?: {
|
|
1373
|
+
[key: string]: any;
|
|
1374
|
+
} | undefined;
|
|
1375
|
+
/**
|
|
1376
|
+
* Parameters to send with the custom request.
|
|
1377
|
+
*/
|
|
1378
|
+
body?: Record<string, unknown> | undefined;
|
|
1379
|
+
};
|
|
1380
|
+
/**
|
|
1381
|
+
* Properties for the `deleteComposition` method.
|
|
1382
|
+
*/
|
|
1383
|
+
type DeleteCompositionProps = {
|
|
1384
|
+
/**
|
|
1385
|
+
* Unique Composition ObjectID.
|
|
1386
|
+
*/
|
|
1387
|
+
compositionID: string;
|
|
1388
|
+
};
|
|
1389
|
+
/**
|
|
1390
|
+
* Properties for the `deleteCompositionRule` method.
|
|
1391
|
+
*/
|
|
1392
|
+
type DeleteCompositionRuleProps = {
|
|
1393
|
+
/**
|
|
1394
|
+
* Unique Composition ObjectID.
|
|
1395
|
+
*/
|
|
1396
|
+
compositionID: string;
|
|
1397
|
+
/**
|
|
1398
|
+
* Unique identifier of a rule object.
|
|
1399
|
+
*/
|
|
1400
|
+
objectID: string;
|
|
1401
|
+
};
|
|
1402
|
+
/**
|
|
1403
|
+
* Properties for the `getComposition` method.
|
|
1404
|
+
*/
|
|
1405
|
+
type GetCompositionProps = {
|
|
1406
|
+
/**
|
|
1407
|
+
* Unique Composition ObjectID.
|
|
1408
|
+
*/
|
|
1409
|
+
compositionID: string;
|
|
1410
|
+
};
|
|
1411
|
+
/**
|
|
1412
|
+
* Properties for the `getRule` method.
|
|
1413
|
+
*/
|
|
1414
|
+
type GetRuleProps = {
|
|
1415
|
+
/**
|
|
1416
|
+
* Unique Composition ObjectID.
|
|
1417
|
+
*/
|
|
1418
|
+
compositionID: string;
|
|
1419
|
+
/**
|
|
1420
|
+
* Unique identifier of a rule object.
|
|
1421
|
+
*/
|
|
1422
|
+
objectID: string;
|
|
1423
|
+
};
|
|
1424
|
+
/**
|
|
1425
|
+
* Properties for the `getTask` method.
|
|
1426
|
+
*/
|
|
1427
|
+
type GetTaskProps = {
|
|
1428
|
+
/**
|
|
1429
|
+
* Unique Composition ObjectID.
|
|
1430
|
+
*/
|
|
1431
|
+
compositionID: string;
|
|
1432
|
+
/**
|
|
1433
|
+
* Unique task identifier.
|
|
1434
|
+
*/
|
|
1435
|
+
taskID: number;
|
|
1436
|
+
};
|
|
1437
|
+
/**
|
|
1438
|
+
* Properties for the `listCompositions` method.
|
|
1439
|
+
*/
|
|
1440
|
+
type ListCompositionsProps = {
|
|
1441
|
+
/**
|
|
1442
|
+
* Requested page of the API response. If `null`, the API response is not paginated.
|
|
1443
|
+
*/
|
|
1444
|
+
page?: number | undefined;
|
|
1445
|
+
/**
|
|
1446
|
+
* Number of hits per page.
|
|
1447
|
+
*/
|
|
1448
|
+
hitsPerPage?: number | undefined;
|
|
1449
|
+
};
|
|
1450
|
+
/**
|
|
1451
|
+
* Properties for the `putComposition` method.
|
|
1452
|
+
*/
|
|
1453
|
+
type PutCompositionProps = {
|
|
1454
|
+
/**
|
|
1455
|
+
* Unique Composition ObjectID.
|
|
1456
|
+
*/
|
|
1457
|
+
compositionID: string;
|
|
1458
|
+
composition: Composition;
|
|
1459
|
+
};
|
|
1460
|
+
/**
|
|
1461
|
+
* Properties for the `putCompositionRule` method.
|
|
1462
|
+
*/
|
|
1463
|
+
type PutCompositionRuleProps = {
|
|
1464
|
+
/**
|
|
1465
|
+
* Unique Composition ObjectID.
|
|
1466
|
+
*/
|
|
1467
|
+
compositionID: string;
|
|
1468
|
+
/**
|
|
1469
|
+
* Unique identifier of a rule object.
|
|
1470
|
+
*/
|
|
1471
|
+
objectID: string;
|
|
1472
|
+
compositionRule: CompositionRule;
|
|
1473
|
+
};
|
|
1474
|
+
/**
|
|
1475
|
+
* Properties for the `saveRules` method.
|
|
1476
|
+
*/
|
|
1477
|
+
type SaveRulesProps = {
|
|
1478
|
+
/**
|
|
1479
|
+
* Unique Composition ObjectID.
|
|
1480
|
+
*/
|
|
1481
|
+
compositionID: string;
|
|
1482
|
+
rules: CompositionRulesBatchParams;
|
|
1483
|
+
};
|
|
767
1484
|
/**
|
|
768
1485
|
* Properties for the `search` method.
|
|
769
1486
|
*/
|
|
@@ -774,6 +1491,16 @@ type SearchProps = {
|
|
|
774
1491
|
compositionID: string;
|
|
775
1492
|
requestBody: RequestBody;
|
|
776
1493
|
};
|
|
1494
|
+
/**
|
|
1495
|
+
* Properties for the `searchCompositionRules` method.
|
|
1496
|
+
*/
|
|
1497
|
+
type SearchCompositionRulesProps = {
|
|
1498
|
+
/**
|
|
1499
|
+
* Unique Composition ObjectID.
|
|
1500
|
+
*/
|
|
1501
|
+
compositionID: string;
|
|
1502
|
+
searchCompositionRulesParams?: SearchCompositionRulesParams | undefined;
|
|
1503
|
+
};
|
|
777
1504
|
/**
|
|
778
1505
|
* Properties for the `searchForFacetValues` method.
|
|
779
1506
|
*/
|
|
@@ -788,8 +1515,26 @@ type SearchForFacetValuesProps = {
|
|
|
788
1515
|
facetName: string;
|
|
789
1516
|
searchForFacetValuesRequest?: SearchForFacetValuesRequest | undefined;
|
|
790
1517
|
};
|
|
1518
|
+
type WaitForCompositionTaskOptions = {
|
|
1519
|
+
/**
|
|
1520
|
+
* The maximum number of retries. 50 by default.
|
|
1521
|
+
*/
|
|
1522
|
+
maxRetries?: number | undefined;
|
|
1523
|
+
/**
|
|
1524
|
+
* The function to decide how long to wait between retries.
|
|
1525
|
+
*/
|
|
1526
|
+
timeout?: (retryCount: number) => number;
|
|
1527
|
+
/**
|
|
1528
|
+
* The `taskID` returned by the method response.
|
|
1529
|
+
*/
|
|
1530
|
+
taskID: number;
|
|
1531
|
+
/**
|
|
1532
|
+
* The `compositionID` where the operation was performed.
|
|
1533
|
+
*/
|
|
1534
|
+
compositionID: string;
|
|
1535
|
+
};
|
|
791
1536
|
|
|
792
|
-
declare const apiClientVersion = "1.
|
|
1537
|
+
declare const apiClientVersion = "1.15.0";
|
|
793
1538
|
declare function createCompositionClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
|
794
1539
|
transporter: _algolia_client_common.Transporter;
|
|
795
1540
|
/**
|
|
@@ -824,6 +1569,166 @@ declare function createCompositionClient({ appId: appIdOption, apiKey: apiKeyOpt
|
|
|
824
1569
|
setClientApiKey({ apiKey }: {
|
|
825
1570
|
apiKey: string;
|
|
826
1571
|
}): void;
|
|
1572
|
+
/**
|
|
1573
|
+
* Helper: Wait for a composition-level task to be published (completed) for a given `compositionID` and `taskID`.
|
|
1574
|
+
*
|
|
1575
|
+
* @summary Helper method that waits for a task to be published (completed).
|
|
1576
|
+
* @param WaitForCompositionTaskOptions - The `WaitForCompositionTaskOptions` object.
|
|
1577
|
+
* @param WaitForCompositionTaskOptions.compositionID - The `compositionID` where the operation was performed.
|
|
1578
|
+
* @param WaitForCompositionTaskOptions.taskID - The `taskID` returned in the method response.
|
|
1579
|
+
* @param WaitForCompositionTaskOptions.maxRetries - The maximum number of retries. 50 by default.
|
|
1580
|
+
* @param WaitForCompositionTaskOptions.timeout - The function to decide how long to wait between retries.
|
|
1581
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
|
|
1582
|
+
*/
|
|
1583
|
+
waitForCompositionTask({ compositionID, taskID, maxRetries, timeout, }: WaitForCompositionTaskOptions, requestOptions?: RequestOptions): Promise<GetTaskResponse>;
|
|
1584
|
+
/**
|
|
1585
|
+
* This method lets you send requests to the Algolia REST API.
|
|
1586
|
+
* @param customDelete - The customDelete object.
|
|
1587
|
+
* @param customDelete.path - Path of the endpoint, for example `1/newFeature`.
|
|
1588
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
1589
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1590
|
+
*/
|
|
1591
|
+
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
1592
|
+
/**
|
|
1593
|
+
* This method lets you send requests to the Algolia REST API.
|
|
1594
|
+
* @param customGet - The customGet object.
|
|
1595
|
+
* @param customGet.path - Path of the endpoint, for example `1/newFeature`.
|
|
1596
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
1597
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1598
|
+
*/
|
|
1599
|
+
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
1600
|
+
/**
|
|
1601
|
+
* This method lets you send requests to the Algolia REST API.
|
|
1602
|
+
* @param customPost - The customPost object.
|
|
1603
|
+
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
|
|
1604
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
1605
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
1606
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1607
|
+
*/
|
|
1608
|
+
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
1609
|
+
/**
|
|
1610
|
+
* This method lets you send requests to the Algolia REST API.
|
|
1611
|
+
* @param customPut - The customPut object.
|
|
1612
|
+
* @param customPut.path - Path of the endpoint, for example `1/newFeature`.
|
|
1613
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
1614
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
1615
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1616
|
+
*/
|
|
1617
|
+
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
1618
|
+
/**
|
|
1619
|
+
* Delete a composition from the current Algolia application.
|
|
1620
|
+
*
|
|
1621
|
+
* Required API Key ACLs:
|
|
1622
|
+
* - editSettings
|
|
1623
|
+
* @param deleteComposition - The deleteComposition object.
|
|
1624
|
+
* @param deleteComposition.compositionID - Unique Composition ObjectID.
|
|
1625
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1626
|
+
*/
|
|
1627
|
+
deleteComposition({ compositionID }: DeleteCompositionProps, requestOptions?: RequestOptions): Promise<TaskIDResponse>;
|
|
1628
|
+
/**
|
|
1629
|
+
* Delete a Composition Rule from the specified Composition ID.
|
|
1630
|
+
*
|
|
1631
|
+
* Required API Key ACLs:
|
|
1632
|
+
* - editSettings
|
|
1633
|
+
* @param deleteCompositionRule - The deleteCompositionRule object.
|
|
1634
|
+
* @param deleteCompositionRule.compositionID - Unique Composition ObjectID.
|
|
1635
|
+
* @param deleteCompositionRule.objectID - Unique identifier of a rule object.
|
|
1636
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1637
|
+
*/
|
|
1638
|
+
deleteCompositionRule({ compositionID, objectID }: DeleteCompositionRuleProps, requestOptions?: RequestOptions): Promise<TaskIDResponse>;
|
|
1639
|
+
/**
|
|
1640
|
+
* Retrieve a single composition in the current Algolia application.
|
|
1641
|
+
*
|
|
1642
|
+
* Required API Key ACLs:
|
|
1643
|
+
* - editSettings
|
|
1644
|
+
* - settings
|
|
1645
|
+
* @param getComposition - The getComposition object.
|
|
1646
|
+
* @param getComposition.compositionID - Unique Composition ObjectID.
|
|
1647
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1648
|
+
*/
|
|
1649
|
+
getComposition({ compositionID }: GetCompositionProps, requestOptions?: RequestOptions): Promise<Composition>;
|
|
1650
|
+
/**
|
|
1651
|
+
* Retrieves a rule by its ID. To find the object ID of rules, use the [`search` operation](#tag/Rules/operation/searchRules).
|
|
1652
|
+
*
|
|
1653
|
+
* Required API Key ACLs:
|
|
1654
|
+
* - editSettings
|
|
1655
|
+
* - settings
|
|
1656
|
+
* @param getRule - The getRule object.
|
|
1657
|
+
* @param getRule.compositionID - Unique Composition ObjectID.
|
|
1658
|
+
* @param getRule.objectID - Unique identifier of a rule object.
|
|
1659
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1660
|
+
*/
|
|
1661
|
+
getRule({ compositionID, objectID }: GetRuleProps, requestOptions?: RequestOptions): Promise<CompositionRule>;
|
|
1662
|
+
/**
|
|
1663
|
+
* Checks the status of a given task.
|
|
1664
|
+
*
|
|
1665
|
+
* Required API Key ACLs:
|
|
1666
|
+
* - editSettings
|
|
1667
|
+
* - settings
|
|
1668
|
+
* - addObject
|
|
1669
|
+
* - deleteObject
|
|
1670
|
+
* - deleteIndex
|
|
1671
|
+
* @param getTask - The getTask object.
|
|
1672
|
+
* @param getTask.compositionID - Unique Composition ObjectID.
|
|
1673
|
+
* @param getTask.taskID - Unique task identifier.
|
|
1674
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1675
|
+
*/
|
|
1676
|
+
getTask({ compositionID, taskID }: GetTaskProps, requestOptions?: RequestOptions): Promise<GetTaskResponse>;
|
|
1677
|
+
/**
|
|
1678
|
+
* Lists all compositions in the current Algolia application.
|
|
1679
|
+
*
|
|
1680
|
+
* Required API Key ACLs:
|
|
1681
|
+
* - editSettings
|
|
1682
|
+
* - settings
|
|
1683
|
+
* @param listCompositions - The listCompositions object.
|
|
1684
|
+
* @param listCompositions.page - Requested page of the API response. If `null`, the API response is not paginated.
|
|
1685
|
+
* @param listCompositions.hitsPerPage - Number of hits per page.
|
|
1686
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1687
|
+
*/
|
|
1688
|
+
listCompositions({ page, hitsPerPage }?: ListCompositionsProps, requestOptions?: RequestOptions | undefined): Promise<ListCompositionsResponse>;
|
|
1689
|
+
/**
|
|
1690
|
+
* Adds, updates, or deletes compositions with a single API request.
|
|
1691
|
+
*
|
|
1692
|
+
* Required API Key ACLs:
|
|
1693
|
+
* - editSettings
|
|
1694
|
+
* @param batchParams - The batchParams object.
|
|
1695
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1696
|
+
*/
|
|
1697
|
+
multipleBatch(batchParams: BatchParams, requestOptions?: RequestOptions): Promise<MultipleBatchResponse>;
|
|
1698
|
+
/**
|
|
1699
|
+
* Upsert a composition in the current Algolia application.
|
|
1700
|
+
*
|
|
1701
|
+
* Required API Key ACLs:
|
|
1702
|
+
* - editSettings
|
|
1703
|
+
* @param putComposition - The putComposition object.
|
|
1704
|
+
* @param putComposition.compositionID - Unique Composition ObjectID.
|
|
1705
|
+
* @param putComposition.composition - The composition object.
|
|
1706
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1707
|
+
*/
|
|
1708
|
+
putComposition({ compositionID, composition }: PutCompositionProps, requestOptions?: RequestOptions): Promise<TaskIDResponse>;
|
|
1709
|
+
/**
|
|
1710
|
+
* Upsert a Composition Rule for the specified composition ID.
|
|
1711
|
+
*
|
|
1712
|
+
* Required API Key ACLs:
|
|
1713
|
+
* - editSettings
|
|
1714
|
+
* @param putCompositionRule - The putCompositionRule object.
|
|
1715
|
+
* @param putCompositionRule.compositionID - Unique Composition ObjectID.
|
|
1716
|
+
* @param putCompositionRule.objectID - Unique identifier of a rule object.
|
|
1717
|
+
* @param putCompositionRule.compositionRule - The compositionRule object.
|
|
1718
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1719
|
+
*/
|
|
1720
|
+
putCompositionRule({ compositionID, objectID, compositionRule }: PutCompositionRuleProps, requestOptions?: RequestOptions): Promise<TaskIDResponse>;
|
|
1721
|
+
/**
|
|
1722
|
+
* Create or update or delete multiple composition rules.
|
|
1723
|
+
*
|
|
1724
|
+
* Required API Key ACLs:
|
|
1725
|
+
* - editSettings
|
|
1726
|
+
* @param saveRules - The saveRules object.
|
|
1727
|
+
* @param saveRules.compositionID - Unique Composition ObjectID.
|
|
1728
|
+
* @param saveRules.rules - The rules object.
|
|
1729
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1730
|
+
*/
|
|
1731
|
+
saveRules({ compositionID, rules }: SaveRulesProps, requestOptions?: RequestOptions): Promise<RulesMultipleBatchResponse>;
|
|
827
1732
|
/**
|
|
828
1733
|
* Runs a query on a single composition and returns matching results.
|
|
829
1734
|
*
|
|
@@ -835,6 +1740,17 @@ declare function createCompositionClient({ appId: appIdOption, apiKey: apiKeyOpt
|
|
|
835
1740
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
836
1741
|
*/
|
|
837
1742
|
search<T>({ compositionID, requestBody }: SearchProps, requestOptions?: RequestOptions): Promise<SearchResponse<T>>;
|
|
1743
|
+
/**
|
|
1744
|
+
* Searches for composition rules in your index.
|
|
1745
|
+
*
|
|
1746
|
+
* Required API Key ACLs:
|
|
1747
|
+
* - settings
|
|
1748
|
+
* @param searchCompositionRules - The searchCompositionRules object.
|
|
1749
|
+
* @param searchCompositionRules.compositionID - Unique Composition ObjectID.
|
|
1750
|
+
* @param searchCompositionRules.searchCompositionRulesParams - The searchCompositionRulesParams object.
|
|
1751
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1752
|
+
*/
|
|
1753
|
+
searchCompositionRules({ compositionID, searchCompositionRulesParams }: SearchCompositionRulesProps, requestOptions?: RequestOptions): Promise<SearchCompositionRulesResponse>;
|
|
838
1754
|
/**
|
|
839
1755
|
* Searches for values of a specified facet attribute on the composition\'s main source\'s index. - By default, facet values are sorted by decreasing count. You can adjust this with the `sortFacetValueBy` parameter. - Searching for facet values doesn\'t work if you have **more than 65 searchable facets and searchable attributes combined**.
|
|
840
1756
|
*
|
|
@@ -859,4 +1775,4 @@ type ErrorBase = Record<string, any> & {
|
|
|
859
1775
|
declare function compositionClient(appId: string, apiKey: string, options?: ClientOptions | undefined): CompositionClient;
|
|
860
1776
|
type CompositionClient = ReturnType<typeof createCompositionClient>;
|
|
861
1777
|
|
|
862
|
-
export { type AroundPrecision, type AroundRadius, type AroundRadiusAll, type Banner, type BannerImage, type BannerImageUrl, type BannerLink, type BaseSearchResponse, type CompositionBaseSearchResponse, type CompositionClient, type CompositionIdRankingInfo, type CompositionRankingInfo, type CompositionRunAppliedRules, type CompositionRunSearchResponse, type CompositionsSearchResponse, type ErrorBase, type Exhaustive, type ExternalInjectedItem, type ExternalInjection, type FacetFilters, type FacetHits, type FacetOrdering, type FacetStats, type Facets, type HighlightResult, type HighlightResultOption, type Hit, type HitMetadata, type HitRankingInfo, type InsideBoundingBox, type MatchLevel, type MatchedGeoLocation, type NumericFilters, type OptionalFilters, type Params, type Personalization, type Range, type RankingInfo, type Redirect, type RedirectRuleIndexData, type RedirectRuleIndexMetadata, type RedirectURL, type RenderingContent, type RequestBody, type ResultsCompositionInfoResponse, type ResultsCompositionsResponse, type ResultsInjectedItemAppliedRulesInfoResponse, type ResultsInjectedItemInfoResponse, type SearchForFacetValuesParams, type SearchForFacetValuesProps, type SearchForFacetValuesRequest, type SearchForFacetValuesResponse, type SearchForFacetValuesResults, type SearchHits, type SearchPagination, type SearchProps, type SearchResponse, type SearchResults, type SearchResultsItem, type SnippetResult, type SnippetResultOption, type SortRemainingBy, type SupportedLanguage, type Value, type Widgets, apiClientVersion, compositionClient };
|
|
1778
|
+
export { type Action, type AdvancedSyntaxFeatures, type AlternativesAsExact, type Anchoring, type AroundPrecision, type AroundRadius, type AroundRadiusAll, type Banner, type BannerImage, type BannerImageUrl, type BannerLink, type BaseInjectionQueryParameters, type BaseSearchResponse, type BatchCompositionAction, type BatchParams, type BooleanString, type Composition, type CompositionBaseSearchResponse, type CompositionBehavior, type CompositionClient, type CompositionIdRankingInfo, type CompositionRankingInfo, type CompositionRule, type CompositionRuleConsequence, type CompositionRulesBatchParams, type CompositionRunAppliedRules, type CompositionRunSearchResponse, type CompositionSource, type CompositionSourceSearch, type CompositionsSearchResponse, type Condition, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteCompositionAction, type DeleteCompositionProps, type DeleteCompositionRuleAction, type DeleteCompositionRuleProps, type Distinct, type ErrorBase, type ExactOnSingleWordQuery, type Exhaustive, type External, type ExternalInjectedItem, type ExternalInjection, type ExternalOrdering, type ExternalSource, type FacetFilters, type FacetHits, type FacetOrdering, type FacetStats, type Facets, type GetCompositionProps, type GetRuleProps, type GetTaskProps, type GetTaskResponse, type HighlightResult, type HighlightResultOption, type Hit, type HitMetadata, type HitRankingInfo, type IgnorePlurals, type InjectedItem, type InjectedItemHitsMetadata, type InjectedItemMetadata, type InjectedItemSource, type Injection, type InsideBoundingBox, type ListCompositionsProps, type ListCompositionsResponse, type Main, type MainInjectionQueryParameters, type MatchLevel, type MatchedGeoLocation, type MultipleBatchRequest, type MultipleBatchResponse, type NumericFilters, type OptionalFilters, type OptionalWords, type Params, type Personalization, type PutCompositionProps, type PutCompositionRuleProps, type QueryType, type Range, type RankingInfo, type Redirect, type RedirectRuleIndexData, type RedirectRuleIndexMetadata, type RedirectURL, type RemoveStopWords, type RemoveWordsIfNoResults, type RenderingContent, type RequestBody, type ResultsCompositionInfoResponse, type ResultsCompositionsResponse, type ResultsInjectedItemAppliedRulesInfoResponse, type ResultsInjectedItemInfoResponse, type RulesBatchCompositionAction, type RulesMultipleBatchRequest, type RulesMultipleBatchResponse, type SaveRulesProps, type Search, type SearchCompositionRulesParams, type SearchCompositionRulesProps, type SearchCompositionRulesResponse, type SearchForFacetValuesParams, type SearchForFacetValuesProps, type SearchForFacetValuesRequest, type SearchForFacetValuesResponse, type SearchForFacetValuesResults, type SearchHits, type SearchPagination, type SearchProps, type SearchResponse, type SearchResults, type SearchResultsItem, type SearchSource, type SnippetResult, type SnippetResultOption, type SortRemainingBy, type SupportedLanguage, type TaskIDResponse, type TaskStatus, type TimeRange, type TypoTolerance, type TypoToleranceEnum, type Value, type WaitForCompositionTaskOptions, type Widgets, apiClientVersion, compositionClient };
|