algolia 3.0.0.alpha.12 → 3.0.0.alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. checksums.yaml +4 -4
  2. data/.openapi-generator/FILES +1 -0
  3. data/CHANGELOG.md +6 -0
  4. data/Gemfile.lock +4 -4
  5. data/lib/algolia/api/abtesting_client.rb +8 -4
  6. data/lib/algolia/api/analytics_client.rb +146 -282
  7. data/lib/algolia/api/ingestion_client.rb +4 -4
  8. data/lib/algolia/api/insights_client.rb +7 -7
  9. data/lib/algolia/api/recommend_client.rb +12 -12
  10. data/lib/algolia/api/search_client.rb +242 -242
  11. data/lib/algolia/models/abtesting/ab_test_response.rb +1 -1
  12. data/lib/algolia/models/analytics/search_no_result_event.rb +1 -1
  13. data/lib/algolia/models/analytics/top_search.rb +1 -1
  14. data/lib/algolia/models/analytics/top_search_with_analytics.rb +1 -1
  15. data/lib/algolia/models/ingestion/action_type.rb +2 -1
  16. data/lib/algolia/models/ingestion/source_ga4_big_query_export.rb +223 -0
  17. data/lib/algolia/models/ingestion/source_input.rb +1 -0
  18. data/lib/algolia/models/ingestion/source_type.rb +2 -1
  19. data/lib/algolia/models/ingestion/source_update_input.rb +1 -0
  20. data/lib/algolia/models/ingestion/streaming_trigger.rb +221 -0
  21. data/lib/algolia/models/ingestion/streaming_trigger_type.rb +32 -0
  22. data/lib/algolia/models/ingestion/streaming_utils_input.rb +199 -0
  23. data/lib/algolia/models/ingestion/task_create_trigger.rb +1 -0
  24. data/lib/algolia/models/ingestion/task_input.rb +2 -1
  25. data/lib/algolia/models/ingestion/trigger.rb +1 -0
  26. data/lib/algolia/models/ingestion/trigger_type.rb +2 -1
  27. data/lib/algolia/models/insights/added_to_cart_object_ids.rb +6 -6
  28. data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +6 -6
  29. data/lib/algolia/models/insights/clicked_filters.rb +6 -6
  30. data/lib/algolia/models/insights/clicked_object_ids.rb +6 -6
  31. data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +7 -7
  32. data/lib/algolia/models/insights/converted_filters.rb +6 -6
  33. data/lib/algolia/models/insights/converted_object_ids.rb +6 -6
  34. data/lib/algolia/models/insights/converted_object_ids_after_search.rb +6 -6
  35. data/lib/algolia/models/insights/discount.rb +1 -1
  36. data/lib/algolia/models/insights/insights_events.rb +1 -1
  37. data/lib/algolia/models/insights/object_data.rb +1 -1
  38. data/lib/algolia/models/insights/object_data_after_search.rb +1 -1
  39. data/lib/algolia/models/insights/price.rb +1 -1
  40. data/lib/algolia/models/insights/purchased_object_ids.rb +6 -6
  41. data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +6 -6
  42. data/lib/algolia/models/insights/viewed_filters.rb +6 -6
  43. data/lib/algolia/models/insights/viewed_object_ids.rb +6 -6
  44. data/lib/algolia/models/recommend/around_precision.rb +1 -1
  45. data/lib/algolia/models/recommend/around_precision_from_value_inner.rb +3 -0
  46. data/lib/algolia/models/recommend/around_radius.rb +1 -1
  47. data/lib/algolia/models/recommend/automatic_facet_filter.rb +4 -4
  48. data/lib/algolia/models/recommend/automatic_facet_filters.rb +1 -1
  49. data/lib/algolia/models/recommend/base_recommend_request.rb +1 -1
  50. data/lib/algolia/models/recommend/base_recommendations_query.rb +1 -1
  51. data/lib/algolia/models/recommend/base_recommended_for_you_query_parameters.rb +1 -1
  52. data/lib/algolia/models/recommend/base_search_params.rb +58 -38
  53. data/lib/algolia/models/recommend/base_search_params_without_query.rb +57 -37
  54. data/lib/algolia/models/recommend/base_search_response.rb +20 -6
  55. data/lib/algolia/models/recommend/condition.rb +32 -7
  56. data/lib/algolia/models/recommend/consequence.rb +33 -5
  57. data/lib/algolia/models/recommend/consequence_hide.rb +2 -2
  58. data/lib/algolia/models/recommend/consequence_params.rb +101 -79
  59. data/lib/algolia/models/recommend/consequence_query.rb +1 -1
  60. data/lib/algolia/models/recommend/consequence_query_object.rb +2 -2
  61. data/lib/algolia/models/recommend/deleted_at_response.rb +1 -1
  62. data/lib/algolia/models/recommend/distinct.rb +1 -1
  63. data/lib/algolia/models/recommend/edit.rb +1 -1
  64. data/lib/algolia/models/recommend/facet_filters.rb +1 -1
  65. data/lib/algolia/models/recommend/facet_ordering.rb +2 -2
  66. data/lib/algolia/models/recommend/facets.rb +2 -2
  67. data/lib/algolia/models/recommend/highlight_result_option.rb +3 -3
  68. data/lib/algolia/models/recommend/ignore_plurals.rb +1 -1
  69. data/lib/algolia/models/recommend/index_settings_as_search_params.rb +46 -44
  70. data/lib/algolia/models/recommend/numeric_filters.rb +1 -1
  71. data/lib/algolia/models/recommend/optional_filters.rb +1 -1
  72. data/lib/algolia/models/recommend/params.rb +1 -1
  73. data/lib/algolia/models/recommend/promote_object_id.rb +2 -2
  74. data/lib/algolia/models/recommend/promote_object_ids.rb +16 -2
  75. data/lib/algolia/models/recommend/ranking_info.rb +120 -7
  76. data/lib/algolia/models/recommend/re_ranking_apply_filter.rb +1 -1
  77. data/lib/algolia/models/recommend/recommend_hit.rb +3 -3
  78. data/lib/algolia/models/recommend/recommendations_hits.rb +1 -1
  79. data/lib/algolia/models/recommend/recommendations_query.rb +2 -2
  80. data/lib/algolia/models/recommend/recommendations_results.rb +21 -7
  81. data/lib/algolia/models/recommend/recommended_for_you_query.rb +1 -1
  82. data/lib/algolia/models/recommend/recommended_for_you_query_parameters.rb +102 -80
  83. data/lib/algolia/models/recommend/remove_stop_words.rb +1 -1
  84. data/lib/algolia/models/recommend/rendering_content.rb +1 -1
  85. data/lib/algolia/models/recommend/search_params_object.rb +102 -80
  86. data/lib/algolia/models/recommend/search_params_query.rb +1 -1
  87. data/lib/algolia/models/recommend/search_recommend_rules_params.rb +2 -2
  88. data/lib/algolia/models/recommend/search_recommend_rules_response.rb +17 -3
  89. data/lib/algolia/models/recommend/semantic_search.rb +2 -2
  90. data/lib/algolia/models/recommend/snippet_result_option.rb +2 -2
  91. data/lib/algolia/models/recommend/tag_filters.rb +1 -1
  92. data/lib/algolia/models/recommend/trending_facets_query.rb +1 -1
  93. data/lib/algolia/models/recommend/trending_items_query.rb +1 -1
  94. data/lib/algolia/models/recommend/typo_tolerance.rb +1 -1
  95. data/lib/algolia/models/recommend/value.rb +1 -1
  96. data/lib/algolia/models/search/add_api_key_response.rb +1 -1
  97. data/lib/algolia/models/search/api_key.rb +8 -8
  98. data/lib/algolia/models/search/around_precision.rb +1 -1
  99. data/lib/algolia/models/search/around_precision_from_value_inner.rb +3 -0
  100. data/lib/algolia/models/search/around_radius.rb +1 -1
  101. data/lib/algolia/models/search/automatic_facet_filter.rb +4 -4
  102. data/lib/algolia/models/search/automatic_facet_filters.rb +1 -1
  103. data/lib/algolia/models/search/base_index_settings.rb +44 -18
  104. data/lib/algolia/models/search/base_search_params.rb +58 -38
  105. data/lib/algolia/models/search/base_search_params_without_query.rb +57 -37
  106. data/lib/algolia/models/search/base_search_response.rb +20 -6
  107. data/lib/algolia/models/search/batch_dictionary_entries_params.rb +3 -3
  108. data/lib/algolia/models/search/batch_response.rb +2 -2
  109. data/lib/algolia/models/search/browse_params_object.rb +103 -81
  110. data/lib/algolia/models/search/browse_response.rb +23 -8
  111. data/lib/algolia/models/search/built_in_operation.rb +2 -2
  112. data/lib/algolia/models/search/condition.rb +32 -7
  113. data/lib/algolia/models/search/consequence.rb +33 -5
  114. data/lib/algolia/models/search/consequence_hide.rb +2 -2
  115. data/lib/algolia/models/search/consequence_params.rb +101 -79
  116. data/lib/algolia/models/search/consequence_query.rb +1 -1
  117. data/lib/algolia/models/search/consequence_query_object.rb +2 -2
  118. data/lib/algolia/models/search/created_at_response.rb +1 -1
  119. data/lib/algolia/models/search/cursor.rb +1 -1
  120. data/lib/algolia/models/search/delete_by_params.rb +4 -4
  121. data/lib/algolia/models/search/deleted_at_response.rb +1 -1
  122. data/lib/algolia/models/search/dictionary_entry.rb +5 -5
  123. data/lib/algolia/models/search/dictionary_language.rb +2 -2
  124. data/lib/algolia/models/search/dictionary_settings_params.rb +1 -1
  125. data/lib/algolia/models/search/distinct.rb +1 -1
  126. data/lib/algolia/models/search/edit.rb +1 -1
  127. data/lib/algolia/models/search/facet_filters.rb +1 -1
  128. data/lib/algolia/models/search/facet_hits.rb +2 -2
  129. data/lib/algolia/models/search/facet_ordering.rb +2 -2
  130. data/lib/algolia/models/search/facets.rb +2 -2
  131. data/lib/algolia/models/search/get_api_key_response.rb +8 -8
  132. data/lib/algolia/models/search/get_objects_request.rb +3 -3
  133. data/lib/algolia/models/search/get_objects_response.rb +1 -1
  134. data/lib/algolia/models/search/has_pending_mappings_response.rb +1 -1
  135. data/lib/algolia/models/search/highlight_result_option.rb +3 -3
  136. data/lib/algolia/models/search/hit.rb +4 -4
  137. data/lib/algolia/models/search/ignore_plurals.rb +1 -1
  138. data/lib/algolia/models/search/index_settings.rb +89 -61
  139. data/lib/algolia/models/search/index_settings_as_search_params.rb +46 -44
  140. data/lib/algolia/models/search/log.rb +39 -11
  141. data/lib/algolia/models/search/log_query.rb +1 -1
  142. data/lib/algolia/models/search/multiple_batch_response.rb +2 -2
  143. data/lib/algolia/models/search/numeric_filters.rb +1 -1
  144. data/lib/algolia/models/search/operation_index_params.rb +2 -2
  145. data/lib/algolia/models/search/optional_filters.rb +1 -1
  146. data/lib/algolia/models/search/params.rb +1 -1
  147. data/lib/algolia/models/search/promote_object_id.rb +2 -2
  148. data/lib/algolia/models/search/promote_object_ids.rb +16 -2
  149. data/lib/algolia/models/search/ranking_info.rb +120 -7
  150. data/lib/algolia/models/search/re_ranking_apply_filter.rb +1 -1
  151. data/lib/algolia/models/search/remove_stop_words.rb +1 -1
  152. data/lib/algolia/models/search/rendering_content.rb +1 -1
  153. data/lib/algolia/models/search/rule.rb +23 -5
  154. data/lib/algolia/models/search/save_object_response.rb +3 -3
  155. data/lib/algolia/models/search/save_synonym_response.rb +1 -1
  156. data/lib/algolia/models/search/search_dictionary_entries_params.rb +18 -4
  157. data/lib/algolia/models/search/search_dictionary_entries_response.rb +251 -0
  158. data/lib/algolia/models/search/search_for_facet_values_request.rb +1 -1
  159. data/lib/algolia/models/search/search_for_facet_values_response.rb +1 -0
  160. data/lib/algolia/models/search/search_for_facets.rb +103 -81
  161. data/lib/algolia/models/search/search_for_facets_options.rb +2 -2
  162. data/lib/algolia/models/search/search_for_hits.rb +103 -81
  163. data/lib/algolia/models/search/search_for_hits_options.rb +1 -1
  164. data/lib/algolia/models/search/search_hits.rb +2 -1
  165. data/lib/algolia/models/search/search_params_object.rb +102 -80
  166. data/lib/algolia/models/search/search_params_query.rb +1 -1
  167. data/lib/algolia/models/search/search_response.rb +22 -7
  168. data/lib/algolia/models/search/search_rules_params.rb +8 -20
  169. data/lib/algolia/models/search/search_rules_response.rb +2 -2
  170. data/lib/algolia/models/search/search_synonyms_params.rb +16 -2
  171. data/lib/algolia/models/search/search_synonyms_response.rb +2 -2
  172. data/lib/algolia/models/search/search_user_ids_params.rb +15 -1
  173. data/lib/algolia/models/search/search_user_ids_response.rb +16 -2
  174. data/lib/algolia/models/search/secured_api_key_restrictions.rb +5 -5
  175. data/lib/algolia/models/search/semantic_search.rb +2 -2
  176. data/lib/algolia/models/search/snippet_result_option.rb +2 -2
  177. data/lib/algolia/models/search/tag_filters.rb +1 -1
  178. data/lib/algolia/models/search/time_range.rb +2 -2
  179. data/lib/algolia/models/search/typo_tolerance.rb +1 -1
  180. data/lib/algolia/models/search/updated_at_response.rb +1 -1
  181. data/lib/algolia/models/search/updated_at_with_object_id_response.rb +2 -2
  182. data/lib/algolia/models/search/updated_rule_response.rb +2 -2
  183. data/lib/algolia/models/search/user_hit.rb +1 -1
  184. data/lib/algolia/models/search/user_id.rb +1 -1
  185. data/lib/algolia/models/search/value.rb +1 -1
  186. data/lib/algolia/version.rb +1 -1
  187. metadata +7 -2
