algolia 3.4.0 → 3.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/Gemfile.lock +1 -1
  4. data/lib/algolia/api/abtesting_client.rb +0 -7
  5. data/lib/algolia/api/analytics_client.rb +32 -88
  6. data/lib/algolia/api/ingestion_client.rb +2 -170
  7. data/lib/algolia/api/insights_client.rb +0 -22
  8. data/lib/algolia/api/monitoring_client.rb +11 -11
  9. data/lib/algolia/api/search_client.rb +19 -74
  10. data/lib/algolia/models/abtesting/ab_tests_variant.rb +0 -18
  11. data/lib/algolia/models/abtesting/ab_tests_variant_search_params.rb +0 -18
  12. data/lib/algolia/models/abtesting/add_ab_tests_request.rb +0 -18
  13. data/lib/algolia/models/abtesting/minimum_detectable_effect.rb +0 -18
  14. data/lib/algolia/models/abtesting/schedule_ab_tests_request.rb +0 -18
  15. data/lib/algolia/models/abtesting/variant.rb +0 -18
  16. data/lib/algolia/models/analytics/click_position.rb +0 -32
  17. data/lib/algolia/models/analytics/daily_add_to_cart_rates.rb +0 -28
  18. data/lib/algolia/models/analytics/daily_average_clicks.rb +0 -24
  19. data/lib/algolia/models/analytics/daily_click_through_rates.rb +0 -28
  20. data/lib/algolia/models/analytics/daily_conversion_rates.rb +0 -28
  21. data/lib/algolia/models/analytics/daily_no_click_rates.rb +0 -32
  22. data/lib/algolia/models/analytics/daily_no_results_rates.rb +0 -18
  23. data/lib/algolia/models/analytics/daily_purchase_rates.rb +0 -14
  24. data/lib/algolia/models/analytics/daily_searches_no_clicks.rb +0 -14
  25. data/lib/algolia/models/analytics/daily_searches_no_results.rb +0 -14
  26. data/lib/algolia/models/analytics/get_add_to_cart_rate_response.rb +0 -28
  27. data/lib/algolia/models/analytics/get_average_click_position_response.rb +0 -24
  28. data/lib/algolia/models/analytics/get_click_positions_response.rb +0 -18
  29. data/lib/algolia/models/analytics/get_click_through_rate_response.rb +0 -28
  30. data/lib/algolia/models/analytics/get_conversion_rate_response.rb +0 -28
  31. data/lib/algolia/models/analytics/get_no_click_rate_response.rb +0 -32
  32. data/lib/algolia/models/analytics/get_no_results_rate_response.rb +0 -18
  33. data/lib/algolia/models/analytics/get_purchase_rate_response.rb +0 -14
  34. data/lib/algolia/models/analytics/top_hit_with_analytics.rb +0 -56
  35. data/lib/algolia/models/analytics/top_hit_with_revenue_analytics.rb +0 -98
  36. data/lib/algolia/models/analytics/top_search_with_analytics.rb +0 -90
  37. data/lib/algolia/models/analytics/top_search_with_revenue_analytics.rb +0 -132
  38. data/lib/algolia/models/ingestion/event.rb +0 -14
  39. data/lib/algolia/models/ingestion/pagination.rb +0 -60
  40. data/lib/algolia/models/ingestion/run.rb +0 -18
  41. data/lib/algolia/models/ingestion/source_csv.rb +0 -21
  42. data/lib/algolia/models/ingestion/task.rb +0 -18
  43. data/lib/algolia/models/ingestion/task_create.rb +0 -18
  44. data/lib/algolia/models/ingestion/task_create_v1.rb +0 -18
  45. data/lib/algolia/models/ingestion/task_update.rb +0 -18
  46. data/lib/algolia/models/ingestion/task_update_v1.rb +0 -18
  47. data/lib/algolia/models/ingestion/task_v1.rb +0 -18
  48. data/lib/algolia/models/ingestion/transformation.rb +1 -1
  49. data/lib/algolia/models/ingestion/transformation_create.rb +1 -1
  50. data/lib/algolia/models/insights/added_to_cart_object_ids.rb +0 -123
  51. data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +0 -149
  52. data/lib/algolia/models/insights/clicked_filters.rb +0 -105
  53. data/lib/algolia/models/insights/clicked_object_ids.rb +0 -105
  54. data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +0 -149
  55. data/lib/algolia/models/insights/converted_filters.rb +0 -105
  56. data/lib/algolia/models/insights/converted_object_ids.rb +0 -105
  57. data/lib/algolia/models/insights/converted_object_ids_after_search.rb +0 -131
  58. data/lib/algolia/models/insights/insights_events.rb +0 -18
  59. data/lib/algolia/models/insights/object_data_after_search.rb +0 -26
  60. data/lib/algolia/models/insights/purchased_object_ids.rb +0 -123
  61. data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +0 -123
  62. data/lib/algolia/models/insights/viewed_filters.rb +0 -105
  63. data/lib/algolia/models/insights/viewed_object_ids.rb +0 -105
  64. data/lib/algolia/models/personalization/personalization_strategy_params.rb +0 -18
  65. data/lib/algolia/models/query-suggestions/configuration.rb +0 -17
  66. data/lib/algolia/models/query-suggestions/configuration_response.rb +0 -17
  67. data/lib/algolia/models/query-suggestions/configuration_with_index.rb +0 -17
  68. data/lib/algolia/models/query-suggestions/source_index.rb +0 -28
  69. data/lib/algolia/models/recommend/banner.rb +218 -0
  70. data/lib/algolia/models/{query-suggestions/base_query_suggestions_configuration_response.rb → recommend/banner_image.rb} +31 -38
  71. data/lib/algolia/models/{query-suggestions/base_query_suggestions_configuration_with_index.rb → recommend/banner_image_url.rb} +23 -23
  72. data/lib/algolia/models/{query-suggestions/get_config_status200_response.rb → recommend/banner_link.rb} +13 -53
  73. data/lib/algolia/models/recommend/bought_together_query.rb +0 -36
  74. data/lib/algolia/models/recommend/condition.rb +0 -15
  75. data/lib/algolia/models/recommend/consequence.rb +0 -28
  76. data/lib/algolia/models/recommend/fallback_params.rb +8 -100
  77. data/lib/algolia/models/recommend/looking_similar_query.rb +0 -36
  78. data/lib/algolia/models/recommend/numeric_filters.rb +1 -1
  79. data/lib/algolia/models/recommend/promote_consequence_object.rb +0 -14
  80. data/lib/algolia/models/recommend/ranking_info.rb +0 -112
  81. data/lib/algolia/models/recommend/recommend_hit.rb +0 -18
  82. data/lib/algolia/models/recommend/recommend_search_params.rb +8 -100
  83. data/lib/algolia/models/recommend/recommendations_results.rb +0 -61
  84. data/lib/algolia/models/recommend/recommended_for_you_query.rb +0 -36
  85. data/lib/algolia/models/recommend/related_query.rb +0 -36
  86. data/lib/algolia/models/recommend/rendering_content.rb +14 -5
  87. data/lib/algolia/models/recommend/search_recommend_rules_params.rb +0 -50
  88. data/lib/algolia/models/recommend/search_recommend_rules_response.rb +0 -14
  89. data/lib/algolia/models/recommend/trending_facet_hit.rb +0 -18
  90. data/lib/algolia/models/recommend/trending_facets_query.rb +0 -36
  91. data/lib/algolia/models/recommend/trending_items_query.rb +0 -36
  92. data/lib/algolia/models/recommend/typo_tolerance.rb +1 -1
  93. data/lib/algolia/models/recommend/widgets.rb +212 -0
  94. data/lib/algolia/models/search/api_key.rb +1 -1
  95. data/lib/algolia/models/search/banner.rb +218 -0
  96. data/lib/algolia/models/{query-suggestions/get_log_file200_response.rb → search/banner_image.rb} +21 -61
  97. data/lib/algolia/models/search/banner_image_url.rb +212 -0
  98. data/lib/algolia/models/search/banner_link.rb +212 -0
  99. data/lib/algolia/models/search/browse_params_object.rb +4 -132
  100. data/lib/algolia/models/search/browse_response.rb +0 -61
  101. data/lib/algolia/models/search/condition.rb +0 -15
  102. data/lib/algolia/models/search/consequence.rb +0 -28
  103. data/lib/algolia/models/search/consequence_params.rb +4 -132
  104. data/lib/algolia/models/search/delete_by_params.rb +1 -1
  105. data/lib/algolia/models/search/get_api_key_response.rb +1 -1
  106. data/lib/algolia/models/search/index_settings.rb +7 -85
  107. data/lib/algolia/models/search/log.rb +0 -34
  108. data/lib/algolia/models/search/numeric_filters.rb +1 -1
  109. data/lib/algolia/models/search/promote_object_ids.rb +0 -14
  110. data/lib/algolia/models/search/ranking_info.rb +0 -112
  111. data/lib/algolia/models/search/rendering_content.rb +14 -5
  112. data/lib/algolia/models/search/rule.rb +0 -18
  113. data/lib/algolia/models/search/search_dictionary_entries_params.rb +0 -32
  114. data/lib/algolia/models/search/search_dictionary_entries_response.rb +0 -14
  115. data/lib/algolia/models/search/search_for_facet_values_request.rb +0 -14
  116. data/lib/algolia/models/search/search_for_facets.rb +4 -132
  117. data/lib/algolia/models/search/search_for_hits.rb +4 -132
  118. data/lib/algolia/models/search/search_params_object.rb +4 -132
  119. data/lib/algolia/models/search/search_response.rb +0 -61
  120. data/lib/algolia/models/search/search_rules_params.rb +0 -32
  121. data/lib/algolia/models/search/search_synonyms_params.rb +0 -32
  122. data/lib/algolia/models/search/search_user_ids_params.rb +0 -32
  123. data/lib/algolia/models/search/search_user_ids_response.rb +0 -32
  124. data/lib/algolia/models/search/settings_response.rb +7 -85
  125. data/lib/algolia/models/search/typo_tolerance.rb +1 -1
  126. data/lib/algolia/models/search/user_hit.rb +0 -15
  127. data/lib/algolia/models/search/user_id.rb +0 -15
  128. data/lib/algolia/models/search/widgets.rb +212 -0
  129. data/lib/algolia/version.rb +1 -1
  130. metadata +12 -9
  131. data/lib/algolia/models/query-suggestions/query_suggestions_configuration.rb +0 -276
  132. data/lib/algolia/models/query-suggestions/query_suggestions_configuration_response.rb +0 -316
  133. data/lib/algolia/models/query-suggestions/query_suggestions_configuration_with_index.rb +0 -295
