algolia 3.0.0.alpha.15 → 3.0.0.alpha.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (198) hide show
  1. checksums.yaml +4 -4
  2. data/.openapi-generator/FILES +10 -167
  3. data/CHANGELOG.md +14 -0
  4. data/Gemfile.lock +1 -1
  5. data/lib/algolia/api/analytics_client.rb +76 -76
  6. data/lib/algolia/api/ingestion_client.rb +267 -196
  7. data/lib/algolia/api/monitoring_client.rb +49 -49
  8. data/lib/algolia/api/query_suggestions_client.rb +14 -14
  9. data/lib/algolia/api/recommend_client.rb +22 -22
  10. data/lib/algolia/api/search_client.rb +8 -8
  11. data/lib/algolia/api/usage_client.rb +329 -0
  12. data/lib/algolia/models/analytics/get_status_response.rb +1 -1
  13. data/lib/algolia/models/ingestion/auth_algolia.rb +3 -2
  14. data/lib/algolia/models/ingestion/auth_algolia_insights.rb +212 -0
  15. data/lib/algolia/models/{recommend/consequence_query_object.rb → ingestion/auth_algolia_insights_partial.rb} +21 -24
  16. data/lib/algolia/models/ingestion/auth_algolia_partial.rb +3 -2
  17. data/lib/algolia/models/ingestion/auth_api_key.rb +2 -1
  18. data/lib/algolia/models/ingestion/auth_api_key_partial.rb +2 -1
  19. data/lib/algolia/models/ingestion/auth_basic.rb +3 -1
  20. data/lib/algolia/models/ingestion/auth_basic_partial.rb +3 -1
  21. data/lib/algolia/models/ingestion/auth_google_service_account.rb +3 -3
  22. data/lib/algolia/models/ingestion/auth_google_service_account_partial.rb +3 -3
  23. data/lib/algolia/models/ingestion/auth_input.rb +1 -0
  24. data/lib/algolia/models/ingestion/auth_input_partial.rb +1 -0
  25. data/lib/algolia/models/ingestion/auth_o_auth.rb +18 -8
  26. data/lib/algolia/models/ingestion/auth_o_auth_partial.rb +18 -8
  27. data/lib/algolia/models/ingestion/authentication.rb +5 -5
  28. data/lib/algolia/models/ingestion/authentication_create.rb +2 -2
  29. data/lib/algolia/models/ingestion/authentication_create_response.rb +4 -4
  30. data/lib/algolia/models/ingestion/authentication_search.rb +1 -1
  31. data/lib/algolia/models/ingestion/authentication_type.rb +2 -1
  32. data/lib/algolia/models/ingestion/authentication_update.rb +2 -2
  33. data/lib/algolia/models/ingestion/authentication_update_response.rb +4 -4
  34. data/lib/algolia/models/ingestion/big_commerce_channel.rb +2 -2
  35. data/lib/algolia/models/ingestion/big_commerce_metafield.rb +2 -2
  36. data/lib/algolia/models/ingestion/commercetools_custom_fields.rb +1 -1
  37. data/lib/algolia/models/ingestion/delete_response.rb +1 -1
  38. data/lib/algolia/models/ingestion/destination.rb +6 -6
  39. data/lib/algolia/models/ingestion/destination_create.rb +3 -3
  40. data/lib/algolia/models/ingestion/destination_create_response.rb +4 -4
  41. data/lib/algolia/models/ingestion/destination_index_name.rb +2 -2
  42. data/lib/algolia/models/ingestion/destination_index_prefix.rb +1 -1
  43. data/lib/algolia/models/ingestion/destination_search.rb +1 -1
  44. data/lib/algolia/models/ingestion/destination_type.rb +1 -2
  45. data/lib/algolia/models/ingestion/destination_update.rb +3 -3
  46. data/lib/algolia/models/ingestion/destination_update_response.rb +4 -4
  47. data/lib/algolia/models/ingestion/docker_source_discover.rb +2 -2
  48. data/lib/algolia/models/ingestion/event.rb +3 -3
  49. data/lib/algolia/models/ingestion/list_tasks_response.rb +1 -1
  50. data/lib/algolia/models/ingestion/mapping_format_schema.rb +32 -0
  51. data/lib/algolia/models/ingestion/mapping_input.rb +24 -3
  52. data/lib/algolia/models/ingestion/on_demand_date_utils_input.rb +3 -3
  53. data/lib/algolia/models/ingestion/on_demand_trigger.rb +2 -2
  54. data/lib/algolia/models/ingestion/on_demand_trigger_input.rb +1 -1
  55. data/lib/algolia/models/ingestion/pagination.rb +65 -0
  56. data/lib/algolia/models/ingestion/platform.rb +2 -1
  57. data/lib/algolia/models/ingestion/run.rb +7 -7
  58. data/lib/algolia/models/ingestion/run_response.rb +3 -3
  59. data/lib/algolia/models/ingestion/schedule_date_utils_input.rb +2 -2
  60. data/lib/algolia/models/ingestion/schedule_trigger.rb +4 -4
  61. data/lib/algolia/models/ingestion/schedule_trigger_input.rb +2 -2
  62. data/lib/algolia/models/ingestion/source.rb +4 -4
  63. data/lib/algolia/models/ingestion/source_big_commerce.rb +1 -1
  64. data/lib/algolia/models/ingestion/source_big_query.rb +5 -5
  65. data/lib/algolia/models/ingestion/source_commercetools.rb +2 -2
  66. data/lib/algolia/models/ingestion/source_create.rb +2 -1
  67. data/lib/algolia/models/ingestion/source_create_response.rb +3 -2
  68. data/lib/algolia/models/ingestion/source_csv.rb +3 -3
  69. data/lib/algolia/models/ingestion/source_docker.rb +3 -3
  70. data/lib/algolia/models/ingestion/source_ga4_big_query_export.rb +3 -3
  71. data/lib/algolia/models/ingestion/source_json.rb +2 -2
  72. data/lib/algolia/models/ingestion/source_type.rb +5 -3
  73. data/lib/algolia/models/ingestion/source_update.rb +2 -1
  74. data/lib/algolia/models/ingestion/source_update_commercetools.rb +2 -3
  75. data/lib/algolia/models/ingestion/source_update_docker.rb +3 -3
  76. data/lib/algolia/models/ingestion/source_update_response.rb +3 -2
  77. data/lib/algolia/models/ingestion/streaming_trigger.rb +1 -1
  78. data/lib/algolia/models/ingestion/streaming_utils_input.rb +1 -1
  79. data/lib/algolia/models/ingestion/subscription_trigger.rb +1 -1
  80. data/lib/algolia/models/ingestion/task.rb +7 -7
  81. data/lib/algolia/models/ingestion/task_create.rb +5 -5
  82. data/lib/algolia/models/ingestion/task_create_response.rb +3 -3
  83. data/lib/algolia/models/ingestion/task_input.rb +1 -0
  84. data/lib/algolia/models/ingestion/task_update.rb +4 -4
  85. data/lib/algolia/models/ingestion/task_update_response.rb +3 -3
  86. data/lib/algolia/models/ingestion/trigger.rb +1 -0
  87. data/lib/algolia/models/ingestion/trigger_update_input.rb +2 -2
  88. data/lib/algolia/models/ingestion/window.rb +3 -3
  89. data/lib/algolia/models/insights/added_to_cart_object_ids.rb +1 -1
  90. data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +1 -1
  91. data/lib/algolia/models/insights/clicked_filters.rb +1 -1
  92. data/lib/algolia/models/insights/clicked_object_ids.rb +1 -1
  93. data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +1 -1
  94. data/lib/algolia/models/insights/converted_filters.rb +1 -1
  95. data/lib/algolia/models/insights/converted_object_ids.rb +1 -1
  96. data/lib/algolia/models/insights/converted_object_ids_after_search.rb +1 -1
  97. data/lib/algolia/models/insights/purchased_object_ids.rb +1 -1
  98. data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +3 -1
  99. data/lib/algolia/models/insights/viewed_filters.rb +1 -1
  100. data/lib/algolia/models/insights/viewed_object_ids.rb +1 -1
  101. data/lib/algolia/models/monitoring/{get_inventory403_response.rb → get_servers403_response.rb} +3 -3
  102. data/lib/algolia/models/monitoring/incidents_inner.rb +1 -1
  103. data/lib/algolia/models/monitoring/probes_metric.rb +1 -1
  104. data/lib/algolia/models/monitoring/server.rb +2 -2
  105. data/lib/algolia/models/monitoring/time_inner.rb +1 -1
  106. data/lib/algolia/models/query-suggestions/app_id.rb +197 -0
  107. data/lib/algolia/models/query-suggestions/get_config_status200_response.rb +4 -4
  108. data/lib/algolia/models/query-suggestions/get_log_file200_response.rb +2 -2
  109. data/lib/algolia/models/query-suggestions/languages.rb +1 -1
  110. data/lib/algolia/models/query-suggestions/query_suggestions_configuration.rb +2 -3
  111. data/lib/algolia/models/query-suggestions/query_suggestions_configuration_response.rb +23 -34
  112. data/lib/algolia/models/query-suggestions/query_suggestions_configuration_with_index.rb +18 -20
  113. data/lib/algolia/models/query-suggestions/source_index.rb +3 -5
  114. data/lib/algolia/models/recommend/auto_facet_filter.rb +208 -0
  115. data/lib/algolia/models/recommend/base_recommend_request.rb +36 -7
  116. data/lib/algolia/models/recommend/base_search_params.rb +1 -1
  117. data/lib/algolia/models/recommend/base_search_params_without_query.rb +1 -1
  118. data/lib/algolia/models/recommend/bought_together_query.rb +319 -0
  119. data/lib/algolia/models/recommend/condition.rb +12 -62
  120. data/lib/algolia/models/recommend/consequence.rb +32 -54
  121. data/lib/algolia/models/recommend/deleted_at_response.rb +1 -1
  122. data/lib/algolia/models/recommend/{recommended_for_you_query_parameters.rb → fallback_params.rb} +9 -12
  123. data/lib/algolia/models/recommend/{edit_type.rb → fbt_model.rb} +5 -6
  124. data/lib/algolia/models/recommend/{base_trending_facets_query.rb → frequently_bought_together.rb} +20 -18
  125. data/lib/algolia/models/recommend/get_recommendations_params.rb +2 -2
  126. data/lib/algolia/models/recommend/{consequence_hide.rb → hide_consequence_object.rb} +4 -6
  127. data/lib/algolia/models/recommend/index_settings_as_search_params.rb +5 -5
  128. data/lib/algolia/models/recommend/{base_recommendations_query.rb → looking_similar.rb} +6 -15
  129. data/lib/algolia/models/recommend/{anchoring.rb → looking_similar_model.rb} +5 -8
  130. data/lib/algolia/models/recommend/looking_similar_query.rb +328 -0
  131. data/lib/algolia/models/recommend/{params.rb → params_consequence.rb} +26 -28
  132. data/lib/algolia/models/recommend/{promote_object_id.rb → promote_consequence_object.rb} +19 -9
  133. data/lib/algolia/models/recommend/{rule_response.rb → recommend_rule.rb} +13 -18
  134. data/lib/algolia/models/recommend/{rule_response_metadata.rb → recommend_rule_metadata.rb} +5 -4
  135. data/lib/algolia/models/recommend/recommendations_hits.rb +4 -24
  136. data/lib/algolia/models/recommend/recommendations_request.rb +3 -1
  137. data/lib/algolia/models/recommend/recommendations_results.rb +4 -24
  138. data/lib/algolia/models/recommend/{base_recommended_for_you_query.rb → recommended_for_you.rb} +5 -14
  139. data/lib/algolia/models/recommend/recommended_for_you_query.rb +35 -15
  140. data/lib/algolia/models/recommend/{recommendation_models.rb → related_model.rb} +4 -5
  141. data/lib/algolia/models/recommend/{edit.rb → related_products.rb} +27 -24
  142. data/lib/algolia/models/recommend/{recommendations_query.rb → related_query.rb} +39 -19
  143. data/lib/algolia/models/recommend/{consequence_params.rb → search_params.rb} +25 -44
  144. data/lib/algolia/models/recommend/search_params_object.rb +6 -6
  145. data/lib/algolia/models/recommend/search_recommend_rules_params.rb +58 -10
  146. data/lib/algolia/models/recommend/search_recommend_rules_response.rb +2 -2
  147. data/lib/algolia/models/recommend/trending_facet_hit.rb +2 -2
  148. data/lib/algolia/models/recommend/trending_facets.rb +243 -0
  149. data/lib/algolia/models/recommend/trending_facets_query.rb +50 -10
  150. data/lib/algolia/models/recommend/{base_trending_items_query.rb → trending_items.rb} +12 -15
  151. data/lib/algolia/models/recommend/trending_items_query.rb +42 -16
  152. data/lib/algolia/models/search/add_api_key_response.rb +1 -1
  153. data/lib/algolia/models/search/base_get_api_key_response.rb +1 -1
  154. data/lib/algolia/models/search/base_index_settings.rb +4 -4
  155. data/lib/algolia/models/search/base_search_params.rb +1 -1
  156. data/lib/algolia/models/search/base_search_params_without_query.rb +1 -1
  157. data/lib/algolia/models/search/browse_params_object.rb +6 -6
  158. data/lib/algolia/models/search/consequence_params.rb +6 -6
  159. data/lib/algolia/models/search/created_at_response.rb +1 -1
  160. data/lib/algolia/models/search/delete_api_key_response.rb +1 -1
  161. data/lib/algolia/models/search/delete_by_params.rb +1 -1
  162. data/lib/algolia/models/search/delete_source_response.rb +1 -1
  163. data/lib/algolia/models/search/deleted_at_response.rb +1 -1
  164. data/lib/algolia/models/search/fetched_index.rb +1 -1
  165. data/lib/algolia/models/search/get_api_key_response.rb +1 -1
  166. data/lib/algolia/models/search/index_settings.rb +9 -9
  167. data/lib/algolia/models/search/index_settings_as_search_params.rb +5 -5
  168. data/lib/algolia/models/search/log.rb +1 -1
  169. data/lib/algolia/models/search/remove_user_id_response.rb +1 -1
  170. data/lib/algolia/models/search/replace_source_response.rb +1 -1
  171. data/lib/algolia/models/search/save_object_response.rb +1 -1
  172. data/lib/algolia/models/search/save_synonym_response.rb +1 -1
  173. data/lib/algolia/models/search/search_for_facets.rb +6 -6
  174. data/lib/algolia/models/search/search_for_hits.rb +6 -6
  175. data/lib/algolia/models/search/search_params_object.rb +6 -6
  176. data/lib/algolia/models/search/search_user_ids_response.rb +1 -1
  177. data/lib/algolia/models/search/secured_api_key_restrictions.rb +1 -1
  178. data/lib/algolia/models/search/update_api_key_response.rb +1 -1
  179. data/lib/algolia/models/search/updated_at_response.rb +1 -1
  180. data/lib/algolia/models/search/updated_at_with_object_id_response.rb +1 -1
  181. data/lib/algolia/models/search/updated_rule_response.rb +1 -1
  182. data/lib/algolia/models/search/user_hit.rb +1 -1
  183. data/lib/algolia/models/search/user_id.rb +1 -1
  184. data/lib/algolia/models/usage/error_base.rb +205 -0
  185. data/lib/algolia/models/usage/get_usage200_response.rb +198 -0
  186. data/lib/algolia/models/usage/get_usage200_response_statistics_inner.rb +206 -0
  187. data/lib/algolia/models/{recommend/base_recommended_for_you_query_parameters.rb → usage/get_usage400_response.rb} +13 -14
  188. data/lib/algolia/models/usage/get_usage400_response_error.rb +216 -0
  189. data/lib/algolia/models/usage/get_usage400_response_error_errors_inner.rb +225 -0
  190. data/lib/algolia/models/usage/granularity.rb +33 -0
  191. data/lib/algolia/models/usage/statistic.rb +116 -0
  192. data/lib/algolia/models/{recommend/promote.rb → usage/statistic_value.rb} +5 -5
  193. data/lib/algolia/version.rb +1 -1
  194. metadata +37 -26
  195. data/lib/algolia/models/recommend/automatic_facet_filter.rb +0 -220
  196. data/lib/algolia/models/recommend/automatic_facet_filters.rb +0 -97
  197. data/lib/algolia/models/recommend/consequence_query.rb +0 -97
  198. data/lib/algolia/models/recommend/promote_object_ids.rb +0 -228