@@ -6,10 +6,10 @@ require 'time'
6
6
  module Algolia
7
7
  module Recommend
8
8
  class BaseSearchParamsWithoutQuery
9
- # Overrides the query parameter and performs a more generic search.
9
+ # 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
10
  attr_accessor :similar_query
11
11
 
12
- # [Filter](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/) the query with numeric, facet, or tag filters.
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/).
13
13
  attr_accessor :filters
14
14
 
15
15
  attr_accessor :facet_filters
@@ -20,80 +20,77 @@ module Algolia
20
20
 
21
21
  attr_accessor :tag_filters
22
22
 
23
- # Determines how to calculate [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores). If `false`, maximum score is kept. If `true`, score is summed.
23
+ # Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is kept. For more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores).
24
24
  attr_accessor :sum_or_filters_scores
25
25
 
26
- # Restricts a query to only look at a subset of your [searchable attributes](https://www.algolia.com/doc/guides/managing-results/must-do/searchable-attributes/).
26
+ # Restricts a search to a subset of your searchable attributes.
27
27
  attr_accessor :restrict_searchable_attributes
28
28
 
29
- # Returns [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts), their facet values, and the number of matching facet values.
29
+ # Facets for which to retrieve facet values that match the search criteria and the number of matching facet values. To retrieve all facets, use the wildcard character `*`. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts).
30
30
  attr_accessor :facets