@@ -180,118 +180,6 @@ module Algolia
180
180
  end
181
181
  end
182
182
 
183
- # Custom attribute writer method with validation
184
- # @param [Object] filters Value to be assigned
185
- def filters=(filters)
186
- if filters.nil?
187
- raise ArgumentError, "filters cannot be nil"
188
- end
189
-
190
- if filters < 0
191
- raise ArgumentError, "invalid value for \"filters\", must be greater than or equal to 0."
192
- end
193
-
194
- @filters = filters
195
- end
196
-
197
- # Custom attribute writer method with validation
198
- # @param [Object] first_matched_word Value to be assigned
199
- def first_matched_word=(first_matched_word)
200
- if first_matched_word.nil?
201
- raise ArgumentError, "first_matched_word cannot be nil"
202
- end
203
-
204
- if first_matched_word < 0
205
- raise ArgumentError, "invalid value for \"first_matched_word\", must be greater than or equal to 0."
206
- end
207
-
208
- @first_matched_word = first_matched_word
209
- end
210
-
211
- # Custom attribute writer method with validation
212
- # @param [Object] geo_distance Value to be assigned
213
- def geo_distance=(geo_distance)
214
- if geo_distance.nil?
215
- raise ArgumentError, "geo_distance cannot be nil"
216
- end
217
-
218
- if geo_distance < 0
219
- raise ArgumentError, "invalid value for \"geo_distance\", must be greater than or equal to 0."
220
- end
221
-
222
- @geo_distance = geo_distance
223
- end
224
-
225
- # Custom attribute writer method with validation
226
- # @param [Object] geo_precision Value to be assigned
227
- def geo_precision=(geo_precision)
228
- if geo_precision.nil?
229
- raise ArgumentError, "geo_precision cannot be nil"
230
- end
231
-
232
- if geo_precision < 1
233
- raise ArgumentError, "invalid value for \"geo_precision\", must be greater than or equal to 1."
234
- end
235
-
236
- @geo_precision = geo_precision
237
- end
238
-
239
- # Custom attribute writer method with validation
240
- # @param [Object] nb_exact_words Value to be assigned
241
- def nb_exact_words=(nb_exact_words)
242
- if nb_exact_words.nil?
243
- raise ArgumentError, "nb_exact_words cannot be nil"
244
- end
245
-
246
- if nb_exact_words < 0
247
- raise ArgumentError, "invalid value for \"nb_exact_words\", must be greater than or equal to 0."
248
- end
249
-
250
- @nb_exact_words = nb_exact_words
251
- end
252
-
253
- # Custom attribute writer method with validation
254
- # @param [Object] nb_typos Value to be assigned
255
- def nb_typos=(nb_typos)
256
- if nb_typos.nil?
257
- raise ArgumentError, "nb_typos cannot be nil"
258
- end
259
-
260
- if nb_typos < 0
261
- raise ArgumentError, "invalid value for \"nb_typos\", must be greater than or equal to 0."
262
- end
263
-
264
- @nb_typos = nb_typos
265
- end
266
-
267
- # Custom attribute writer method with validation
268
- # @param [Object] proximity_distance Value to be assigned
269
- def proximity_distance=(proximity_distance)
270
- if proximity_distance.nil?
271
- raise ArgumentError, "proximity_distance cannot be nil"
272
- end
273
-
274
- if proximity_distance < 0
275
- raise ArgumentError, "invalid value for \"proximity_distance\", must be greater than or equal to 0."
276
- end
277
-
278
- @proximity_distance = proximity_distance
279
- end
280
-
281
- # Custom attribute writer method with validation
282
- # @param [Object] words Value to be assigned
283
- def words=(words)
284
- if words.nil?
285
- raise ArgumentError, "words cannot be nil"
286
- end
287
-
288
- if words < 1
289
- raise ArgumentError, "invalid value for \"words\", must be greater than or equal to 1."
290
- end
291
-
292
- @words = words
293
- end
294
-
295
183
  # Checks equality by comparing each attribute.
