algolia 3.3.2 → 3.3.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,1197 +0,0 @@
1
- # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
2
-
3
- require "date"
4
- require "time"
5
-
6
- module Algolia
7
- module Recommend
8
- # Each parameter value, including the `query` must not be larger than 512 bytes.
9
- class SearchParamsObject
10
- # Search query.
11
- attr_accessor :query
12
-
13
- # Keywords to be used instead of the search query to conduct a more broader search. Using the `similarQuery` parameter changes other settings: - `queryType` is set to `prefixNone`. - `removeStopWords` is set to true. - `words` is set as the first ranking criterion. - All remaining words are treated as `optionalWords`. Since the `similarQuery` is supposed to do a broad search, they usually return many results. Combine it with `filters` to narrow down the list of results.
14
- attr_accessor :similar_query
15
-
16
- # 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/).
17
- attr_accessor :filters
18
-
19
- attr_accessor :facet_filters
20
-
21
- attr_accessor :optional_filters
22
-
23
- attr_accessor :numeric_filters
24
-
25
- attr_accessor :tag_filters
26
-
27
- # Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is kept. For more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores).
28
- attr_accessor :sum_or_filters_scores
29
-
30
- # Restricts a search to a subset of your searchable attributes. Attribute names are case-sensitive.
31
- attr_accessor :restrict_searchable_attributes
32
-
33
- # Facets for which to retrieve facet values that match the search criteria and the number of matching facet values. To retrieve all facets, use the wildcard character `*`. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts).
34
- attr_accessor :facets
35
-
36
- # Whether faceting should be applied after deduplication with `distinct`. This leads to accurate facet counts when using faceting in combination with `distinct`. It's usually better to use `afterDistinct` modifiers in the `attributesForFaceting` setting, as `facetingAfterDistinct` only computes correct facet counts if all records have the same facet values for the `attributeForDistinct`.
37
- attr_accessor :faceting_after_distinct
38
-
39
- # Page of search results to retrieve.
40
- attr_accessor :page
41
-
42
- # Position of the first hit to retrieve.
43
- attr_accessor :offset
44
-
45
- # Number of hits to retrieve (used in combination with `offset`).
46
- attr_accessor :length
47
-
48
- # Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. Only records included within circle around this central location are included in the results. The radius of the circle is determined by the `aroundRadius` and `minimumAroundRadius` settings. This parameter is ignored if you also specify `insidePolygon` or `insideBoundingBox`.
49
- attr_accessor :around_lat_lng
50
-
51
- # Whether to obtain the coordinates from the request's IP address.
52
- attr_accessor :around_lat_lng_via_ip
53
-
54
- attr_accessor :around_radius
55
-
56
- attr_accessor :around_precision
57
-
58
- # Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set.
59
- attr_accessor :minimum_around_radius
60
-
61
- # Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas).
62
- attr_accessor :inside_bounding_box
63
-
64
- # Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`.
65
- attr_accessor :inside_polygon
66
-
67
- # 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`.
68
- attr_accessor :natural_languages
69
-
70
- # 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.
71
- attr_accessor :rule_contexts
72
-
73
- # 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).
74
- attr_accessor :personalization_impact
75
-
76
- # Unique pseudonymous or anonymous user identifier. This helps with analytics and click and conversion events. For more information, see [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
77
- attr_accessor :user_token
78
-
79
- # Whether the search response should include detailed ranking information.
80
- attr_accessor :get_ranking_info
81
-
82
- # Whether to take into account an index's synonyms for this search.
83
- attr_accessor :synonyms
84
-
85
- # 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/).
86
- attr_accessor :click_analytics
87
-
88
- # Whether this search will be included in Analytics.
89
- attr_accessor :analytics
90
-
91
- # Tags to apply to the query for [segmenting analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
92
- attr_accessor :analytics_tags
93
-
94
- # Whether to include this search when calculating processing-time percentiles.
95
- attr_accessor :percentile_computation
96
-
97
- # Whether to enable A/B testing for this search.
98
- attr_accessor :enable_ab_test
99
-
100
- # 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.
101
- attr_accessor :attributes_to_retrieve
102
-
103
- # Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If you configure a replica index for [sorting by an attribute](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute/), you put the sorting attribute at the top of the list. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, you should test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/).
104
- attr_accessor :ranking
105
-
106
- # Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Attribute names are case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria are equal. Records with missing values for your selected custom ranking attributes are always sorted last. Boolean attributes are sorted based on their alphabetical order. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. If you use two or more custom ranking attributes, [reduce the precision](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/controlling-custom-ranking-metrics-precision/) of your first attributes, or the other attributes will never be applied.
107
- attr_accessor :custom_ranking
108
-
109
- # Relevancy threshold below which less relevant results aren't included in the results. You can only set `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#what-are-virtual-replicas). Use this setting to strike a balance between the relevance and number of returned results.
110
- attr_accessor :relevancy_strictness
111
-
112
- # 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/).
113
- attr_accessor :attributes_to_highlight
114
-
115
- # 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.
116
- attr_accessor :attributes_to_snippet
117
-
118
- # HTML tag to insert before the highlighted parts in all highlighted results and snippets.
119
- attr_accessor :highlight_pre_tag
120
-
121
- # HTML tag to insert after the highlighted parts in all highlighted results and snippets.
122
- attr_accessor :highlight_post_tag
123
-
124
- # String used as an ellipsis indicator when a snippet is truncated.
125
- attr_accessor :snippet_ellipsis_text
126
-
127
- # Whether to restrict highlighting and snippeting to items that at least partially matched the search query. By default, all items are highlighted and snippeted.
128
- attr_accessor :restrict_highlight_and_snippet_arrays
129
-
130
- # Number of hits per page.
131
- attr_accessor :hits_per_page
132
-
133
- # 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).
134
- attr_accessor :min_word_sizefor1_typo
135
-
136
- # 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).
137
- attr_accessor :min_word_sizefor2_typos
138
-
139
- attr_accessor :typo_tolerance
140
-
141
- # 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.
142
- attr_accessor :allow_typos_on_numeric_tokens
143
-
144
- # 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.
145
- attr_accessor :disable_typo_tolerance_on_attributes
146
-
147
- attr_accessor :ignore_plurals
148
-
149
- attr_accessor :remove_stop_words
150
-
151
- # Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep their diacritics.
152
- attr_accessor :keep_diacritics_on_characters
153
-
154
- # 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/).
155
- attr_accessor :query_languages
156
-
157
- # 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).
158
- attr_accessor :decompound_query
159
-
160
- # Whether to enable rules.
161
- attr_accessor :enable_rules
162
-
163
- # Whether to enable Personalization.
164
- attr_accessor :enable_personalization
165
-
166
- attr_accessor :query_type
167
-
168
- attr_accessor :remove_words_if_no_results
169
-
170
- attr_accessor :mode
171
-
172
- attr_accessor :semantic_search
173
-
174
- # Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported.
175
- attr_accessor :advanced_syntax
176
-
177
- # 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 dividied 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).
178
- attr_accessor :optional_words
179
-
180
- # 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 likelyhood 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.
181
- attr_accessor :disable_exact_on_attributes
182
-
183
- attr_accessor :exact_on_single_word_query
184
-
185
- # 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.
186
- attr_accessor :alternatives_as_exact
187
-
188
- # 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.
189
- attr_accessor :advanced_syntax_features
190
-
191
- attr_accessor :distinct
192
-
193
- # 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 occurences of \"house\" are replaced by \"home\" in the highlighted response.
194
- attr_accessor :replace_synonyms_in_highlight
195
-
196
- # 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.
197
- attr_accessor :min_proximity
198
-
199
- # 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 attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI.
200
- attr_accessor :response_fields
201
-
202
- # 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).
203
- attr_accessor :max_facet_hits
204
-
205
- # Maximum number of facet values to return for each facet.
206
- attr_accessor :max_values_per_facet
207
-
208
- # Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/).
209
- attr_accessor :sort_facet_values_by
210
-
211
- # 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.
212
- attr_accessor :attribute_criteria_computed_by_min_proximity
213
-
214
- attr_accessor :rendering_content
215
-
216
- # 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.
217
- attr_accessor :enable_re_ranking
218
-
219
- attr_accessor :re_ranking_apply_filter
220
-
221
- # Attribute mapping from ruby-style variable name to JSON key.
222
- def self.attribute_map
223
- {
224
- :query => :query,
225
- :similar_query => :similarQuery,
226
- :filters => :filters,
227
- :facet_filters => :facetFilters,
228
- :optional_filters => :optionalFilters,
229
- :numeric_filters => :numericFilters,
230
- :tag_filters => :tagFilters,
231
- :sum_or_filters_scores => :sumOrFiltersScores,
232
- :restrict_searchable_attributes => :restrictSearchableAttributes,
233
- :facets => :facets,
234
- :faceting_after_distinct => :facetingAfterDistinct,
235
- :page => :page,
236
- :offset => :offset,
237
- :length => :length,
238
- :around_lat_lng => :aroundLatLng,
239
- :around_lat_lng_via_ip => :aroundLatLngViaIP,
240
- :around_radius => :aroundRadius,
241
- :around_precision => :aroundPrecision,
242
- :minimum_around_radius => :minimumAroundRadius,
243
- :inside_bounding_box => :insideBoundingBox,
244
- :inside_polygon => :insidePolygon,
245
- :natural_languages => :naturalLanguages,
246
- :rule_contexts => :ruleContexts,
247
- :personalization_impact => :personalizationImpact,
248
- :user_token => :userToken,
249
- :get_ranking_info => :getRankingInfo,
250
- :synonyms => :synonyms,
251
- :click_analytics => :clickAnalytics,
252
- :analytics => :analytics,
253
- :analytics_tags => :analyticsTags,
254
- :percentile_computation => :percentileComputation,
255
- :enable_ab_test => :enableABTest,
256
- :attributes_to_retrieve => :attributesToRetrieve,
257
- :ranking => :ranking,
258
- :custom_ranking => :customRanking,
259
- :relevancy_strictness => :relevancyStrictness,
260
- :attributes_to_highlight => :attributesToHighlight,
261
- :attributes_to_snippet => :attributesToSnippet,
262
- :highlight_pre_tag => :highlightPreTag,
263
- :highlight_post_tag => :highlightPostTag,
264
- :snippet_ellipsis_text => :snippetEllipsisText,
265
- :restrict_highlight_and_snippet_arrays => :restrictHighlightAndSnippetArrays,
266
- :hits_per_page => :hitsPerPage,
267
- :min_word_sizefor1_typo => :minWordSizefor1Typo,
268
- :min_word_sizefor2_typos => :minWordSizefor2Typos,
269
- :typo_tolerance => :typoTolerance,
270
- :allow_typos_on_numeric_tokens => :allowTyposOnNumericTokens,
271
- :disable_typo_tolerance_on_attributes => :disableTypoToleranceOnAttributes,
272
- :ignore_plurals => :ignorePlurals,
273
- :remove_stop_words => :removeStopWords,
274
- :keep_diacritics_on_characters => :keepDiacriticsOnCharacters,
275
- :query_languages => :queryLanguages,
276
- :decompound_query => :decompoundQuery,
277
- :enable_rules => :enableRules,
278
- :enable_personalization => :enablePersonalization,
279
- :query_type => :queryType,
280
- :remove_words_if_no_results => :removeWordsIfNoResults,
281
- :mode => :mode,
282
- :semantic_search => :semanticSearch,
283
- :advanced_syntax => :advancedSyntax,
284
- :optional_words => :optionalWords,
285
- :disable_exact_on_attributes => :disableExactOnAttributes,
286
- :exact_on_single_word_query => :exactOnSingleWordQuery,
287
- :alternatives_as_exact => :alternativesAsExact,
288
- :advanced_syntax_features => :advancedSyntaxFeatures,
289
- :distinct => :distinct,
290
- :replace_synonyms_in_highlight => :replaceSynonymsInHighlight,
291
- :min_proximity => :minProximity,
292
- :response_fields => :responseFields,
293
- :max_facet_hits => :maxFacetHits,
294
- :max_values_per_facet => :maxValuesPerFacet,
295
- :sort_facet_values_by => :sortFacetValuesBy,
296
- :attribute_criteria_computed_by_min_proximity => :attributeCriteriaComputedByMinProximity,
297
- :rendering_content => :renderingContent,
298
- :enable_re_ranking => :enableReRanking,
299
- :re_ranking_apply_filter => :reRankingApplyFilter
300
- }
301
- end
302
-
303
- # Returns all the JSON keys this model knows about
304
- def self.acceptable_attributes
305
- attribute_map.values
306
- end
307
-
308
- # Attribute type mapping.
309
- def self.types_mapping
310
- {
311
- :query => :"String",
312
- :similar_query => :"String",
313
- :filters => :"String",
314
- :facet_filters => :"FacetFilters",
315
- :optional_filters => :"OptionalFilters",
316
- :numeric_filters => :"NumericFilters",
317
- :tag_filters => :"TagFilters",
318
- :sum_or_filters_scores => :"Boolean",
319
- :restrict_searchable_attributes => :"Array<String>",
320
- :facets => :"Array<String>",
321
- :faceting_after_distinct => :"Boolean",
322
- :page => :"Integer",
323
- :offset => :"Integer",
324
- :length => :"Integer",
325
- :around_lat_lng => :"String",
326
- :around_lat_lng_via_ip => :"Boolean",
327
- :around_radius => :"AroundRadius",
328
- :around_precision => :"AroundPrecision",
329
- :minimum_around_radius => :"Integer",
330
- :inside_bounding_box => :"Array<Array<Float>>",
331
- :inside_polygon => :"Array<Array<Float>>",
332
- :natural_languages => :"Array<SupportedLanguage>",
333
- :rule_contexts => :"Array<String>",
334
- :personalization_impact => :"Integer",
335
- :user_token => :"String",
336
- :get_ranking_info => :"Boolean",
337
- :synonyms => :"Boolean",
338
- :click_analytics => :"Boolean",
339
- :analytics => :"Boolean",
340
- :analytics_tags => :"Array<String>",
341
- :percentile_computation => :"Boolean",
342
- :enable_ab_test => :"Boolean",
343
- :attributes_to_retrieve => :"Array<String>",
344
- :ranking => :"Array<String>",
345
- :custom_ranking => :"Array<String>",
346
- :relevancy_strictness => :"Integer",
347
- :attributes_to_highlight => :"Array<String>",
348
- :attributes_to_snippet => :"Array<String>",
349
- :highlight_pre_tag => :"String",
350
- :highlight_post_tag => :"String",
351
- :snippet_ellipsis_text => :"String",
352
- :restrict_highlight_and_snippet_arrays => :"Boolean",
353
- :hits_per_page => :"Integer",
354
- :min_word_sizefor1_typo => :"Integer",
355
- :min_word_sizefor2_typos => :"Integer",
356
- :typo_tolerance => :"TypoTolerance",
357
- :allow_typos_on_numeric_tokens => :"Boolean",
358
- :disable_typo_tolerance_on_attributes => :"Array<String>",
359
- :ignore_plurals => :"IgnorePlurals",
360
- :remove_stop_words => :"RemoveStopWords",
361
- :keep_diacritics_on_characters => :"String",
362
- :query_languages => :"Array<SupportedLanguage>",
363
- :decompound_query => :"Boolean",
364
- :enable_rules => :"Boolean",
365
- :enable_personalization => :"Boolean",
366
- :query_type => :"QueryType",
367
- :remove_words_if_no_results => :"RemoveWordsIfNoResults",
368
- :mode => :"Mode",
369
- :semantic_search => :"SemanticSearch",
370
- :advanced_syntax => :"Boolean",
371
- :optional_words => :"Array<String>",
372
- :disable_exact_on_attributes => :"Array<String>",
373
- :exact_on_single_word_query => :"ExactOnSingleWordQuery",
374
- :alternatives_as_exact => :"Array<AlternativesAsExact>",
375
- :advanced_syntax_features => :"Array<AdvancedSyntaxFeatures>",
376
- :distinct => :"Distinct",
377
- :replace_synonyms_in_highlight => :"Boolean",
378
- :min_proximity => :"Integer",
379
- :response_fields => :"Array<String>",
380
- :max_facet_hits => :"Integer",
381
- :max_values_per_facet => :"Integer",
382
- :sort_facet_values_by => :"String",
383
- :attribute_criteria_computed_by_min_proximity => :"Boolean",
384
- :rendering_content => :"RenderingContent",
385
- :enable_re_ranking => :"Boolean",
386
- :re_ranking_apply_filter => :"ReRankingApplyFilter"
387
- }
388
- end
389
-
390
- # List of attributes with nullable: true
391
- def self.openapi_nullable
392
- Set.new(
393
- []
394
- )
395
- end
396
-
397
- # List of class defined in allOf (OpenAPI v3)
398
- def self.openapi_all_of
399
- [
400
- :"BaseSearchParams",
401
- :"IndexSettingsAsSearchParams"
402
- ]
403
- end
404
-
405
- # Initializes the object
406
- # @param [Hash] attributes Model attributes in the form of hash
407
- def initialize(attributes = {})
408
- if (!attributes.is_a?(Hash))
409
- raise(
410
- ArgumentError,
411
- "The input argument (attributes) must be a hash in `Algolia::SearchParamsObject` initialize method"
412
- )
413
- end
414
-
415
- # check to see if the attribute exists and convert string to symbol for hash key
416
- attributes = attributes.each_with_object({}) { |(k, v), h|
417
- if (!self.class.attribute_map.key?(k.to_sym))
418
- raise(
419
- ArgumentError,
420
- "`#{k}` is not a valid attribute in `Algolia::SearchParamsObject`. Please check the name to make sure it's valid. List of attributes: " +
421
- self.class.attribute_map.keys.inspect
422
- )
423
- end
424
-
425
- h[k.to_sym] = v
426
- }
427
-
428
- if attributes.key?(:query)
429
- self.query = attributes[:query]
430
- end
431
-
432
- if attributes.key?(:similar_query)
433
- self.similar_query = attributes[:similar_query]
434
- end
435
-
436
- if attributes.key?(:filters)
437
- self.filters = attributes[:filters]
438
- end
439
-
440
- if attributes.key?(:facet_filters)
441
- self.facet_filters = attributes[:facet_filters]
442
- end
443
-
444
- if attributes.key?(:optional_filters)
445
- self.optional_filters = attributes[:optional_filters]
446
- end
447
-
448
- if attributes.key?(:numeric_filters)
449
- self.numeric_filters = attributes[:numeric_filters]
450
- end
451
-
452
- if attributes.key?(:tag_filters)
453
- self.tag_filters = attributes[:tag_filters]
454
- end
455
-
456
- if attributes.key?(:sum_or_filters_scores)
457
- self.sum_or_filters_scores = attributes[:sum_or_filters_scores]
458
- end
459
-
460
- if attributes.key?(:restrict_searchable_attributes)
461
- if (value = attributes[:restrict_searchable_attributes]).is_a?(Array)
462
- self.restrict_searchable_attributes = value
463
- end
464
- end
465
-
466
- if attributes.key?(:facets)
467
- if (value = attributes[:facets]).is_a?(Array)
468
- self.facets = value
469
- end
470
- end
471
-
472
- if attributes.key?(:faceting_after_distinct)
473
- self.faceting_after_distinct = attributes[:faceting_after_distinct]
474
- end
475
-
476
- if attributes.key?(:page)
477
- self.page = attributes[:page]
478
- end
479
-
480
- if attributes.key?(:offset)
481
- self.offset = attributes[:offset]
482
- end
483
-
484
- if attributes.key?(:length)
485
- self.length = attributes[:length]
486
- end
487
-
488
- if attributes.key?(:around_lat_lng)
489
- self.around_lat_lng = attributes[:around_lat_lng]
490
- end
491
-
492
- if attributes.key?(:around_lat_lng_via_ip)
493
- self.around_lat_lng_via_ip = attributes[:around_lat_lng_via_ip]
494
- end
495
-
496
- if attributes.key?(:around_radius)
497
- self.around_radius = attributes[:around_radius]
498
- end
499
-
500
- if attributes.key?(:around_precision)
501
- self.around_precision = attributes[:around_precision]
502
- end
503
-
504
- if attributes.key?(:minimum_around_radius)
505
- self.minimum_around_radius = attributes[:minimum_around_radius]
506
- end
507
-
508
- if attributes.key?(:inside_bounding_box)
509
- if (value = attributes[:inside_bounding_box]).is_a?(Array)
510
- self.inside_bounding_box = value
511
- end
512
- end
513
-
514
- if attributes.key?(:inside_polygon)
515
- if (value = attributes[:inside_polygon]).is_a?(Array)
516
- self.inside_polygon = value
517
- end
518
- end
519
-
520
- if attributes.key?(:natural_languages)
521
- if (value = attributes[:natural_languages]).is_a?(Array)
522
- self.natural_languages = value
523
- end
524
- end
525
-
526
- if attributes.key?(:rule_contexts)
527
- if (value = attributes[:rule_contexts]).is_a?(Array)
528
- self.rule_contexts = value
529
- end
530
- end
531
-
532
- if attributes.key?(:personalization_impact)
533
- self.personalization_impact = attributes[:personalization_impact]
534
- end
535
-
536
- if attributes.key?(:user_token)
537
- self.user_token = attributes[:user_token]
538
- end
539
-
540
- if attributes.key?(:get_ranking_info)
541
- self.get_ranking_info = attributes[:get_ranking_info]
542
- end
543
-
544
- if attributes.key?(:synonyms)
545
- self.synonyms = attributes[:synonyms]
546
- end
547
-
548
- if attributes.key?(:click_analytics)
549
- self.click_analytics = attributes[:click_analytics]
550
- end
551
-
552
- if attributes.key?(:analytics)
553
- self.analytics = attributes[:analytics]
554
- end
555
-
556
- if attributes.key?(:analytics_tags)
557
- if (value = attributes[:analytics_tags]).is_a?(Array)
558
- self.analytics_tags = value
559
- end
560
- end
561
-
562
- if attributes.key?(:percentile_computation)
563
- self.percentile_computation = attributes[:percentile_computation]
564
- end
565
-
566
- if attributes.key?(:enable_ab_test)
567
- self.enable_ab_test = attributes[:enable_ab_test]
568
- end
569
-
570
- if attributes.key?(:attributes_to_retrieve)
571
- if (value = attributes[:attributes_to_retrieve]).is_a?(Array)
572
- self.attributes_to_retrieve = value
573
- end
574
- end
575
-
576
- if attributes.key?(:ranking)
577
- if (value = attributes[:ranking]).is_a?(Array)
578
- self.ranking = value
579
- end
580
- end
581
-
582
- if attributes.key?(:custom_ranking)
583
- if (value = attributes[:custom_ranking]).is_a?(Array)
584
- self.custom_ranking = value
585
- end
586
- end
587
-
588
- if attributes.key?(:relevancy_strictness)
589
- self.relevancy_strictness = attributes[:relevancy_strictness]
590
- end
591
-
592
- if attributes.key?(:attributes_to_highlight)
593
- if (value = attributes[:attributes_to_highlight]).is_a?(Array)
594
- self.attributes_to_highlight = value
595
- end
596
- end
597
-
598
- if attributes.key?(:attributes_to_snippet)
599
- if (value = attributes[:attributes_to_snippet]).is_a?(Array)
600
- self.attributes_to_snippet = value
601
- end
602
- end
603
-
604
- if attributes.key?(:highlight_pre_tag)
605
- self.highlight_pre_tag = attributes[:highlight_pre_tag]
606
- end
607
-
608
- if attributes.key?(:highlight_post_tag)
609
- self.highlight_post_tag = attributes[:highlight_post_tag]
610
- end
611
-
612
- if attributes.key?(:snippet_ellipsis_text)
613
- self.snippet_ellipsis_text = attributes[:snippet_ellipsis_text]
614
- end
615
-
616
- if attributes.key?(:restrict_highlight_and_snippet_arrays)
617
- self.restrict_highlight_and_snippet_arrays = attributes[:restrict_highlight_and_snippet_arrays]
618
- end
619
-
620
- if attributes.key?(:hits_per_page)
621
- self.hits_per_page = attributes[:hits_per_page]
622
- end
623
-
624
- if attributes.key?(:min_word_sizefor1_typo)
625
- self.min_word_sizefor1_typo = attributes[:min_word_sizefor1_typo]
626
- end
627
-
628
- if attributes.key?(:min_word_sizefor2_typos)
629
- self.min_word_sizefor2_typos = attributes[:min_word_sizefor2_typos]
630
- end
631
-
632
- if attributes.key?(:typo_tolerance)
633
- self.typo_tolerance = attributes[:typo_tolerance]
634
- end
635
-
636
- if attributes.key?(:allow_typos_on_numeric_tokens)
637
- self.allow_typos_on_numeric_tokens = attributes[:allow_typos_on_numeric_tokens]
638
- end
639
-
640
- if attributes.key?(:disable_typo_tolerance_on_attributes)
641
- if (value = attributes[:disable_typo_tolerance_on_attributes]).is_a?(Array)
642
- self.disable_typo_tolerance_on_attributes = value
643
- end
644
- end
645
-
646
- if attributes.key?(:ignore_plurals)
647
- self.ignore_plurals = attributes[:ignore_plurals]
648
- end
649
-
650
- if attributes.key?(:remove_stop_words)
651
- self.remove_stop_words = attributes[:remove_stop_words]
652
- end
653
-
654
- if attributes.key?(:keep_diacritics_on_characters)
655
- self.keep_diacritics_on_characters = attributes[:keep_diacritics_on_characters]
656
- end
657
-
658
- if attributes.key?(:query_languages)
659
- if (value = attributes[:query_languages]).is_a?(Array)
660
- self.query_languages = value
661
- end
662
- end
663
-
664
- if attributes.key?(:decompound_query)
665
- self.decompound_query = attributes[:decompound_query]
666
- end
667
-
668
- if attributes.key?(:enable_rules)
669
- self.enable_rules = attributes[:enable_rules]
670
- end
671
-
672
- if attributes.key?(:enable_personalization)
673
- self.enable_personalization = attributes[:enable_personalization]
674
- end
675
-
676
- if attributes.key?(:query_type)
677
- self.query_type = attributes[:query_type]
678
- end
679
-
680
- if attributes.key?(:remove_words_if_no_results)
681
- self.remove_words_if_no_results = attributes[:remove_words_if_no_results]
682
- end
683
-
684
- if attributes.key?(:mode)
685
- self.mode = attributes[:mode]
686
- end
687
-
688
- if attributes.key?(:semantic_search)
689
- self.semantic_search = attributes[:semantic_search]
690
- end
691
-
692
- if attributes.key?(:advanced_syntax)
693
- self.advanced_syntax = attributes[:advanced_syntax]
694
- end
695
-
696
- if attributes.key?(:optional_words)
697
- if (value = attributes[:optional_words]).is_a?(Array)
698
- self.optional_words = value
699
- end
700
- end
701
-
702
- if attributes.key?(:disable_exact_on_attributes)
703
- if (value = attributes[:disable_exact_on_attributes]).is_a?(Array)
704
- self.disable_exact_on_attributes = value
705
- end
706
- end
707
-
708
- if attributes.key?(:exact_on_single_word_query)
709
- self.exact_on_single_word_query = attributes[:exact_on_single_word_query]
710
- end
711
-
712
- if attributes.key?(:alternatives_as_exact)
713
- if (value = attributes[:alternatives_as_exact]).is_a?(Array)
714
- self.alternatives_as_exact = value
715
- end
716
- end
717
-
718
- if attributes.key?(:advanced_syntax_features)
719
- if (value = attributes[:advanced_syntax_features]).is_a?(Array)
720
- self.advanced_syntax_features = value
721
- end
722
- end
723
-
724
- if attributes.key?(:distinct)
725
- self.distinct = attributes[:distinct]
726
- end
727
-
728
- if attributes.key?(:replace_synonyms_in_highlight)
729
- self.replace_synonyms_in_highlight = attributes[:replace_synonyms_in_highlight]
730
- end
731
-
732
- if attributes.key?(:min_proximity)
733
- self.min_proximity = attributes[:min_proximity]
734
- end
735
-
736
- if attributes.key?(:response_fields)
737
- if (value = attributes[:response_fields]).is_a?(Array)
738
- self.response_fields = value
739
- end
740
- end
741
-
742
- if attributes.key?(:max_facet_hits)
743
- self.max_facet_hits = attributes[:max_facet_hits]
744
- end
745
-
746
- if attributes.key?(:max_values_per_facet)
747
- self.max_values_per_facet = attributes[:max_values_per_facet]
748
- end
749
-
750
- if attributes.key?(:sort_facet_values_by)
751
- self.sort_facet_values_by = attributes[:sort_facet_values_by]
752
- end
753
-
754
- if attributes.key?(:attribute_criteria_computed_by_min_proximity)
755
- self.attribute_criteria_computed_by_min_proximity = attributes[:attribute_criteria_computed_by_min_proximity]
756
- end
757
-
758
- if attributes.key?(:rendering_content)
759
- self.rendering_content = attributes[:rendering_content]
760
- end
761
-
762
- if attributes.key?(:enable_re_ranking)
763
- self.enable_re_ranking = attributes[:enable_re_ranking]
764
- end
765
-
766
- if attributes.key?(:re_ranking_apply_filter)
767
- self.re_ranking_apply_filter = attributes[:re_ranking_apply_filter]
768
- end
769
- end
770
-
771
- # Custom attribute writer method with validation
772
- # @param [Object] page Value to be assigned
773
- def page=(page)
774
- if page.nil?
775
- raise ArgumentError, "page cannot be nil"
776
- end
777
-
778
- if page < 0
779
- raise ArgumentError, "invalid value for \"page\", must be greater than or equal to 0."
780
- end
781
-
782
- @page = page
783
- end
784
-
785
- # Custom attribute writer method with validation
786
- # @param [Object] length Value to be assigned
787
- def length=(length)
788
- if length.nil?
789
- raise ArgumentError, "length cannot be nil"
790
- end
791
-
792
- if length > 1000
793
- raise ArgumentError, "invalid value for \"length\", must be smaller than or equal to 1000."
794
- end
795
-
796
- if length < 0
797
- raise ArgumentError, "invalid value for \"length\", must be greater than or equal to 0."
798
- end
799
-
800
- @length = length
801
- end
802
-
803
- # Custom attribute writer method with validation
804
- # @param [Object] minimum_around_radius Value to be assigned
805
- def minimum_around_radius=(minimum_around_radius)
806
- if minimum_around_radius.nil?
807
- raise ArgumentError, "minimum_around_radius cannot be nil"
808
- end
809
-
810
- if minimum_around_radius < 1
811
- raise ArgumentError, "invalid value for \"minimum_around_radius\", must be greater than or equal to 1."
812
- end
813
-
814
- @minimum_around_radius = minimum_around_radius
815
- end
816
-
817
- # Custom attribute writer method with validation
818
- # @param [Object] personalization_impact Value to be assigned
819
- def personalization_impact=(personalization_impact)
820
- if personalization_impact.nil?
821
- raise ArgumentError, "personalization_impact cannot be nil"
822
- end
823
-
824
- if personalization_impact > 100
825
- raise ArgumentError, "invalid value for \"personalization_impact\", must be smaller than or equal to 100."
826
- end
827
-
828
- if personalization_impact < 0
829
- raise ArgumentError, "invalid value for \"personalization_impact\", must be greater than or equal to 0."
830
- end
831
-
832
- @personalization_impact = personalization_impact
833
- end
834
-
835
- # Custom attribute writer method with validation
836
- # @param [Object] hits_per_page Value to be assigned
837
- def hits_per_page=(hits_per_page)
838
- if hits_per_page.nil?
839
- raise ArgumentError, "hits_per_page cannot be nil"
840
- end
841
-
842
- if hits_per_page > 1000
843
- raise ArgumentError, "invalid value for \"hits_per_page\", must be smaller than or equal to 1000."
844
- end
845
-
846
- if hits_per_page < 1
847
- raise ArgumentError, "invalid value for \"hits_per_page\", must be greater than or equal to 1."
848
- end
849
-
850
- @hits_per_page = hits_per_page
851
- end
852
-
853
- # Custom attribute writer method with validation
854
- # @param [Object] min_proximity Value to be assigned
855
- def min_proximity=(min_proximity)
856
- if min_proximity.nil?
857
- raise ArgumentError, "min_proximity cannot be nil"
858
- end
859
-
860
- if min_proximity > 7
861
- raise ArgumentError, "invalid value for \"min_proximity\", must be smaller than or equal to 7."
862
- end
863
-
864
- if min_proximity < 1
865
- raise ArgumentError, "invalid value for \"min_proximity\", must be greater than or equal to 1."
866
- end
867
-
868
- @min_proximity = min_proximity
869
- end
870
-
871
- # Custom attribute writer method with validation
872
- # @param [Object] max_facet_hits Value to be assigned
873
- def max_facet_hits=(max_facet_hits)
874
- if max_facet_hits.nil?
875
- raise ArgumentError, "max_facet_hits cannot be nil"
876
- end
877
-
878
- if max_facet_hits > 100
879
- raise ArgumentError, "invalid value for \"max_facet_hits\", must be smaller than or equal to 100."
880
- end
881
-
882
- @max_facet_hits = max_facet_hits
883
- end
884
-
885
- # Custom attribute writer method with validation
886
- # @param [Object] max_values_per_facet Value to be assigned
887
- def max_values_per_facet=(max_values_per_facet)
888
- if max_values_per_facet.nil?
889
- raise ArgumentError, "max_values_per_facet cannot be nil"
890
- end
891
-
892
- if max_values_per_facet > 1000
893
- raise ArgumentError, "invalid value for \"max_values_per_facet\", must be smaller than or equal to 1000."
894
- end
895
-
896
- @max_values_per_facet = max_values_per_facet
897
- end
898
-
899
- # Checks equality by comparing each attribute.
900
- # @param [Object] Object to be compared
901
- def ==(other)
902
- return true if self.equal?(other)
903
- self.class == other.class &&
904
- query == other.query &&
905
- similar_query == other.similar_query &&
906
- filters == other.filters &&
907
- facet_filters == other.facet_filters &&
908
- optional_filters == other.optional_filters &&
909
- numeric_filters == other.numeric_filters &&
910
- tag_filters == other.tag_filters &&
911
- sum_or_filters_scores == other.sum_or_filters_scores &&
912
- restrict_searchable_attributes == other.restrict_searchable_attributes &&
913
- facets == other.facets &&
914
- faceting_after_distinct == other.faceting_after_distinct &&
915
- page == other.page &&
916
- offset == other.offset &&
917
- length == other.length &&
918
- around_lat_lng == other.around_lat_lng &&
919
- around_lat_lng_via_ip == other.around_lat_lng_via_ip &&
920
- around_radius == other.around_radius &&
921
- around_precision == other.around_precision &&
922
- minimum_around_radius == other.minimum_around_radius &&
923
- inside_bounding_box == other.inside_bounding_box &&
924
- inside_polygon == other.inside_polygon &&
925
- natural_languages == other.natural_languages &&
926
- rule_contexts == other.rule_contexts &&
927
- personalization_impact == other.personalization_impact &&
928
- user_token == other.user_token &&
929
- get_ranking_info == other.get_ranking_info &&
930
- synonyms == other.synonyms &&
931
- click_analytics == other.click_analytics &&
932
- analytics == other.analytics &&
933
- analytics_tags == other.analytics_tags &&
934
- percentile_computation == other.percentile_computation &&
935
- enable_ab_test == other.enable_ab_test &&
936
- attributes_to_retrieve == other.attributes_to_retrieve &&
937
- ranking == other.ranking &&
938
- custom_ranking == other.custom_ranking &&
939
- relevancy_strictness == other.relevancy_strictness &&
940
- attributes_to_highlight == other.attributes_to_highlight &&
941
- attributes_to_snippet == other.attributes_to_snippet &&
942
- highlight_pre_tag == other.highlight_pre_tag &&
943
- highlight_post_tag == other.highlight_post_tag &&
944
- snippet_ellipsis_text == other.snippet_ellipsis_text &&
945
- restrict_highlight_and_snippet_arrays == other.restrict_highlight_and_snippet_arrays &&
946
- hits_per_page == other.hits_per_page &&
947
- min_word_sizefor1_typo == other.min_word_sizefor1_typo &&
948
- min_word_sizefor2_typos == other.min_word_sizefor2_typos &&
949
- typo_tolerance == other.typo_tolerance &&
950
- allow_typos_on_numeric_tokens == other.allow_typos_on_numeric_tokens &&
951
- disable_typo_tolerance_on_attributes == other.disable_typo_tolerance_on_attributes &&
952
- ignore_plurals == other.ignore_plurals &&
953
- remove_stop_words == other.remove_stop_words &&
954
- keep_diacritics_on_characters == other.keep_diacritics_on_characters &&
955
- query_languages == other.query_languages &&
956
- decompound_query == other.decompound_query &&
957
- enable_rules == other.enable_rules &&
958
- enable_personalization == other.enable_personalization &&
959
- query_type == other.query_type &&
960
- remove_words_if_no_results == other.remove_words_if_no_results &&
961
- mode == other.mode &&
962
- semantic_search == other.semantic_search &&
963
- advanced_syntax == other.advanced_syntax &&
964
- optional_words == other.optional_words &&
965
- disable_exact_on_attributes == other.disable_exact_on_attributes &&
966
- exact_on_single_word_query == other.exact_on_single_word_query &&
967
- alternatives_as_exact == other.alternatives_as_exact &&
968
- advanced_syntax_features == other.advanced_syntax_features &&
969
- distinct == other.distinct &&
970
- replace_synonyms_in_highlight == other.replace_synonyms_in_highlight &&
971
- min_proximity == other.min_proximity &&
972
- response_fields == other.response_fields &&
973
- max_facet_hits == other.max_facet_hits &&
974
- max_values_per_facet == other.max_values_per_facet &&
975
- sort_facet_values_by == other.sort_facet_values_by &&
976
- attribute_criteria_computed_by_min_proximity == other.attribute_criteria_computed_by_min_proximity &&
977
- rendering_content == other.rendering_content &&
978
- enable_re_ranking == other.enable_re_ranking &&
979
- re_ranking_apply_filter == other.re_ranking_apply_filter
980
- end
981
-
982
- # @see the `==` method
983
- # @param [Object] Object to be compared
984
- def eql?(other)
985
- self == other
986
- end
987
-
988
- # Calculates hash code according to all attributes.
989
- # @return [Integer] Hash code
990
- def hash
991
- [
992
- query,
993
- similar_query,
994
- filters,
995
- facet_filters,
996
- optional_filters,
997
- numeric_filters,
998
- tag_filters,
999
- sum_or_filters_scores,
1000
- restrict_searchable_attributes,
1001
- facets,
1002
- faceting_after_distinct,
1003
- page,
1004
- offset,
1005
- length,
1006
- around_lat_lng,
1007
- around_lat_lng_via_ip,
1008
- around_radius,
1009
- around_precision,
1010
- minimum_around_radius,
1011
- inside_bounding_box,
1012
- inside_polygon,
1013
- natural_languages,
1014
- rule_contexts,
1015
- personalization_impact,
1016
- user_token,
1017
- get_ranking_info,
1018
- synonyms,
1019
- click_analytics,
1020
- analytics,
1021
- analytics_tags,
1022
- percentile_computation,
1023
- enable_ab_test,
1024
- attributes_to_retrieve,
1025
- ranking,
1026
- custom_ranking,
1027
- relevancy_strictness,
1028
- attributes_to_highlight,
1029
- attributes_to_snippet,
1030
- highlight_pre_tag,
1031
- highlight_post_tag,
1032
- snippet_ellipsis_text,
1033
- restrict_highlight_and_snippet_arrays,
1034
- hits_per_page,
1035
- min_word_sizefor1_typo,
1036
- min_word_sizefor2_typos,
1037
- typo_tolerance,
1038
- allow_typos_on_numeric_tokens,
1039
- disable_typo_tolerance_on_attributes,
1040
- ignore_plurals,
1041
- remove_stop_words,
1042
- keep_diacritics_on_characters,
1043
- query_languages,
1044
- decompound_query,
1045
- enable_rules,
1046
- enable_personalization,
1047
- query_type,
1048
- remove_words_if_no_results,
1049
- mode,
1050
- semantic_search,
1051
- advanced_syntax,
1052
- optional_words,
1053
- disable_exact_on_attributes,
1054
- exact_on_single_word_query,
1055
- alternatives_as_exact,
1056
- advanced_syntax_features,
1057
- distinct,
1058
- replace_synonyms_in_highlight,
1059
- min_proximity,
1060
- response_fields,
1061
- max_facet_hits,
1062
- max_values_per_facet,
1063
- sort_facet_values_by,
1064
- attribute_criteria_computed_by_min_proximity,
1065
- rendering_content,
1066
- enable_re_ranking,
1067
- re_ranking_apply_filter
1068
- ].hash
1069
- end
1070
-
1071
- # Builds the object from hash
1072
- # @param [Hash] attributes Model attributes in the form of hash
1073
- # @return [Object] Returns the model itself
1074
- def self.build_from_hash(attributes)
1075
- return nil unless attributes.is_a?(Hash)
1076
- attributes = attributes.transform_keys(&:to_sym)
1077
- transformed_hash = {}
1078
- types_mapping.each_pair do |key, type|
1079
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
1080
- transformed_hash[key.to_sym] = nil
1081
- elsif type =~ /\AArray<(.*)>/i
1082
- # check to ensure the input is an array given that the attribute
1083
- # is documented as an array but the input is not
1084
- if attributes[attribute_map[key]].is_a?(Array)
1085
- transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
1086
- _deserialize(::Regexp.last_match(1), v)
1087
- }
1088
- end
1089
- elsif !attributes[attribute_map[key]].nil?
1090
- transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
1091
- end
1092
- end
1093
-
1094
- new(transformed_hash)
1095
- end
1096
-
1097
- # Deserializes the data based on type
1098
- # @param string type Data type
1099
- # @param string value Value to be deserialized
1100
- # @return [Object] Deserialized data
1101
- def self._deserialize(type, value)
1102
- case type.to_sym
1103
- when :Time
1104
- Time.parse(value)
1105
- when :Date
1106
- Date.parse(value)
1107
- when :String
1108
- value.to_s
1109
- when :Integer
1110
- value.to_i
1111
- when :Float
1112
- value.to_f
1113
- when :Boolean
1114
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
1115
- true
1116
- else
1117
- false
1118
- end
1119
-
1120
- when :Object
1121
- # generic object (usually a Hash), return directly
1122
- value
1123
- when /\AArray<(?<inner_type>.+)>\z/
1124
- inner_type = Regexp.last_match[:inner_type]
1125
- value.map { |v| _deserialize(inner_type, v) }
1126
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
1127
- k_type = Regexp.last_match[:k_type]
1128
- v_type = Regexp.last_match[:v_type]
1129
- {}.tap do |hash|
1130
- value.each do |k, v|
1131
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
1132
- end
1133
- end
1134
- # model
1135
- else
1136
- # models (e.g. Pet) or oneOf
1137
- klass = Algolia::Recommend.const_get(type)
1138
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
1139
- .build_from_hash(value)
1140
- end
1141
- end
1142
-
1143
- # Returns the string representation of the object
1144
- # @return [String] String presentation of the object
1145
- def to_s
1146
- to_hash.to_s
1147
- end
1148
-
1149
- # to_body is an alias to to_hash (backward compatibility)
1150
- # @return [Hash] Returns the object in the form of hash
1151
- def to_body
1152
- to_hash
1153
- end
1154
-
1155
- def to_json(*_args)
1156
- to_hash.to_json
1157
- end
1158
-
1159
- # Returns the object in the form of hash
1160
- # @return [Hash] Returns the object in the form of hash
1161
- def to_hash
1162
- hash = {}
1163
- self.class.attribute_map.each_pair do |attr, param|
1164
- value = send(attr)
1165
- if value.nil?
1166
- is_nullable = self.class.openapi_nullable.include?(attr)
1167
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
1168
- end
1169
-
1170
- hash[param] = _to_hash(value)
1171
- end
1172
-
1173
- hash
1174
- end
1175
-
1176
- # Outputs non-array value in the form of hash
1177
- # For object, use to_hash. Otherwise, just return the value
1178
- # @param [Object] value Any valid value
1179
- # @return [Hash] Returns the value in the form of hash
1180
- def _to_hash(value)
1181
- if value.is_a?(Array)
1182
- value.compact.map { |v| _to_hash(v) }
1183
- elsif value.is_a?(Hash)
1184
- {}.tap do |hash|
1185
- value.each { |k, v| hash[k] = _to_hash(v) }
1186
- end
1187
- elsif value.respond_to?(:to_hash)
1188
- value.to_hash
1189
- else
1190
- value
1191
- end
1192
- end
1193
-
1194
- end
1195
-
1196
- end
1197
- end