31
31
 
32
- # Forces faceting to be applied after [de-duplication](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/) (with the distinct feature). Alternatively, the `afterDistinct` [modifier](https://www.algolia.com/doc/api-reference/api-parameters/attributesForFaceting/#modifiers) of `attributesForFaceting` allows for more granular control.
32
+ # 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`.
33
33
  attr_accessor :faceting_after_distinct
34
34
 
35
- # Page to retrieve (the first page is `0`, not `1`).
35
+ # Page of search results to retrieve.
36
36
  attr_accessor :page
37
37
 
38
- # Specifies the offset of the first hit to return. > **Note**: Using `page` and `hitsPerPage` is the recommended method for [paging results](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/). However, you can use `offset` and `length` to implement [an alternative approach to paging](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/#retrieving-a-subset-of-records-with-offset-and-length).
38
+ # Position of the first hit to retrieve.
39
39
  attr_accessor :offset
40
40
 
41
- # Sets the number of hits to retrieve (for use with `offset`). > **Note**: Using `page` and `hitsPerPage` is the recommended method for [paging results](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/). However, you can use `offset` and `length` to implement [an alternative approach to paging](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/#retrieving-a-subset-of-records-with-offset-and-length).
41
+ # Number of hits to retrieve (used in combination with `offset`).
42
42
  attr_accessor :length