296
184
  # @param [Object] Object to be compared
297
185
  def ==(other)
@@ -108,24 +108,6 @@ module Algolia
108
108
  self.additional_properties.merge!(attributes.reject { |k, _| self.class.attribute_map.key?(k.to_sym) })
109
109
  end
110
110
 
111
- # Custom attribute writer method with validation
112
- # @param [Object] _score Value to be assigned
113
- def _score=(_score)
114
- if _score.nil?
115
- raise ArgumentError, "_score cannot be nil"
116
- end
117
-
118
- if _score > 100
119
- raise ArgumentError, "invalid value for \"_score\", must be smaller than or equal to 100."
120
- end
121
-
122
- if _score < 0
123
- raise ArgumentError, "invalid value for \"_score\", must be greater than or equal to 0."
124
- end
125
-
126
- @_score = _score
127
- end
128
-
129
111
  # Checks equality by comparing each attribute.
130
112
  # @param [Object] Object to be compared
131
113
  def ==(other)
@@ -33,7 +33,7 @@ module Algolia
33
33
  # 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`.
34
34
  attr_accessor :faceting_after_distinct
35
35
 
36
- # 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`.
36
+ # Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. Only records included within a 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`.
37
37
  attr_accessor :around_lat_lng
38
38
 
39
39
  # Whether to obtain the coordinates from the request's IP address.