@@ -5,23 +5,23 @@ require 'time'
5
5
 
6
6
  module Algolia
7
7
  module Recommend
8
- class RecommendationsQuery
8
+ class RelatedQuery
9
9
  # Index name.
10
10
  attr_accessor :index_name
11
11
 
12
- # Recommendations with a confidence score lower than `threshold` won't appear in results. > **Note**: Each recommendation has a confidence score of 0 to 100. The closer the score is to 100, the more relevant the recommendations are.
12
+ # Minimum score a recommendation must have to be included in the response.
13
13
  attr_accessor :threshold
14
14
 
15
- # Maximum number of recommendations to retrieve. If 0, all recommendations will be returned.
15
+ # Maximum number of recommendations to retrieve. By default, all recommendations are returned and no fallback request is made. Depending on the available recommendations and the other request parameters, the actual number of recommendations may be lower than this value.
16
16
  attr_accessor :max_recommendations
17
17
 
18
+ attr_accessor :query_parameters
19
+
18
20
  attr_accessor :model
19
21
 
20
22
  # Unique record identifier.
21
23
  attr_accessor :object_id
22
24
 
23
- attr_accessor :query_parameters
24
-
25
25
  attr_accessor :fallback_parameters
26
26
 
27
27
  class EnumAttributeValidator