43
43
 
44
- # Search for entries [around a central location](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filter-around-a-central-point), enabling a geographical search within a circular area.
44
+ # 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`.
45
45
  attr_accessor :around_lat_lng
46
46
 
47
- # Search for entries around a location. The location is automatically computed from the requester's IP address.
47
+ # Whether to obtain the coordinates from the request's IP address.
48
48
  attr_accessor :around_lat_lng_via_ip
49
49
 
50
50
  attr_accessor :around_radius
51
51
 
52
52
  attr_accessor :around_precision
53
53
 
54
- # Minimum radius (in meters) used for a geographical search when `aroundRadius` isn't set.
54
+ # Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set.
55
55
  attr_accessor :minimum_around_radius
56
56
 
57
- # Search inside a [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas) (in geographical coordinates).
57
+ # Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas).
58
58
  attr_accessor :inside_bounding_box
59
59
 
60
- # Search inside a [polygon](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas) (in geographical coordinates).
60
+ # Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored, if you also specify `insideBoundingBox`.
61
61
  attr_accessor :inside_polygon
62
62
 
63
- # Changes the default values of parameters that work best for a natural language query, such as `ignorePlurals`, `removeStopWords`, `removeWordsIfNoResults`, `analyticsTags`, and `ruleContexts`. These parameters work well together when the query consists of fuller natural language strings instead of keywords, for example when processing voice search queries.
63
+ # ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`.
64
64
  attr_accessor :natural_languages