@@ -88,10 +88,10 @@ module Algolia
88
88
  # Search query.
89
89
  attr_accessor :query
90
90
 
91
- # Attributes used for [faceting](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/). Facets are attributes that let you categorize search results. They can be used for filtering search results. By default, no attribute is used for faceting. Attribute names are case-sensitive. **Modifiers** - `filterOnly(\"ATTRIBUTE\")`. Allows using this attribute as a filter, but doesn't evalue the facet values. - `searchable(\"ATTRIBUTE\")`. Allows searching for facet values. - `afterDistinct(\"ATTRIBUTE\")`. Evaluates the facet count _after_ deduplication with `distinct`. This ensures accurate facet counts. You can apply this modifier to searchable facets: `afterDistinct(searchable(ATTRIBUTE))`.
91
+ # Attributes used for [faceting](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/). Facets are attributes that let you categorize search results. They can be used for filtering search results. By default, no attribute is used for faceting. Attribute names are case-sensitive. **Modifiers** - `filterOnly(\"ATTRIBUTE\")`. Allows the attribute to be used as a filter but doesn't evaluate the facet values. - `searchable(\"ATTRIBUTE\")`. Allows searching for facet values. - `afterDistinct(\"ATTRIBUTE\")`. Evaluates the facet count _after_ deduplication with `distinct`. This ensures accurate facet counts. You can apply this modifier to searchable facets: `afterDistinct(searchable(ATTRIBUTE))`.
92
92
  attr_accessor :attributes_for_faceting
93
93
 
94
- # Creates [replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/). Replicas are copies of a primary index with the same records but different settings, synonyms, or rules. If you want to offer a different ranking or sorting of your search results, you'll use replica indices. All index operations on a primary index are automatically forwarded to its replicas. To add a replica index, you must provide the complete set of replicas to this parameter. If you omit a replica from this list, the replica turns into a regular, standalone index that will no longer by synced with the primary index. **Modifier** - `virtual(\"REPLICA\")`. Create a virtual replica, Virtual replicas don't increase the number of records and are optimized for [Relevant sorting](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/relevant-sort/).
94
+ # Creates [replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/). Replicas are copies of a primary index with the same records but different settings, synonyms, or rules. If you want to offer a different ranking or sorting of your search results, you'll use replica indices. All index operations on a primary index are automatically forwarded to its replicas. To add a replica index, you must provide the complete set of replicas to this parameter. If you omit a replica from this list, the replica turns into a regular, standalone index that will no longer be synced with the primary index. **Modifier** - `virtual(\"REPLICA\")`. Create a virtual replica, Virtual replicas don't increase the number of records and are optimized for [Relevant sorting](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/relevant-sort/).
95
95
  attr_accessor :replicas
96
96
 
97
97
  # Maximum number of search results that can be obtained through pagination. Higher pagination limits might slow down your search. For pagination limits above 1,000, the sorting of results beyond the 1,000th hit can't be guaranteed.
@@ -121,13 +121,13 @@ module Algolia
121
121
  # Whether arrays with exclusively non-negative integers should be compressed for better performance. If true, the compressed arrays may be reordered.