@@ -52,9 +52,9 @@ module Algolia
52
52
  :index_name => :indexName,
53
53
  :threshold => :threshold,
54
54
  :max_recommendations => :maxRecommendations,
55
+ :query_parameters => :queryParameters,
55
56
  :model => :model,
56
57
  :object_id => :objectID,
57
- :query_parameters => :queryParameters,
58
58
  :fallback_parameters => :fallbackParameters
59
59
  }
60
60
  end
@@ -68,12 +68,12 @@ module Algolia
68
68
  def self.types_mapping
69
69
  {
70
70
  :index_name => :String,
71
- :threshold => :Integer,
71
+ :threshold => :Float,
72
72
  :max_recommendations => :Integer,
73
- :model => :RecommendationModels,
73
+ :query_parameters => :SearchParams,
74
+ :model => :RelatedModel,
74
75
  :object_id => :String,
75
- :query_parameters => :SearchParamsObject,
76
- :fallback_parameters => :SearchParamsObject
76
+ :fallback_parameters => :FallbackParams
77
77
  }
78
78
  end
79
79
 
@@ -86,7 +86,7 @@ module Algolia
86
86
  def self.openapi_all_of
87
87
  [
88
88
  :BaseRecommendRequest,
89
- :BaseRecommendationsQuery
89
+ :RelatedProducts
90
90
  ]