65
65
 
66
- # Assigns [rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) to search queries.
66
+ # Assigns a rule context to the search query. [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules.
67
67
  attr_accessor :rule_contexts
68
68
 
69
- # Defines how much [Personalization affects results](https://www.algolia.com/doc/guides/personalization/personalizing-results/in-depth/configuring-personalization/#understanding-personalization-impact).
69
+ # Impact that Personalization should have on this search. The higher this value is, the more Personalization determines the ranking compared to other factors. For more information, see [Understanding Personalization impact](https://www.algolia.com/doc/guides/personalization/personalizing-results/in-depth/configuring-personalization/#understanding-personalization-impact).
70
70
  attr_accessor :personalization_impact
71
71
 
72
- # Associates a [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/) with the current search.
72
+ # Unique pseudonymous or anonymous user identifier. This helps with analytics and click and conversion events. For more information, see [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
73
73
  attr_accessor :user_token
74
74
 
75
- # Incidates whether the search response includes [detailed ranking information](https://www.algolia.com/doc/guides/building-search-ui/going-further/backend-search/in-depth/understanding-the-api-response/#ranking-information).
75
+ # Whether the search response should include detailed ranking information.
76
76
  attr_accessor :get_ranking_info
77
77
 
78
- # Enriches the API's response with information about how the query was processed.
79
- attr_accessor :explain
80
-
81
- # Whether to take into account an index's synonyms for a particular search.
78
+ # Whether to take into account an index's synonyms for this search.
82
79
  attr_accessor :synonyms
83
80
 
84
- # Indicates whether a query ID parameter is included in the search response. This is required for [tracking click and conversion events](https://www.algolia.com/doc/guides/sending-events/concepts/event-types/#events-related-to-algolia-requests).
81
+ # Whether to include a `queryID` attribute in the response. The query ID is a unique identifier for a search query and is required for tracking [click and conversion events](https://www.algolia.com/guides/sending-events/getting-started/).
85
82
  attr_accessor :click_analytics
86
83
 
87
- # Indicates whether this query will be included in [analytics](https://www.algolia.com/doc/guides/search-analytics/guides/exclude-queries/).
84
+ # Whether this search will be included in Analytics.
88
85
  attr_accessor :analytics
89
86
 
90
87
  # Tags to apply to the query for [segmenting analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
91
88
  attr_accessor :analytics_tags
92
89
 
93
- # Whether to include or exclude a query from the processing-time percentile computation.
90
+ # Whether to include this search when calculating processing-time percentiles.
94
91
  attr_accessor :percentile_computation
95
92
 
96
- # Incidates whether this search will be considered in A/B testing.
93
+ # Whether to enable A/B testing for this search.
97
94
  attr_accessor :enable_ab_test
98
95
 
99
96
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -124,7 +121,6 @@ module Algolia
124
121
  :personalization_impact => :personalizationImpact,
125
122
  :user_token => :userToken,
126
123
  :get_ranking_info => :getRankingInfo,