122
122
  attr_accessor :allow_compression_of_integer_array
123
123
 
124
- # Numeric attributes that can be used as [numerical filters](https://www.algolia.com/doc/guides/managing-results/rules/detecting-intent/how-to/applying-a-custom-filter-for-a-specific-query/#numerical-filters). Attribute names are case-sensitive. By default, all numeric attributes are available as numerical filters. For faster indexing, reduce the number of numeric attributes. If you want to turn off filtering for all numeric attributes, specifiy an attribute that doesn't exist in your index, such as `NO_NUMERIC_FILTERING`. **Modifier** - `equalOnly(\"ATTRIBUTE\")`. Support only filtering based on equality comparisons `=` and `!=`.
124
+ # Numeric attributes that can be used as [numerical filters](https://www.algolia.com/doc/guides/managing-results/rules/detecting-intent/how-to/applying-a-custom-filter-for-a-specific-query/#numerical-filters). Attribute names are case-sensitive. By default, all numeric attributes are available as numerical filters. For faster indexing, reduce the number of numeric attributes. To turn off filtering for all numeric attributes, specify an attribute that doesn't exist in your index, such as `NO_NUMERIC_FILTERING`. **Modifier** - `equalOnly(\"ATTRIBUTE\")`. Support only filtering based on equality comparisons `=` and `!=`.
125
125
  attr_accessor :numeric_attributes_for_filtering
126
126
 
127
127
  # Controls which separators are indexed. Separators are all non-letter characters except spaces and currency characters, such as $€£¥. By default, separator characters aren't indexed. With `separatorsToIndex`, Algolia treats separator characters as separate words. For example, a search for `C#` would report two matches.
128
128
  attr_accessor :separators_to_index
129
129
 
130
- # Attributes used for searching. Attribute names are case-sensitive. By default, all attributes are searchable and the [Attribute](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#attribute) ranking criterion is turned off. With a non-empty list, Algolia only returns results with matches in the selected attributes. In addition, the Attribute ranking criterion is turned on: matches in attributes that are higher in the list of `searchableAttributes` rank first. To make matches in two attributes rank equally, include them in a comma-separated string, such as `\"title,alternate_title\"`. Attributes with the same priority are always unordered. For more information, see [Searchable attributes](https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/how-to/setting-searchable-attributes/). **Modifier** - `unordered(\"ATTRIBUTE\")`. Ignore the position of a match within the attribute. Without modifier, matches at the beginning of an attribute rank higer than matches at the end.
130
+ # Attributes used for searching. Attribute names are case-sensitive. By default, all attributes are searchable and the [Attribute](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#attribute) ranking criterion is turned off. With a non-empty list, Algolia only returns results with matches in the selected attributes. In addition, the Attribute ranking criterion is turned on: matches in attributes that are higher in the list of `searchableAttributes` rank first. To make matches in two attributes rank equally, include them in a comma-separated string, such as `\"title,alternate_title\"`. Attributes with the same priority are always unordered. For more information, see [Searchable attributes](https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/how-to/setting-searchable-attributes/). **Modifier** - `unordered(\"ATTRIBUTE\")`. Ignore the position of a match within the attribute. Without a modifier, matches at the beginning of an attribute rank higher than matches at the end.
131
131
  attr_accessor :searchable_attributes
132
132
 
133
133
  # An object with custom data. You can store up to 32kB as custom data.
@@ -203,10 +203,10 @@ module Algolia
203
203
  # Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported.
204
204
  attr_accessor :advanced_syntax
205
205
 
206
- # 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).
206
+ # 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).
207
207
  attr_accessor :optional_words
208
208
 
209
- # 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.
209
+ # 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.
210
210
  attr_accessor :disable_exact_on_attributes
211
211
 
212
212
  attr_accessor :exact_on_single_word_query
@@ -219,7 +219,7 @@ module Algolia
219
219
 
220
220
  attr_accessor :distinct
221
221
 
222
- # 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.
222
+ # 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.
223
223
  attr_accessor :replace_synonyms_in_highlight
224
224
 
225
225
  # 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.
@@ -872,98 +872,6 @@ module Algolia
872
872
  end
873
873
  end
874
874
 