91
91
  end
92
92
 
@@ -94,14 +94,14 @@ module Algolia
94
94
  # @param [Hash] attributes Model attributes in the form of hash
95
95
  def initialize(attributes = {})
96
96
  unless attributes.is_a?(Hash)
97
- raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::RecommendationsQuery` initialize method"
97
+ raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::RelatedQuery` initialize method"
98
98
  end
99
99
 
100
100
  # check to see if the attribute exists and convert string to symbol for hash key
101
101
  attributes = attributes.each_with_object({}) do |(k, v), h|
102
102
  unless self.class.attribute_map.key?(k.to_sym)
103
103
  raise ArgumentError,
104
- "`#{k}` is not a valid attribute in `Algolia::RecommendationsQuery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
104
+ "`#{k}` is not a valid attribute in `Algolia::RelatedQuery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
105
105
  end
106
106
 
107
107
  h[k.to_sym] = v
@@ -115,12 +115,18 @@ module Algolia
115
115
 
116
116
  if attributes.key?(:threshold)
117
117
  self.threshold = attributes[:threshold]
118
+ else
119
+ self.threshold = nil
118
120
  end
119
121
 
120
122
  if attributes.key?(:max_recommendations)
121
123
  self.max_recommendations = attributes[:max_recommendations]
122
124
  end
123
125
 
126
+ if attributes.key?(:query_parameters)
127
+ self.query_parameters = attributes[:query_parameters]
128
+ end
129
+
124
130
  if attributes.key?(:model)
125
131
  self.model = attributes[:model]
126
132
  else
@@ -133,10 +139,6 @@ module Algolia
133
139
  self.object_id = nil
134
140
  end
135
141
 
136
- if attributes.key?(:query_parameters)
137
- self.query_parameters = attributes[:query_parameters]
138
- end
139
-
140
142
  if attributes.key?(:fallback_parameters)
141
143
  self.fallback_parameters = attributes[:fallback_parameters]
142
144
  end
@@ -160,6 +162,24 @@ module Algolia
160
162
  @threshold = threshold
161
163
  end
162
164
 
165
+ # Custom attribute writer method with validation
166
+ # @param [Object] max_recommendations Value to be assigned
167
+ def max_recommendations=(max_recommendations)
168
+ if max_recommendations.nil?
169
+ raise ArgumentError, 'max_recommendations cannot be nil'
170
+ end
171
+
172
+ if max_recommendations > 1000
173
+ raise ArgumentError, 'invalid value for "max_recommendations", must be smaller than or equal to 1000.'
174
+ end
175
+
176
+ if max_recommendations < 1
177
+ raise ArgumentError, 'invalid value for "max_recommendations", must be greater than or equal to 1.'
178
+ end
179
+
180
+ @max_recommendations = max_recommendations
181
+ end
182
+
163
183
  # Checks equality by comparing each attribute.
164
184
  # @param [Object] Object to be compared
165
185
  def ==(other)
@@ -169,9 +189,9 @@ module Algolia
169
189
  index_name == other.index_name &&
170
190
  threshold == other.threshold &&
171
191
  max_recommendations == other.max_recommendations &&
192
+ query_parameters == other.query_parameters &&
172
193
  model == other.model &&
173
194
  object_id == other.object_id &&
174
- query_parameters == other.query_parameters &&
175
195
  fallback_parameters == other.fallback_parameters