127
- :explain => :explain,
128
124
  :synonyms => :synonyms,
129
125
  :click_analytics => :clickAnalytics,
130
126
  :analytics => :analytics,
@@ -167,7 +163,6 @@ module Algolia
167
163
  :personalization_impact => :Integer,
168
164
  :user_token => :String,
169
165
  :get_ranking_info => :Boolean,
170
- :explain => :'Array<String>',
171
166
  :synonyms => :Boolean,
172
167
  :click_analytics => :Boolean,
173
168
  :analytics => :Boolean,
@@ -311,12 +306,6 @@ module Algolia
311
306
  self.get_ranking_info = attributes[:get_ranking_info]
312
307
  end
313
308
 
314
- if attributes.key?(:explain)
315
- if (value = attributes[:explain]).is_a?(Array)
316
- self.explain = value
317
- end
318
- end
319
-
320
309
  if attributes.key?(:synonyms)
321
310
  self.synonyms = attributes[:synonyms]
322
311
  end
@@ -344,6 +333,20 @@ module Algolia
344
333
  end
345
334
  end
346
335
 
336
+ # Custom attribute writer method with validation
337
+ # @param [Object] page Value to be assigned
338
+ def page=(page)
339
+ if page.nil?
340
+ raise ArgumentError, 'page cannot be nil'
341
+ end
342
+
343
+ if page < 0
344
+ raise ArgumentError, 'invalid value for "page", must be greater than or equal to 0.'
345
+ end
346
+
347
+ @page = page
348
+ end
349
+
347
350
  # Custom attribute writer method with validation
348
351
  # @param [Object] length Value to be assigned
349
352
  def length=(length)
@@ -376,6 +379,24 @@ module Algolia
376
379
  @minimum_around_radius = minimum_around_radius
377
380
  end
378
381
 
382
+ # Custom attribute writer method with validation
383
+ # @param [Object] personalization_impact Value to be assigned
384
+ def personalization_impact=(personalization_impact)
385
+ if personalization_impact.nil?
386
+ raise ArgumentError, 'personalization_impact cannot be nil'
387
+ end
388
+
389
+ if personalization_impact > 100
390
+ raise ArgumentError, 'invalid value for "personalization_impact", must be smaller than or equal to 100.'
391
+ end
392
+
393
+ if personalization_impact < 0
394
+ raise ArgumentError, 'invalid value for "personalization_impact", must be greater than or equal to 0.'
395
+ end
396
+
397
+ @personalization_impact = personalization_impact
398
+ end
399
+
379
400
  # Checks equality by comparing each attribute.
380
401
  # @param [Object] Object to be compared
381
402
  def ==(other)
@@ -407,7 +428,6 @@ module Algolia
407
428
  personalization_impact == other.personalization_impact &&
408
429
  user_token == other.user_token &&
409
430
  get_ranking_info == other.get_ranking_info &&
410
- explain == other.explain &&
411
431
  synonyms == other.synonyms &&
412
432
  click_analytics == other.click_analytics &&
413
433
  analytics == other.analytics &&
@@ -426,7 +446,7 @@ module Algolia
426
446
  # @return [Integer] Hash code
427
447
  def hash
428
448
  [similar_query, filters, facet_filters, optional_filters, numeric_filters, tag_filters, sum_or_filters_scores, restrict_searchable_attributes, facets,
429
- 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, explain, synonyms, click_analytics, analytics, analytics_tags, percentile_computation, enable_ab_test].hash
449
+ 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].hash
430
450
  end
431
451
 
432
452
  # Builds the object from hash
@@ -15,7 +15,7 @@ module Algolia
15
15
  # Computed geographical location.
16
16
  attr_accessor :around_lat_lng
17
17
 
18
- # Automatically-computed radius.
18
+ # Distance from a central coordinate provided by `aroundLatLng`.
19
19
  attr_accessor :automatic_radius
20
20
 
21
21
  attr_accessor :exhaustive
@@ -29,7 +29,7 @@ module Algolia
29
29
  # See the `typo` field of the `exhaustive` object in the response.
30
30
  attr_accessor :exhaustive_typo
31
31
 
32
- # Mapping of each facet name to the corresponding facet counts.
32
+ # Facet counts.
33
33
  attr_accessor :facets
34
34
 
35
35
  # Statistics for numerical facets.
@@ -47,16 +47,16 @@ module Algolia
47
47
  # Warnings about the query.