875
- # Custom attribute writer method with validation
876
- # @param [Object] minimum_around_radius Value to be assigned
877
- def minimum_around_radius=(minimum_around_radius)
878
- if minimum_around_radius.nil?
879
- raise ArgumentError, "minimum_around_radius cannot be nil"
880
- end
881
-
882
- if minimum_around_radius < 1
883
- raise ArgumentError, "invalid value for \"minimum_around_radius\", must be greater than or equal to 1."
884
- end
885
-
886
- @minimum_around_radius = minimum_around_radius
887
- end
888
-
889
- # Custom attribute writer method with validation
890
- # @param [Object] personalization_impact Value to be assigned
891
- def personalization_impact=(personalization_impact)
892
- if personalization_impact.nil?
893
- raise ArgumentError, "personalization_impact cannot be nil"
894
- end
895
-
896
- if personalization_impact > 100
897
- raise ArgumentError, "invalid value for \"personalization_impact\", must be smaller than or equal to 100."
898
- end
899
-
900
- if personalization_impact < 0
901
- raise ArgumentError, "invalid value for \"personalization_impact\", must be greater than or equal to 0."
902
- end
903
-
904
- @personalization_impact = personalization_impact
905
- end
906
-
907
- # Custom attribute writer method with validation
908
- # @param [Object] pagination_limited_to Value to be assigned
909
- def pagination_limited_to=(pagination_limited_to)
910
- if pagination_limited_to.nil?
911
- raise ArgumentError, "pagination_limited_to cannot be nil"
912
- end
913
-
914
- if pagination_limited_to > 20000
915
- raise ArgumentError, "invalid value for \"pagination_limited_to\", must be smaller than or equal to 20000."
916
- end
917
-
918
- @pagination_limited_to = pagination_limited_to
919
- end
920
-
921
- # Custom attribute writer method with validation
922
- # @param [Object] min_proximity Value to be assigned
923
- def min_proximity=(min_proximity)
924
- if min_proximity.nil?
925
- raise ArgumentError, "min_proximity cannot be nil"
926
- end
927
-
928
- if min_proximity > 7
929
- raise ArgumentError, "invalid value for \"min_proximity\", must be smaller than or equal to 7."
930
- end
931
-
932
- if min_proximity < 1
933
- raise ArgumentError, "invalid value for \"min_proximity\", must be greater than or equal to 1."
934
- end
935
-
936
- @min_proximity = min_proximity
937
- end
938
-
939
- # Custom attribute writer method with validation
940
- # @param [Object] max_facet_hits Value to be assigned
941
- def max_facet_hits=(max_facet_hits)
942
- if max_facet_hits.nil?
943
- raise ArgumentError, "max_facet_hits cannot be nil"
944
- end
945
-
946
- if max_facet_hits > 100
947
- raise ArgumentError, "invalid value for \"max_facet_hits\", must be smaller than or equal to 100."
948
- end
949
-
950
- @max_facet_hits = max_facet_hits
951
- end
952
-
953
- # Custom attribute writer method with validation
954
- # @param [Object] max_values_per_facet Value to be assigned
955
- def max_values_per_facet=(max_values_per_facet)
956
- if max_values_per_facet.nil?
957
- raise ArgumentError, "max_values_per_facet cannot be nil"
958
- end
959
-
960
- if max_values_per_facet > 1000
961
- raise ArgumentError, "invalid value for \"max_values_per_facet\", must be smaller than or equal to 1000."
962
- end
963
-
964
- @max_values_per_facet = max_values_per_facet
965
- end
966
-
967
875
  # Checks equality by comparing each attribute.
968
876
  # @param [Object] Object to be compared
969
877
  def ==(other)
@@ -339,67 +339,6 @@ module Algolia
339
339
  end
340
340
  end
341
341
 
342
- # Custom attribute writer method with validation
343
- # @param [Object] ab_test_variant_id Value to be assigned
344
- def ab_test_variant_id=(ab_test_variant_id)
345
- if ab_test_variant_id.nil?
346
- raise ArgumentError, "ab_test_variant_id cannot be nil"
347
- end
348
-
349
- if ab_test_variant_id < 1
350
- raise ArgumentError, "invalid value for \"ab_test_variant_id\", must be greater than or equal to 1."
351
- end
352
-
353
- @ab_test_variant_id = ab_test_variant_id
354
- end
355
-
356
- # Custom attribute writer method with validation
357
- # @param [Object] around_lat_lng Value to be assigned
358
- def around_lat_lng=(around_lat_lng)
359
- if around_lat_lng.nil?
360
- raise ArgumentError, "around_lat_lng cannot be nil"
361
- end
362
-
363
- pattern = /^(-?\d+(\.\d+)?),\s*(-?\d+(\.\d+)?)$/
364
- if around_lat_lng !~ pattern
365
- raise ArgumentError, "invalid value for \"around_lat_lng\", must conform to the pattern #{pattern}."
366
- end
367
-
368
- @around_lat_lng = around_lat_lng
369
- end
370
-
371
- # Custom attribute writer method with validation
372
- # @param [Object] page Value to be assigned
373
- def page=(page)
374
- if page.nil?
375
- raise ArgumentError, "page cannot be nil"
376
- end
377
-
378
- if page < 0
379
- raise ArgumentError, "invalid value for \"page\", must be greater than or equal to 0."
380
- end
381
-
382
- @page = page
383
- end
384
-
385
- # Custom attribute writer method with validation
386
- # @param [Object] hits_per_page Value to be assigned
387
- def hits_per_page=(hits_per_page)
388
- if hits_per_page.nil?
389
- raise ArgumentError, "hits_per_page cannot be nil"
390
- end
391
-
392
- if hits_per_page > 1000
393
- raise ArgumentError, "invalid value for \"hits_per_page\", must be smaller than or equal to 1000."
394
- end
395
-
396
- if hits_per_page < 1
397
- raise ArgumentError, "invalid value for \"hits_per_page\", must be greater than or equal to 1."
398
- end
399
-
400
- @hits_per_page = hits_per_page
401
- end
402
-
403
342
  # Checks equality by comparing each attribute.