176
196
  end
177
197
 
@@ -184,7 +204,7 @@ module Algolia
184
204
  # Calculates hash code according to all attributes.
185
205
  # @return [Integer] Hash code
186
206
  def hash
187
- [index_name, threshold, max_recommendations, model, object_id, query_parameters, fallback_parameters].hash
207
+ [index_name, threshold, max_recommendations, query_parameters, model, object_id, fallback_parameters].hash
188
208
  end
189
209
 
190
210
  # Builds the object from hash
@@ -5,11 +5,14 @@ require 'time'
5
5
 
6
6
  module Algolia
7
7
  module Recommend
8
- class ConsequenceParams
8
+ class SearchParams
9
+ # Search query.
10
+ attr_accessor :query
11
+
9
12
  # 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.
10
13
  attr_accessor :similar_query
11
14
 
12
- # Filter the search so that only records with matching values are included in the results. These filters are supported: - **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/).
15
+ # 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/).
13
16
  attr_accessor :filters
14
17
 
15
18
  attr_accessor :facet_filters
@@ -96,10 +99,10 @@ module Algolia
96
99
  # Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. - `*` 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.
97
100
  attr_accessor :attributes_to_retrieve
98
101
 
99
- # 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** <dl> <dt><code>asc(\"ATTRIBUTE\")</code></dt> <dd>Sort the index by the values of an attribute, in ascending order.</dd> <dt><code>desc(\"ATTRIBUTE\")</code></dt> <dd>Sort the index by the values of an attribute, in descending order.</dd> </dl> 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/).
102
+ # 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/).
100
103
  attr_accessor :ranking
101
104
 
102
- # Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). 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** <dl> <dt><code>asc(\"ATTRIBUTE\")</code></dt> <dd>Sort the index by the values of an attribute, in ascending order.</dd> <dt><code>desc(\"ATTRIBUTE\")</code></dt> <dd>Sort the index by the values of an attribute, in descending order.</dd> </dl> 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.
105
+ # Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). 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.
103
106
  attr_accessor :custom_ranking
104
107
 
105
108
  # 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.
@@ -178,10 +181,10 @@ module Algolia
178
181
 
179
182
  attr_accessor :exact_on_single_word_query
180
183
 
181
- # Alternatives of query words that should be considered as exact matches by the Exact ranking criterion. <dl> <dt><code>ignorePlurals</code></dt> <dd> Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. </dd> <dt><code>singleWordSynonym</code></dt> <dd> Single-word synonyms, such as \"NY/NYC\" are considered exact matches. </dd> <dt><code>multiWordsSynonym</code></dt> <dd> Multi-word synonyms, such as \"NY/New York\" are considered exact matches. </dd> </dl>.
184
+ # 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.
182
185
  attr_accessor :alternatives_as_exact
183
186
 
184
- # Advanced search syntax features you want to support. <dl> <dt><code>exactPhrase</code></dt> <dd> Phrases in quotes must match exactly. For example, `sparkly blue \"iPhone case\"` only returns records with the exact string \"iPhone case\". </dd> <dt><code>excludeWords</code></dt> <dd> Query words prefixed with a `-` must not occur in a record. For example, `search -engine` matches records that contain \"search\" but not \"engine\". </dd> </dl> This setting only has an effect if `advancedSyntax` is true.
187
+ # 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.
185
188
  attr_accessor :advanced_syntax_features
186
189
 
187
190
  attr_accessor :distinct
@@ -201,7 +204,7 @@ module Algolia
201
204
  # Maximum number of facet values to return for each facet.
202
205
  attr_accessor :max_values_per_facet
203
206
 
204
- # Order in which to retrieve facet values. <dl> <dt><code>count</code></dt> <dd> Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. </dd> <dt><code>alpha</code></dt> <dd>Retrieve facet values alphabetically.</dd> </dl> 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/).
207
+ # 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/).
205
208
  attr_accessor :sort_facet_values_by
206
209
 
207
210
  # 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.
@@ -214,12 +217,6 @@ module Algolia
214
217
 
215
218
  attr_accessor :re_ranking_apply_filter
216
219
 
217
- attr_accessor :query
218
-
219
- attr_accessor :automatic_facet_filters
220
-
221
- attr_accessor :automatic_optional_facet_filters
222
-
223
220
  class EnumAttributeValidator
224
221
  attr_reader :datatype
225
222
  attr_reader :allowable_values
@@ -245,6 +242,7 @@ module Algolia
245
242
  # Attribute mapping from ruby-style variable name to JSON key.
246
243
  def self.attribute_map
247
244
  {
245
+ :query => :query,
248
246
  :similar_query => :similarQuery,
249
247
  :filters => :filters,
250
248
  :facet_filters => :facetFilters,
@@ -319,10 +317,7 @@ module Algolia
319
317
  :attribute_criteria_computed_by_min_proximity => :attributeCriteriaComputedByMinProximity,
320
318
  :rendering_content => :renderingContent,
321
319
  :enable_re_ranking => :enableReRanking,
322
- :re_ranking_apply_filter => :reRankingApplyFilter,
323
- :query => :query,
324
- :automatic_facet_filters => :automaticFacetFilters,
325
- :automatic_optional_facet_filters => :automaticOptionalFacetFilters
320
+ :re_ranking_apply_filter => :reRankingApplyFilter
326
321
  }
327
322
  end
328
323
 
@@ -334,6 +329,7 @@ module Algolia
334
329
  # Attribute type mapping.
335
330
  def self.types_mapping