48
48
  attr_accessor :message
49
49
 
50
- # Number of hits the search query matched.
50
+ # Number of results (hits).
51
51
  attr_accessor :nb_hits
52
52
 
53
- # Number of pages of results for the current query.
53
+ # Number of pages of results.
54
54
  attr_accessor :nb_pages
55
55
 
56
56
  # Number of hits selected and sorted by the relevant sort algorithm.
57
57
  attr_accessor :nb_sorted_hits
58
58
 
59
- # Page to retrieve (the first page is `0`, not `1`).
59
+ # Page of search results to retrieve.
60
60
  attr_accessor :page
61
61
 
62
62
  # Post-[normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/#what-does-normalization-mean) query string that will be searched.
@@ -81,7 +81,7 @@ module Algolia
81
81
  # Host name of the server that processed the request.
82
82
  attr_accessor :server_used
83
83
 
84
- # Lets you store custom data in your indices.
84
+ # An object with custom data. You can store up to 32&nbsp;kB as custom data.
85
85
  attr_accessor :user_data
86
86
 
87
87
  # Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/).
@@ -354,6 +354,20 @@ module Algolia
354
354
  @hits_per_page = hits_per_page
355
355
  end
356
356
 
357
+ # Custom attribute writer method with validation
358
+ # @param [Object] page Value to be assigned
359
+ def page=(page)
360
+ if page.nil?
361
+ raise ArgumentError, 'page cannot be nil'
362
+ end
363
+
364
+ if page < 0
365
+ raise ArgumentError, 'invalid value for "page", must be greater than or equal to 0.'
366
+ end
367
+
368
+ @page = page
369
+ end
370
+
357
371
  # Checks equality by comparing each attribute.
358
372
  # @param [Object] Object to be compared
359
373
  def ==(other)
@@ -6,17 +6,20 @@ require 'time'
6
6
  module Algolia
7
7
  module Recommend
8
8
  class Condition
9
- # Query pattern syntax.
9
+ # Query pattern that triggers the rule. You can use either a literal string, or a special pattern `{facet:ATTRIBUTE}`, where `ATTRIBUTE` is a facet name. The rule is triggered if the query matches the literal string or a value of the specified facet. For example, with `pattern: {facet:genre}`, the rule is triggered when users search for a genre, such as \"comedy\".
10
10
  attr_accessor :pattern
11
11
 
12
12
  attr_accessor :anchoring
13
13
 
14
- # Whether the pattern matches on plurals, synonyms, and typos.
14
+ # Whether the pattern should match plurals, synonyms, and typos.
15
15
  attr_accessor :alternatives
16
16
 
17
- # Rule context format: [A-Za-z0-9_-]+).
17
+ # An additional restriction that only triggers the rule, when the search has the same value as `ruleContexts` parameter. For example, if `context: mobile`, the rule is only triggered when the search request has a matching `ruleContexts: mobile`. A rule context must only contain alphanumeric characters.
18
18
  attr_accessor :context
19
19
 
20
+ # Filters that trigger the rule. You can add add filters using the syntax `facet:value` so that the rule is triggered, when the specific filter is selected. You can use `filters` on its own or combine it with the `pattern` parameter.
21
+ attr_accessor :filters
22
+
20
23
  class EnumAttributeValidator
21
24
  attr_reader :datatype
22
25
  attr_reader :allowable_values
@@ -45,7 +48,8 @@ module Algolia
45
48
  :pattern => :pattern,
46
49
  :anchoring => :anchoring,
47
50
  :alternatives => :alternatives,
48
- :context => :context
51
+ :context => :context,
52
+ :filters => :filters
49
53
  }
50
54
  end
51
55
 
@@ -60,7 +64,8 @@ module Algolia
60
64
  :pattern => :String,
61
65
  :anchoring => :Anchoring,
62
66
  :alternatives => :Boolean,
63
- :context => :String
67
+ :context => :String,
68
+ :filters => :String
64
69
  }
65
70
  end
66
71
 
@@ -101,6 +106,25 @@ module Algolia
101
106
  if attributes.key?(:context)
102
107
  self.context = attributes[:context]
103
108
  end