404
343
  # @param [Object] Object to be compared
405
344
  def ==(other)
@@ -119,42 +119,6 @@ module Algolia
119
119
  end
120
120
  end
121
121
 
122
- # Custom attribute writer method with validation
123
- # @param [Object] threshold Value to be assigned
124
- def threshold=(threshold)
125
- if threshold.nil?
126
- raise ArgumentError, "threshold cannot be nil"
127
- end
128
-
129
- if threshold > 100
130
- raise ArgumentError, "invalid value for \"threshold\", must be smaller than or equal to 100."
131
- end
132
-
133
- if threshold < 0
134
- raise ArgumentError, "invalid value for \"threshold\", must be greater than or equal to 0."
135
- end
136
-
137
- @threshold = threshold
138
- end
139
-
140
- # Custom attribute writer method with validation
141
- # @param [Object] max_recommendations Value to be assigned
142
- def max_recommendations=(max_recommendations)
143
- if max_recommendations.nil?
144
- raise ArgumentError, "max_recommendations cannot be nil"
145
- end
146
-
147
- if max_recommendations > 1000
148
- raise ArgumentError, "invalid value for \"max_recommendations\", must be smaller than or equal to 1000."
149
- end
150
-
151
- if max_recommendations < 1
152
- raise ArgumentError, "invalid value for \"max_recommendations\", must be greater than or equal to 1."
153
- end
154
-
155
- @max_recommendations = max_recommendations
156
- end
157
-
158
122
  # Checks equality by comparing each attribute.
159
123
  # @param [Object] Object to be compared
160
124
  def ==(other)
@@ -130,42 +130,6 @@ module Algolia
130
130
  end
131
131
  end
132
132
 
133
- # Custom attribute writer method with validation
134
- # @param [Object] threshold Value to be assigned
135
- def threshold=(threshold)
136
- if threshold.nil?
137
- raise ArgumentError, "threshold cannot be nil"
138
- end
139
-
140
- if threshold > 100
141
- raise ArgumentError, "invalid value for \"threshold\", must be smaller than or equal to 100."
142
- end
143
-
144
- if threshold < 0
145
- raise ArgumentError, "invalid value for \"threshold\", must be greater than or equal to 0."
146
- end
147
-
148
- @threshold = threshold
149
- end
150
-
151
- # Custom attribute writer method with validation
152
- # @param [Object] max_recommendations Value to be assigned
153
- def max_recommendations=(max_recommendations)
154
- if max_recommendations.nil?
155
- raise ArgumentError, "max_recommendations cannot be nil"
156
- end
157
-
158
- if max_recommendations > 1000
159
- raise ArgumentError, "invalid value for \"max_recommendations\", must be smaller than or equal to 1000."
160
- end
161
-
162
- if max_recommendations < 1
163
- raise ArgumentError, "invalid value for \"max_recommendations\", must be greater than or equal to 1."
164
- end
165
-
166
- @max_recommendations = max_recommendations
167
- end
168
-
169
133
  # Checks equality by comparing each attribute.
170
134
  # @param [Object] Object to be compared
171
135
  def ==(other)
@@ -5,17 +5,20 @@ require "time"
5
5
 
6
6
  module Algolia
7
7
  module Recommend
8
- # Extra data that can be used in the search UI. You can use this to control aspects of your search UI, such as, the order of facet names and values without changing your frontend code.
8
+ # Extra data that can be used in the search UI. You can use this to control aspects of your search UI, such as the order of facet names and values without changing your frontend code.
9
9
  class RenderingContent
10
10
  attr_accessor :facet_ordering
11
11
 
12
12
  attr_accessor :redirect
13
13
 
14
+ attr_accessor :widgets
15
+
14
16
  # Attribute mapping from ruby-style variable name to JSON key.
15
17
  def self.attribute_map
16
18
  {
17
19
  :facet_ordering => :facetOrdering,
18
- :redirect => :redirect
20
+ :redirect => :redirect,
21
+ :widgets => :widgets
19
22
  }
20
23
  end
21
24
 
@@ -28,7 +31,8 @@ module Algolia
28
31
  def self.types_mapping