336
331
  {
332
+ :query => :String,
337
333
  :similar_query => :String,
338
334
  :filters => :String,
339
335
  :facet_filters => :FacetFilters,
@@ -408,10 +404,7 @@ module Algolia
408
404
  :attribute_criteria_computed_by_min_proximity => :Boolean,
409
405
  :rendering_content => :RenderingContent,
410
406
  :enable_re_ranking => :Boolean,
411
- :re_ranking_apply_filter => :ReRankingApplyFilter,
412
- :query => :ConsequenceQuery,
413
- :automatic_facet_filters => :AutomaticFacetFilters,
414
- :automatic_optional_facet_filters => :AutomaticFacetFilters
407
+ :re_ranking_apply_filter => :ReRankingApplyFilter
415
408
  }
416
409
  end
417
410
 
@@ -425,9 +418,7 @@ module Algolia
425
418
  # List of class defined in allOf (OpenAPI v3)
426
419
  def self.openapi_all_of
427
420
  [
428
- :BaseSearchParamsWithoutQuery,
429
- :IndexSettingsAsSearchParams,
430
- :Params
421
+ :SearchParamsObject
431
422
  ]
432
423
  end
433
424
 
@@ -435,19 +426,23 @@ module Algolia
435
426
  # @param [Hash] attributes Model attributes in the form of hash
436
427
  def initialize(attributes = {})
437
428
  unless attributes.is_a?(Hash)
438
- raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::ConsequenceParams` initialize method"
429
+ raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::SearchParams` initialize method"
439
430
  end
440
431
 
441
432
  # check to see if the attribute exists and convert string to symbol for hash key
442
433
  attributes = attributes.each_with_object({}) do |(k, v), h|
443
434
  unless self.class.attribute_map.key?(k.to_sym)
444
435
  raise ArgumentError,
445
- "`#{k}` is not a valid attribute in `Algolia::ConsequenceParams`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
436
+ "`#{k}` is not a valid attribute in `Algolia::SearchParams`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
446
437
  end
447
438
 
448
439
  h[k.to_sym] = v
449
440
  end
450
441
 
442
+ if attributes.key?(:query)
443
+ self.query = attributes[:query]
444
+ end
445
+
451
446
  if attributes.key?(:similar_query)
452
447
  self.similar_query = attributes[:similar_query]
453
448
  end
@@ -785,18 +780,6 @@ module Algolia
785
780
  if attributes.key?(:re_ranking_apply_filter)
786
781
  self.re_ranking_apply_filter = attributes[:re_ranking_apply_filter]
787
782
  end
788
-
789
- if attributes.key?(:query)
790
- self.query = attributes[:query]
791
- end
792
-
793
- if attributes.key?(:automatic_facet_filters)
794
- self.automatic_facet_filters = attributes[:automatic_facet_filters]
795
- end
796
-
797
- if attributes.key?(:automatic_optional_facet_filters)
798
- self.automatic_optional_facet_filters = attributes[:automatic_optional_facet_filters]
799
- end
800
783
  end
801
784
 
802
785
  # Custom attribute writer method with validation
@@ -933,6 +916,7 @@ module Algolia
933
916
  return true if equal?(other)
934
917
 
935
918
  self.class == other.class &&
919
+ query == other.query &&
936
920
  similar_query == other.similar_query &&
937
921
  filters == other.filters &&
938
922
  facet_filters == other.facet_filters &&
@@ -1007,10 +991,7 @@ module Algolia
1007
991
  attribute_criteria_computed_by_min_proximity == other.attribute_criteria_computed_by_min_proximity &&
1008
992
  rendering_content == other.rendering_content &&
1009
993
  enable_re_ranking == other.enable_re_ranking &&
1010
- re_ranking_apply_filter == other.re_ranking_apply_filter &&
1011
- query == other.query &&
1012
- automatic_facet_filters == other.automatic_facet_filters &&
1013
- automatic_optional_facet_filters == other.automatic_optional_facet_filters
994
+ re_ranking_apply_filter == other.re_ranking_apply_filter
1014
995
  end
1015
996
 
1016
997
  # @see the `==` method
@@ -1022,8 +1003,8 @@ module Algolia
1022
1003
  # Calculates hash code according to all attributes.
1023
1004
  # @return [Integer] Hash code
1024
1005
  def hash