109
+
110
+ if attributes.key?(:filters)
111
+ self.filters = attributes[:filters]
112
+ end
113
+ end
114
+
115
+ # Custom attribute writer method with validation
116
+ # @param [Object] context Value to be assigned
117
+ def context=(context)
118
+ if context.nil?
119
+ raise ArgumentError, 'context cannot be nil'
120
+ end
121
+
122
+ pattern = /[A-Za-z0-9_-]+/
123
+ if context !~ pattern
124
+ raise ArgumentError, "invalid value for \"context\", must conform to the pattern #{pattern}."
125
+ end
126
+
127
+ @context = context
104
128
  end
105
129
 
106
130
  # Checks equality by comparing each attribute.
@@ -112,7 +136,8 @@ module Algolia
112
136
  pattern == other.pattern &&
113
137
  anchoring == other.anchoring &&
114
138
  alternatives == other.alternatives &&
115
- context == other.context
139
+ context == other.context &&
140
+ filters == other.filters
116
141
  end
117
142
 
118
143
  # @see the `==` method
@@ -124,7 +149,7 @@ module Algolia
124
149
  # Calculates hash code according to all attributes.
125
150
  # @return [Integer] Hash code
126
151
  def hash
127
- [pattern, anchoring, alternatives, context].hash
152
+ [pattern, anchoring, alternatives, context, filters].hash
128
153
  end
129
154
 
130
155
  # Builds the object from hash
@@ -5,20 +5,20 @@ require 'time'
5
5
 
6
6
  module Algolia
7
7
  module Recommend
8
- # [Consequences](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/#consequences) of a rule.
8
+ # Effect of the rule. For more information, see [Consequences](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/#consequences).
9
9
  class Consequence
10
10
  attr_accessor :params
11
11
 
12
- # Records to promote.
12
+ # Records you want to pin to a specific position in the search results. You can promote up to 300 records, either individually, or as groups of up to 100 records each.
13
13
  attr_accessor :promote
14
14
 
15
- # Only use in combination with the `promote` consequence. When `true`, promoted results will be restricted to match the filters of the current search. When `false`, the promoted results will show up regardless of the filters.
15
+ # Whether promoted records must match an active filter for the consequence to be applied. This ensures that user actions (filtering the search) are given a higher precendence. For example, if you promote a record with the `color: red` attribute, and the user filters the search for `color: blue`, the \"red\" record won't be shown.
16
16
  attr_accessor :filter_promotes
17
17
 
18
- # Records to hide. By default, you can hide up to 50 records per rule.
18
+ # Records you want to hide from the search results.
19
19
  attr_accessor :hide
20
20
 
21
- # Custom JSON object that will be appended to the userData array in the response. This object isn't interpreted by the API. It's limited to 1kB of minified JSON.
21
+ # A JSON object with custom data that will be appended to the `userData` array in the response. This object isn't interpreted by the API and is limited to 1&nbsp;kB of minified JSON.
22
22
  attr_accessor :user_data
23
23
 
24
24
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -97,6 +97,34 @@ module Algolia
97
97
  end
98
98
  end
99
99
 
100
+ # Custom attribute writer method with validation
101
+ # @param [Object] promote Value to be assigned
102
+ def promote=(promote)
103
+ if promote.nil?
104
+ raise ArgumentError, 'promote cannot be nil'
105
+ end
106
+
107
+ if promote.length > 300
108
+ raise ArgumentError, 'invalid value for "promote", number of items must be less than or equal to 300.'
109
+ end
110
+
111
+ @promote = promote
112
+ end
113
+
114
+ # Custom attribute writer method with validation
115
+ # @param [Object] hide Value to be assigned
116
+ def hide=(hide)
117
+ if hide.nil?
118
+ raise ArgumentError, 'hide cannot be nil'
119
+ end
120
+
121
+ if hide.length > 50
122
+ raise ArgumentError, 'invalid value for "hide", number of items must be less than or equal to 50.'
123
+ end
124
+
125
+ @hide = hide
126
+ end
127
+
100
128
  # Checks equality by comparing each attribute.
101
129
  # @param [Object] Object to be compared
102
130
  def ==(other)
@@ -5,9 +5,9 @@ require 'time'
5
5
 
6
6
  module Algolia
7
7
  module Recommend
8
- # Unique identifier of the record to hide.
8
+ # Object ID of the record to hide.
9
9
  class ConsequenceHide
10
- # Unique object identifier.
10
+ # Unique record identifier.
11
11
  attr_accessor :object_id
12
12
 
13
13
  # Attribute mapping from ruby-style variable name to JSON key.