-
Notifications
You must be signed in to change notification settings - Fork 215
/
Settings.ts
346 lines (286 loc) · 9.3 KB
/
Settings.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
export type Settings = {
/**
* The complete list of attributes that will be used for searching.
*/
readonly searchableAttributes?: readonly string[];
/**
* @deprecated Use `searchableAttributes` instead.
*/
readonly attributesToIndex?: readonly string[];
/**
* The complete list of attributes that will be used for faceting.
*/
readonly attributesForFaceting?: readonly string[];
/**
* List of attributes that cannot be retrieved at query time.
*/
readonly unretrievableAttributes?: readonly string[];
/**
* Gives control over which attributes to retrieve and which not to retrieve.
*/
readonly attributesToRetrieve?: readonly string[];
/**
* Controls the way results are sorted.
*/
readonly ranking?: readonly string[];
/**
* Specifies the custom ranking criterion.
*/
readonly customRanking?: readonly string[];
/**
* Creates replicas, exact copies of an index.
*/
readonly replicas?: readonly string[];
/**
* @deprecated Use `replicas` instead.
*/
readonly slaves?: readonly string[];
/**
* The primary parameter is automatically added to a replica's settings when the replica is created and cannot be modified.
*
* Can not be setted.
*/
readonly primary?: string;
/**
* Maximum number of facet values to return for each facet during a regular search.
*/
readonly maxValuesPerFacet?: number;
/**
* Controls how facet values are sorted.
*/
readonly sortFacetValuesBy?: 'count' | 'alpha';
/**
* List of attributes to highlight.
*/
readonly attributesToHighlight?: readonly string[];
/**
* List of attributes to snippet, with an optional maximum number of words to snippet.
*/
readonly attributesToSnippet?: readonly string[];
/**
* The HTML string to insert before the highlighted parts in all highlight and snippet results.
*/
readonly highlightPreTag?: string;
/**
* The HTML string to insert after the highlighted parts in all highlight and snippet results.
*/
readonly highlightPostTag?: string;
/**
* String used as an ellipsis indicator when a snippet is truncated.
*/
readonly snippetEllipsisText?: string;
/**
* Restrict highlighting and snippeting to items that matched the query.
*/
readonly restrictHighlightAndSnippetArrays?: boolean;
/**
* Set the number of hits per page.
*/
readonly hitsPerPage?: number;
/**
* Set the maximum number of hits accessible via pagination.
*/
readonly paginationLimitedTo?: number;
/**
* Minimum number of characters a word in the query string must contain to accept matches with 1 typo.
*/
readonly minWordSizefor1Typo?: number;
/**
* Minimum number of characters a word in the query string must contain to accept matches with 2 typos.
*/
readonly minWordSizefor2Typos?: number;
/**
* Controls whether typo tolerance is enabled and how it is applied.
*/
readonly typoTolerance?: string | boolean;
/**
* hether to allow typos on numbers (“numeric tokens”) in the query string.
*/
readonly allowTyposOnNumericTokens?: boolean;
/**
* List of attributes on which you want to disable typo tolerance.
*/
readonly disableTypoToleranceOnAttributes?: readonly string[];
/**
* List of words on which you want to disable typo tolerance.
*/
readonly disableTypoToleranceOnWords?: readonly string[];
/**
* Control which separators are indexed.
*/
readonly separatorsToIndex?: string;
/**
* Treats singular, plurals, and other forms of declensions as matching terms.
*/
readonly ignorePlurals?: readonly string[] | boolean;
/**
* Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection.
*/
readonly queryLanguages?: readonly string[];
/**
* A list of language ISO code.
*/
readonly indexLanguages?: readonly string[];
/**
* Whether rules should be globally enabled.
*/
readonly enableRules?: boolean;
/**
* Controls if and how query words are interpreted as prefixes.
*/
readonly queryType?: 'prefixLast' | 'prefixAll' | 'prefixNone';
/**
* Selects a strategy to remove words from the query when it doesn’t match any hits.
*/
readonly removeWordsIfNoResults?: 'none' | 'lastWords' | 'firstWords' | 'allOptional';
/**
* Enables the advanced query syntax.
*/
readonly advancedSyntax?: boolean;
/**
* AdvancedSyntaxFeatures can be exactPhrase or excludeWords
*/
readonly advancedSyntaxFeatures?: ReadonlyArray<'exactPhrase' | 'excludeWords'>;
/**
* A list of words that should be considered as optional when found in the query.
*/
readonly optionalWords?: readonly string[];
/**
* List of attributes on which you want to disable prefix matching.
*/
readonly disablePrefixOnAttributes?: readonly string[];
/**
* List of attributes on which you want to disable the exact ranking criterion.
*/
readonly disableExactOnAttributes?: readonly string[];
/**
* Controls how the exact ranking criterion is computed when the query contains only one word.
*/
readonly exactOnSingleWordQuery?: 'attribute' | 'none' | 'word';
/**
* List of alternatives that should be considered an exact match by the exact ranking criterion.
*/
readonly alternativesAsExact?: ReadonlyArray<
'ignorePlurals' | 'singleWordSynonym' | 'multiWordsSynonym'
>;
/**
* Removes stop (common) words from the query before executing it.
*/
readonly removeStopWords?: boolean | readonly string[];
/**
* List of numeric attributes that can be used as numerical filters.
*/
readonly numericAttributesForFiltering?: readonly string[];
/**
* Enables compression of large integer arrays.
*/
readonly allowCompressionOfIntegerArray?: boolean;
/**
* Name of the de-duplication attribute to be used with the distinct feature.
*/
readonly attributeForDistinct?: string;
/**
* Enables de-duplication or grouping of results.
*/
readonly distinct?: boolean | number;
/**
* Whether to highlight and snippet the original word that matches the synonym or the synonym itself.
*/
readonly replaceSynonymsInHighlight?: boolean;
/**
* Allows proximity to impact which searchable attribute is matched in the attribute ranking stage.
*/
readonly attributeCriteriaComputedByMinProximity?: boolean;
/**
* Precision of the proximity ranking criterion.
*/
readonly minProximity?: number;
/**
* Choose which fields the response will contain. Applies to search and browse queries.
*/
readonly responseFields?: readonly string[];
/**
* Maximum number of facet hits to return during a search for facet values.
*/
readonly maxFacetHits?: number;
/**
* List of attributes on which to do a decomposition of camel case words.
*/
readonly camelCaseAttributes?: readonly string[];
/**
* Specify on which attributes in your index Algolia should apply word-splitting (“decompounding”)
*/
readonly decompoundedAttributes?: Readonly<Record<string, readonly string[]>>;
/**
* Characters that should not be automatically normalized by the search engine.
*/
readonly keepDiacriticsOnCharacters?: string;
/**
* Overrides Algolia's default normalization.
*/
readonly customNormalization?: Readonly<Record<string, Readonly<Record<string, string>>>>;
/**
* Enable personalization for queries by default
*/
readonly enablePersonalization?: boolean;
/**
* Custom userData that could be added to the Settings.
*/
readonly userData?: any;
/**
* Enable word segmentation (also called decompounding) at query time for
* compatible languages. For example, this turns the Dutch query
* "spaanplaatbehang" into "spaan plaat behang" to retrieve more relevant
* results.
*/
readonly decompoundQuery?: boolean;
/**
* Specify on which attributes in your index Algolia should apply Japanese
* transliteration to make words indexed in Katakana or Kanji searchable in Hiragana.
*/
readonly attributesToTransliterate?: readonly string[];
/**
* The relevancy threshold to apply to search in a virtual index [0-100]. A Bigger
* value means fewer, but more relevant results, smaller value means more, but
* less relevant results.
*/
readonly relevancyStrictness?: number;
/**
* Content defining how the search interface should be rendered.
* This is set via the settings for a default value and can be overridden via rules
*/
readonly renderingContent?: {
/**
* defining how facets should be ordered
*/
readonly facetOrdering?: {
/**
* the ordering of facets (widgets)
*/
readonly facet?: {
/**
* pinned order of facet lists
*/
readonly order: readonly string[];
};
/**
* the ordering of facet values, within an individual list
*/
readonly values?: {
readonly [facet: string]: {
/**
* pinned order of facet values
*/
readonly order: readonly string[];
/**
* How to display the remaining items.
* - facet count (descending)
* - alphabetical (ascending)
* - hidden (show only pinned values)
*/
readonly sortRemainingBy: 'count' | 'alpha' | 'hidden';
};
};
};
};
};