1025
- [similar_query, filters, facet_filters, optional_filters, numeric_filters, tag_filters, sum_or_filters_scores, restrict_searchable_attributes, facets,
1026
- faceting_after_distinct, page, offset, length, around_lat_lng, around_lat_lng_via_ip, around_radius, around_precision, minimum_around_radius, inside_bounding_box, inside_polygon, natural_languages, rule_contexts, personalization_impact, user_token, get_ranking_info, synonyms, click_analytics, analytics, analytics_tags, percentile_computation, enable_ab_test, attributes_to_retrieve, ranking, custom_ranking, relevancy_strictness, attributes_to_highlight, attributes_to_snippet, highlight_pre_tag, highlight_post_tag, snippet_ellipsis_text, restrict_highlight_and_snippet_arrays, hits_per_page, min_word_sizefor1_typo, min_word_sizefor2_typos, typo_tolerance, allow_typos_on_numeric_tokens, disable_typo_tolerance_on_attributes, ignore_plurals, remove_stop_words, keep_diacritics_on_characters, query_languages, decompound_query, enable_rules, enable_personalization, query_type, remove_words_if_no_results, mode, semantic_search, advanced_syntax, optional_words, disable_exact_on_attributes, exact_on_single_word_query, alternatives_as_exact, advanced_syntax_features, distinct, replace_synonyms_in_highlight, min_proximity, response_fields, max_facet_hits, max_values_per_facet, sort_facet_values_by, attribute_criteria_computed_by_min_proximity, rendering_content, enable_re_ranking, re_ranking_apply_filter, query, automatic_facet_filters, automatic_optional_facet_filters].hash
1006
+ [query, similar_query, filters, facet_filters, optional_filters, numeric_filters, tag_filters, sum_or_filters_scores, restrict_searchable_attributes, facets,
1007
+ faceting_after_distinct, page, offset, length, around_lat_lng, around_lat_lng_via_ip, around_radius, around_precision, minimum_around_radius, inside_bounding_box, inside_polygon, natural_languages, rule_contexts, personalization_impact, user_token, get_ranking_info, synonyms, click_analytics, analytics, analytics_tags, percentile_computation, enable_ab_test, attributes_to_retrieve, ranking, custom_ranking, relevancy_strictness, attributes_to_highlight, attributes_to_snippet, highlight_pre_tag, highlight_post_tag, snippet_ellipsis_text, restrict_highlight_and_snippet_arrays, hits_per_page, min_word_sizefor1_typo, min_word_sizefor2_typos, typo_tolerance, allow_typos_on_numeric_tokens, disable_typo_tolerance_on_attributes, ignore_plurals, remove_stop_words, keep_diacritics_on_characters, query_languages, decompound_query, enable_rules, enable_personalization, query_type, remove_words_if_no_results, mode, semantic_search, advanced_syntax, optional_words, disable_exact_on_attributes, exact_on_single_word_query, alternatives_as_exact, advanced_syntax_features, distinct, replace_synonyms_in_highlight, min_proximity, response_fields, max_facet_hits, max_values_per_facet, sort_facet_values_by, attribute_criteria_computed_by_min_proximity, rendering_content, enable_re_ranking, re_ranking_apply_filter].hash
1027
1008
  end
1028
1009
 
1029
1010
  # Builds the object from hash
@@ -12,7 +12,7 @@ module Algolia
12
12
  # 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.
13
13
  attr_accessor :similar_query
14
14
 
15
- # Filter the search so that only records with matching values are included in the results. These filters are supported: - **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/).
15
+ # 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/).
16
16
  attr_accessor :filters
17
17
 
18
18
  attr_accessor :facet_filters
@@ -99,10 +99,10 @@ module Algolia
99
99
  # Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. - `*` 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.
100
100
  attr_accessor :attributes_to_retrieve
101
101
 
102
- # 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** <dl> <dt><code>asc(\"ATTRIBUTE\")</code></dt> <dd>Sort the index by the values of an attribute, in ascending order.</dd> <dt><code>desc(\"ATTRIBUTE\")</code></dt> <dd>Sort the index by the values of an attribute, in descending order.</dd> </dl> 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/).
102
+ # 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/).
103
103
  attr_accessor :ranking
104
104
 
105
- # Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). 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** <dl> <dt><code>asc(\"ATTRIBUTE\")</code></dt> <dd>Sort the index by the values of an attribute, in ascending order.</dd> <dt><code>desc(\"ATTRIBUTE\")</code></dt> <dd>Sort the index by the values of an attribute, in descending order.</dd> </dl> 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.
105
+ # Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). 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.
106
106
  attr_accessor :custom_ranking
107
107
 
108
108
  # 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.
@@ -181,10 +181,10 @@ module Algolia
181
181
 
182
182
  attr_accessor :exact_on_single_word_query
183
183
 
184
- # Alternatives of query words that should be considered as exact matches by the Exact ranking criterion. <dl> <dt><code>ignorePlurals</code></dt> <dd> Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. </dd> <dt><code>singleWordSynonym</code></dt> <dd> Single-word synonyms, such as \"NY/NYC\" are considered exact matches. </dd> <dt><code>multiWordsSynonym</code></dt> <dd> Multi-word synonyms, such as \"NY/New York\" are considered exact matches. </dd> </dl>.
184
+ # 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.
185
185
  attr_accessor :alternatives_as_exact
186
186
 
187
- # Advanced search syntax features you want to support. <dl> <dt><code>exactPhrase</code></dt> <dd> Phrases in quotes must match exactly. For example, `sparkly blue \"iPhone case\"` only returns records with the exact string \"iPhone case\". </dd> <dt><code>excludeWords</code></dt> <dd> Query words prefixed with a `-` must not occur in a record. For example, `search -engine` matches records that contain \"search\" but not \"engine\". </dd> </dl> This setting only has an effect if `advancedSyntax` is true.
187
+ # 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.
188
188
  attr_accessor :advanced_syntax_features
189
189
 
190
190
  attr_accessor :distinct
@@ -204,7 +204,7 @@ module Algolia
204
204
  # Maximum number of facet values to return for each facet.
205
205
  attr_accessor :max_values_per_facet
206
206
 
207
- # Order in which to retrieve facet values. <dl> <dt><code>count</code></dt> <dd> Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. </dd> <dt><code>alpha</code></dt> <dd>Retrieve facet values alphabetically.</dd> </dl> 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/).
207
+ # 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/).
208
208
  attr_accessor :sort_facet_values_by
209
209
 
210
210
  # 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.
@@ -5,12 +5,12 @@ require 'time'
5
5
 
6
6
  module Algolia
7
7
  module Recommend
8
- # Recommend rules search parameters.
8
+ # Recommend rules parameters.
9
9
  class SearchRecommendRulesParams
10
10
  # Search query.
11
11
  attr_accessor :query
12
12
 
13
- # Restricts responses to the specified [contextual rule](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#creating-contextual-rules).
13
+ # Only search for rules with matching context.
14
14
  attr_accessor :context
15
15
 
16
16
  # Requested page of the API response.
@@ -19,9 +19,18 @@ module Algolia
19
19
  # Maximum number of hits per page.
20
20
  attr_accessor :hits_per_page
21
21
 