29
32
  {
30
33
  :facet_ordering => :"FacetOrdering",
31
- :redirect => :"RedirectURL"
34
+ :redirect => :"RedirectURL",
35
+ :widgets => :"Widgets"
32
36
  }
33
37
  end
34
38
 
@@ -69,6 +73,10 @@ module Algolia
69
73
  if attributes.key?(:redirect)
70
74
  self.redirect = attributes[:redirect]
71
75
  end
76
+
77
+ if attributes.key?(:widgets)
78
+ self.widgets = attributes[:widgets]
79
+ end
72
80
  end
73
81
 
74
82
  # Checks equality by comparing each attribute.
@@ -77,7 +85,8 @@ module Algolia
77
85
  return true if self.equal?(other)
78
86
  self.class == other.class &&
79
87
  facet_ordering == other.facet_ordering &&
80
- redirect == other.redirect
88
+ redirect == other.redirect &&
89
+ widgets == other.widgets
81
90
  end
82
91
 
83
92
  # @see the `==` method
@@ -89,7 +98,7 @@ module Algolia
89
98
  # Calculates hash code according to all attributes.
90
99
  # @return [Integer] Hash code
91
100
  def hash
92
- [facet_ordering, redirect].hash
101
+ [facet_ordering, redirect, widgets].hash
93
102
  end
94
103
 
95
104
  # Builds the object from hash
@@ -129,56 +129,6 @@ module Algolia
129
129
  end
130
130
  end
131
131
 
132
- # Custom attribute writer method with validation
133
- # @param [Object] page Value to be assigned
134
- def page=(page)
135
- if page.nil?
136
- raise ArgumentError, "page cannot be nil"
137
- end
138
-
139
- if page < 0
140
- raise ArgumentError, "invalid value for \"page\", must be greater than or equal to 0."
141
- end
142
-
143
- @page = page
144
- end
145
-
146
- # Custom attribute writer method with validation
147
- # @param [Object] hits_per_page Value to be assigned
148
- def hits_per_page=(hits_per_page)
149
- if hits_per_page.nil?
150
- raise ArgumentError, "hits_per_page cannot be nil"
151
- end
152
-
153
- if hits_per_page > 1000
154
- raise ArgumentError, "invalid value for \"hits_per_page\", must be smaller than or equal to 1000."
155
- end
156
-
157
- if hits_per_page < 1
158
- raise ArgumentError, "invalid value for \"hits_per_page\", must be greater than or equal to 1."
159
- end
160
-
161
- @hits_per_page = hits_per_page
162
- end
163
-
164
- # Custom attribute writer method with validation
165
- # @param [Object] max_values_per_facet Value to be assigned
166
- def max_values_per_facet=(max_values_per_facet)
167
- if max_values_per_facet.nil?
168
- raise ArgumentError, "max_values_per_facet cannot be nil"
169
- end
170
-
171
- if max_values_per_facet > 1000
172
- raise ArgumentError, "invalid value for \"max_values_per_facet\", must be smaller than or equal to 1000."
173
- end
174
-
175
- if max_values_per_facet < 1
176
- raise ArgumentError, "invalid value for \"max_values_per_facet\", must be greater than or equal to 1."
177
- end
178
-
179
- @max_values_per_facet = max_values_per_facet
180
- end
181
-
182
132
  # Checks equality by comparing each attribute.
183
133
  # @param [Object] Object to be compared
184
134
  def ==(other)
@@ -100,20 +100,6 @@ module Algolia
100
100
  end
101
101
  end
102
102
 
103
- # Custom attribute writer method with validation
104
- # @param [Object] page Value to be assigned
105
- def page=(page)
106
- if page.nil?
107
- raise ArgumentError, "page cannot be nil"
108
- end
109
-
110
- if page < 0
111
- raise ArgumentError, "invalid value for \"page\", must be greater than or equal to 0."
112
- end
113
-
114
- @page = page
115
- end
116
-
117
103
  # Checks equality by comparing each attribute.
118
104
  # @param [Object] Object to be compared
119
105
  def ==(other)
@@ -88,24 +88,6 @@ module Algolia
88
88
  end
89
89
  end
90
90
 
91
- # Custom attribute writer method with validation
92
- # @param [Object] _score Value to be assigned
93
- def _score=(_score)
94
- if _score.nil?
95
- raise ArgumentError, "_score cannot be nil"
96
- end
97
-
98
- if _score > 100
99
- raise ArgumentError, "invalid value for \"_score\", must be smaller than or equal to 100."
100
- end
101
-
102
- if _score < 0
103
- raise ArgumentError, "invalid value for \"_score\", must be greater than or equal to 0."
104
- end
105
-
106
- @_score = _score
107
- end
108
-
109
91
  # Checks equality by comparing each attribute.
110
92
  # @param [Object] Object to be compared
111
93
  def ==(other)