22
- # Restricts responses to enabled rules. When absent (default), _all_ rules are retrieved.
22
+ # Whether to only show rules where the value of their `enabled` property matches this parameter. If absent, show all rules, regardless of their `enabled` property.
23
23
  attr_accessor :enabled
24
24
 
25
+ # Filter expression. This only searches for rules matching the filter expression.
26
+ attr_accessor :filters
27
+
28
+ # Include facets and facet values in the response. Use `['*']` to include all facets.
29
+ attr_accessor :facets
30
+
31
+ # Maximum number of values to return for each facet.
32
+ attr_accessor :max_values_per_facet
33
+
25
34
  # Attribute mapping from ruby-style variable name to JSON key.
26
35
  def self.attribute_map
27
36
  {
@@ -29,7 +38,10 @@ module Algolia
29
38
  :context => :context,
30
39
  :page => :page,
31
40
  :hits_per_page => :hitsPerPage,
32
- :enabled => :enabled
41
+ :enabled => :enabled,
42
+ :filters => :filters,
43
+ :facets => :facets,
44
+ :max_values_per_facet => :maxValuesPerFacet
33
45
  }
34
46
  end
35
47
 
@@ -45,15 +57,16 @@ module Algolia
45
57
  :context => :String,
46
58
  :page => :Integer,
47
59
  :hits_per_page => :Integer,
48
- :enabled => :Boolean
60
+ :enabled => :Boolean,
61
+ :filters => :String,
62
+ :facets => :'Array<String>',
63
+ :max_values_per_facet => :Integer
49
64
  }
50
65
  end
51
66
 
52
67
  # List of attributes with nullable: true
53
68
  def self.openapi_nullable
54
- Set.new([
55
- :enabled
56
- ])
69
+ Set.new([])
57
70
  end
58
71
 
59
72
  # Initializes the object
@@ -92,6 +105,20 @@ module Algolia
92
105
  if attributes.key?(:enabled)
93
106
  self.enabled = attributes[:enabled]
94
107
  end
108
+
109
+ if attributes.key?(:filters)
110
+ self.filters = attributes[:filters]
111
+ end
112
+
113
+ if attributes.key?(:facets)
114
+ if (value = attributes[:facets]).is_a?(Array)
115
+ self.facets = value
116
+ end
117
+ end
118
+
119
+ if attributes.key?(:max_values_per_facet)
120
+ self.max_values_per_facet = attributes[:max_values_per_facet]
121
+ end
95
122
  end
96
123
 
97
124
  # Custom attribute writer method with validation
@@ -126,6 +153,24 @@ module Algolia
126
153
  @hits_per_page = hits_per_page
127
154
  end
128
155
 
156
+ # Custom attribute writer method with validation
157
+ # @param [Object] max_values_per_facet Value to be assigned
158
+ def max_values_per_facet=(max_values_per_facet)
159
+ if max_values_per_facet.nil?
160
+ raise ArgumentError, 'max_values_per_facet cannot be nil'
161
+ end
162
+
163
+ if max_values_per_facet > 1000
164
+ raise ArgumentError, 'invalid value for "max_values_per_facet", must be smaller than or equal to 1000.'
165
+ end
166
+
167
+ if max_values_per_facet < 1
168
+ raise ArgumentError, 'invalid value for "max_values_per_facet", must be greater than or equal to 1.'
169
+ end
170
+
171
+ @max_values_per_facet = max_values_per_facet
172
+ end
173
+
129
174
  # Checks equality by comparing each attribute.
130
175
  # @param [Object] Object to be compared
131
176
  def ==(other)
@@ -136,7 +181,10 @@ module Algolia
136
181
  context == other.context &&
137
182
  page == other.page &&
138
183
  hits_per_page == other.hits_per_page &&
139
- enabled == other.enabled
184
+ enabled == other.enabled &&
185
+ filters == other.filters &&
186
+ facets == other.facets &&
187
+ max_values_per_facet == other.max_values_per_facet
140
188
  end
141
189
 
142
190
  # @see the `==` method
@@ -148,7 +196,7 @@ module Algolia
148
196
  # Calculates hash code according to all attributes.
149
197
  # @return [Integer] Hash code
150
198
  def hash
151
- [query, context, page, hits_per_page, enabled].hash
199
+ [query, context, page, hits_per_page, enabled, filters, facets, max_values_per_facet].hash
152
200
  end
153
201
 
154
202
  # Builds the object from hash
@@ -6,7 +6,7 @@ require 'time'
6
6
  module Algolia
7
7
  module Recommend
8
8
  class SearchRecommendRulesResponse
9
- # Fetched rules.
9
+ # Recommend rules that match the search criteria.
10
10
  attr_accessor :hits
11
11
 
12
12
  # Number of results (hits).
@@ -36,7 +36,7 @@ module Algolia
36
36
  # Attribute type mapping.
37
37
  def self.types_mapping
38
38
  {
39
- :hits => :'Array<RuleResponse>',
39
+ :hits => :'Array<RecommendRule>',
40
40
  :nb_hits => :Integer,
41
41
  :page => :Integer,
42
42
  :nb_pages => :Integer
@@ -10,10 +10,10 @@ module Algolia
10
10
  # Recommendation score.
11
11
  attr_accessor :_score
12
12
 
13
- # Facet name for trending models.
13
+ # Facet attribute. To be used in combination with `facetValue`. If specified, only recommendations matching the facet filter will be returned.
14
14
  attr_accessor :facet_name
15
15
 
16
- # Facet value for trending models.
16
+ # Facet value. To be used in combination with `facetName`. If specified, only recommendations matching the facet filter will be returned.
17
17
  attr_accessor :facet_value
18
18
 
19
19
  # Attribute mapping from ruby-style variable name to JSON key.