algolia 3.4.0 → 3.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/Gemfile.lock +1 -1
  4. data/lib/algolia/api/abtesting_client.rb +0 -7
  5. data/lib/algolia/api/analytics_client.rb +32 -88
  6. data/lib/algolia/api/ingestion_client.rb +2 -170
  7. data/lib/algolia/api/insights_client.rb +0 -22
  8. data/lib/algolia/api/monitoring_client.rb +11 -11
  9. data/lib/algolia/api/search_client.rb +19 -74
  10. data/lib/algolia/models/abtesting/ab_tests_variant.rb +0 -18
  11. data/lib/algolia/models/abtesting/ab_tests_variant_search_params.rb +0 -18
  12. data/lib/algolia/models/abtesting/add_ab_tests_request.rb +0 -18
  13. data/lib/algolia/models/abtesting/minimum_detectable_effect.rb +0 -18
  14. data/lib/algolia/models/abtesting/schedule_ab_tests_request.rb +0 -18
  15. data/lib/algolia/models/abtesting/variant.rb +0 -18
  16. data/lib/algolia/models/analytics/click_position.rb +0 -32
  17. data/lib/algolia/models/analytics/daily_add_to_cart_rates.rb +0 -28
  18. data/lib/algolia/models/analytics/daily_average_clicks.rb +0 -24
  19. data/lib/algolia/models/analytics/daily_click_through_rates.rb +0 -28
  20. data/lib/algolia/models/analytics/daily_conversion_rates.rb +0 -28
  21. data/lib/algolia/models/analytics/daily_no_click_rates.rb +0 -32
  22. data/lib/algolia/models/analytics/daily_no_results_rates.rb +0 -18
  23. data/lib/algolia/models/analytics/daily_purchase_rates.rb +0 -14
  24. data/lib/algolia/models/analytics/daily_searches_no_clicks.rb +0 -14
  25. data/lib/algolia/models/analytics/daily_searches_no_results.rb +0 -14
  26. data/lib/algolia/models/analytics/get_add_to_cart_rate_response.rb +0 -28
  27. data/lib/algolia/models/analytics/get_average_click_position_response.rb +0 -24
  28. data/lib/algolia/models/analytics/get_click_positions_response.rb +0 -18
  29. data/lib/algolia/models/analytics/get_click_through_rate_response.rb +0 -28
  30. data/lib/algolia/models/analytics/get_conversion_rate_response.rb +0 -28
  31. data/lib/algolia/models/analytics/get_no_click_rate_response.rb +0 -32
  32. data/lib/algolia/models/analytics/get_no_results_rate_response.rb +0 -18
  33. data/lib/algolia/models/analytics/get_purchase_rate_response.rb +0 -14
  34. data/lib/algolia/models/analytics/top_hit_with_analytics.rb +0 -56
  35. data/lib/algolia/models/analytics/top_hit_with_revenue_analytics.rb +0 -98
  36. data/lib/algolia/models/analytics/top_search_with_analytics.rb +0 -90
  37. data/lib/algolia/models/analytics/top_search_with_revenue_analytics.rb +0 -132
  38. data/lib/algolia/models/ingestion/event.rb +0 -14
  39. data/lib/algolia/models/ingestion/pagination.rb +0 -60
  40. data/lib/algolia/models/ingestion/run.rb +0 -18
  41. data/lib/algolia/models/ingestion/source_csv.rb +0 -21
  42. data/lib/algolia/models/ingestion/task.rb +0 -18
  43. data/lib/algolia/models/ingestion/task_create.rb +0 -18
  44. data/lib/algolia/models/ingestion/task_create_v1.rb +0 -18
  45. data/lib/algolia/models/ingestion/task_update.rb +0 -18
  46. data/lib/algolia/models/ingestion/task_update_v1.rb +0 -18
  47. data/lib/algolia/models/ingestion/task_v1.rb +0 -18
  48. data/lib/algolia/models/ingestion/transformation.rb +1 -1
  49. data/lib/algolia/models/ingestion/transformation_create.rb +1 -1
  50. data/lib/algolia/models/insights/added_to_cart_object_ids.rb +0 -123
  51. data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +0 -149
  52. data/lib/algolia/models/insights/clicked_filters.rb +0 -105
  53. data/lib/algolia/models/insights/clicked_object_ids.rb +0 -105
  54. data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +0 -149
  55. data/lib/algolia/models/insights/converted_filters.rb +0 -105
  56. data/lib/algolia/models/insights/converted_object_ids.rb +0 -105
  57. data/lib/algolia/models/insights/converted_object_ids_after_search.rb +0 -131
  58. data/lib/algolia/models/insights/insights_events.rb +0 -18
  59. data/lib/algolia/models/insights/object_data_after_search.rb +0 -26
  60. data/lib/algolia/models/insights/purchased_object_ids.rb +0 -123
  61. data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +0 -123
  62. data/lib/algolia/models/insights/viewed_filters.rb +0 -105
  63. data/lib/algolia/models/insights/viewed_object_ids.rb +0 -105
  64. data/lib/algolia/models/personalization/personalization_strategy_params.rb +0 -18
  65. data/lib/algolia/models/query-suggestions/configuration.rb +0 -17
  66. data/lib/algolia/models/query-suggestions/configuration_response.rb +0 -17
  67. data/lib/algolia/models/query-suggestions/configuration_with_index.rb +0 -17
  68. data/lib/algolia/models/query-suggestions/source_index.rb +0 -28
  69. data/lib/algolia/models/recommend/banner.rb +218 -0
  70. data/lib/algolia/models/{query-suggestions/base_query_suggestions_configuration_response.rb → recommend/banner_image.rb} +31 -38
  71. data/lib/algolia/models/{query-suggestions/base_query_suggestions_configuration_with_index.rb → recommend/banner_image_url.rb} +23 -23
  72. data/lib/algolia/models/{query-suggestions/get_config_status200_response.rb → recommend/banner_link.rb} +13 -53
  73. data/lib/algolia/models/recommend/bought_together_query.rb +0 -36
  74. data/lib/algolia/models/recommend/condition.rb +0 -15
  75. data/lib/algolia/models/recommend/consequence.rb +0 -28
  76. data/lib/algolia/models/recommend/fallback_params.rb +8 -100
  77. data/lib/algolia/models/recommend/looking_similar_query.rb +0 -36
  78. data/lib/algolia/models/recommend/numeric_filters.rb +1 -1
  79. data/lib/algolia/models/recommend/promote_consequence_object.rb +0 -14
  80. data/lib/algolia/models/recommend/ranking_info.rb +0 -112
  81. data/lib/algolia/models/recommend/recommend_hit.rb +0 -18
  82. data/lib/algolia/models/recommend/recommend_search_params.rb +8 -100
  83. data/lib/algolia/models/recommend/recommendations_results.rb +0 -61
  84. data/lib/algolia/models/recommend/recommended_for_you_query.rb +0 -36
  85. data/lib/algolia/models/recommend/related_query.rb +0 -36
  86. data/lib/algolia/models/recommend/rendering_content.rb +14 -5
  87. data/lib/algolia/models/recommend/search_recommend_rules_params.rb +0 -50
  88. data/lib/algolia/models/recommend/search_recommend_rules_response.rb +0 -14
  89. data/lib/algolia/models/recommend/trending_facet_hit.rb +0 -18
  90. data/lib/algolia/models/recommend/trending_facets_query.rb +0 -36
  91. data/lib/algolia/models/recommend/trending_items_query.rb +0 -36
  92. data/lib/algolia/models/recommend/typo_tolerance.rb +1 -1
  93. data/lib/algolia/models/recommend/widgets.rb +212 -0
  94. data/lib/algolia/models/search/api_key.rb +1 -1
  95. data/lib/algolia/models/search/banner.rb +218 -0
  96. data/lib/algolia/models/{query-suggestions/get_log_file200_response.rb → search/banner_image.rb} +21 -61
  97. data/lib/algolia/models/search/banner_image_url.rb +212 -0
  98. data/lib/algolia/models/search/banner_link.rb +212 -0
  99. data/lib/algolia/models/search/browse_params_object.rb +4 -132
  100. data/lib/algolia/models/search/browse_response.rb +0 -61
  101. data/lib/algolia/models/search/condition.rb +0 -15
  102. data/lib/algolia/models/search/consequence.rb +0 -28
  103. data/lib/algolia/models/search/consequence_params.rb +4 -132
  104. data/lib/algolia/models/search/delete_by_params.rb +1 -1
  105. data/lib/algolia/models/search/get_api_key_response.rb +1 -1
  106. data/lib/algolia/models/search/index_settings.rb +7 -85
  107. data/lib/algolia/models/search/log.rb +0 -34
  108. data/lib/algolia/models/search/numeric_filters.rb +1 -1
  109. data/lib/algolia/models/search/promote_object_ids.rb +0 -14
  110. data/lib/algolia/models/search/ranking_info.rb +0 -112
  111. data/lib/algolia/models/search/rendering_content.rb +14 -5
  112. data/lib/algolia/models/search/rule.rb +0 -18
  113. data/lib/algolia/models/search/search_dictionary_entries_params.rb +0 -32
  114. data/lib/algolia/models/search/search_dictionary_entries_response.rb +0 -14
  115. data/lib/algolia/models/search/search_for_facet_values_request.rb +0 -14
  116. data/lib/algolia/models/search/search_for_facets.rb +4 -132
  117. data/lib/algolia/models/search/search_for_hits.rb +4 -132
  118. data/lib/algolia/models/search/search_params_object.rb +4 -132
  119. data/lib/algolia/models/search/search_response.rb +0 -61
  120. data/lib/algolia/models/search/search_rules_params.rb +0 -32
  121. data/lib/algolia/models/search/search_synonyms_params.rb +0 -32
  122. data/lib/algolia/models/search/search_user_ids_params.rb +0 -32
  123. data/lib/algolia/models/search/search_user_ids_response.rb +0 -32
  124. data/lib/algolia/models/search/settings_response.rb +7 -85
  125. data/lib/algolia/models/search/typo_tolerance.rb +1 -1
  126. data/lib/algolia/models/search/user_hit.rb +0 -15
  127. data/lib/algolia/models/search/user_id.rb +0 -15
  128. data/lib/algolia/models/search/widgets.rb +212 -0
  129. data/lib/algolia/version.rb +1 -1
  130. metadata +12 -9
  131. data/lib/algolia/models/query-suggestions/query_suggestions_configuration.rb +0 -276
  132. data/lib/algolia/models/query-suggestions/query_suggestions_configuration_response.rb +0 -316
  133. data/lib/algolia/models/query-suggestions/query_suggestions_configuration_with_index.rb +0 -295
@@ -110,38 +110,6 @@ module Algolia
110
110
  end
111
111
  end
112
112
 
113
- # Custom attribute writer method with validation
114
- # @param [Object] page Value to be assigned
115
- def page=(page)
116
- if page.nil?
117
- raise ArgumentError, "page cannot be nil"
118
- end
119
-
120
- if page < 0
121
- raise ArgumentError, "invalid value for \"page\", must be greater than or equal to 0."
122
- end
123
-
124
- @page = page
125
- end
126
-
127
- # Custom attribute writer method with validation
128
- # @param [Object] hits_per_page Value to be assigned
129
- def hits_per_page=(hits_per_page)
130
- if hits_per_page.nil?
131
- raise ArgumentError, "hits_per_page cannot be nil"
132
- end
133
-
134
- if hits_per_page > 1000
135
- raise ArgumentError, "invalid value for \"hits_per_page\", must be smaller than or equal to 1000."
136
- end
137
-
138
- if hits_per_page < 1
139
- raise ArgumentError, "invalid value for \"hits_per_page\", must be greater than or equal to 1."
140
- end
141
-
142
- @hits_per_page = hits_per_page
143
- end
144
-
145
113
  # Checks equality by comparing each attribute.
146
114
  # @param [Object] Object to be compared
147
115
  def ==(other)
@@ -89,38 +89,6 @@ module Algolia
89
89
  end
90
90
  end
91
91
 
92
- # Custom attribute writer method with validation
93
- # @param [Object] page Value to be assigned
94
- def page=(page)
95
- if page.nil?
96
- raise ArgumentError, "page cannot be nil"
97
- end
98
-
99
- if page < 0
100
- raise ArgumentError, "invalid value for \"page\", must be greater than or equal to 0."
101
- end
102
-
103
- @page = page
104
- end
105
-
106
- # Custom attribute writer method with validation
107
- # @param [Object] hits_per_page Value to be assigned
108
- def hits_per_page=(hits_per_page)
109
- if hits_per_page.nil?
110
- raise ArgumentError, "hits_per_page cannot be nil"
111
- end
112
-
113
- if hits_per_page > 1000
114
- raise ArgumentError, "invalid value for \"hits_per_page\", must be smaller than or equal to 1000."
115
- end
116
-
117
- if hits_per_page < 1
118
- raise ArgumentError, "invalid value for \"hits_per_page\", must be greater than or equal to 1."
119
- end
120
-
121
- @hits_per_page = hits_per_page
122
- end
123
-
124
92
  # Checks equality by comparing each attribute.
125
93
  # @param [Object] Object to be compared
126
94
  def ==(other)
@@ -93,38 +93,6 @@ module Algolia
93
93
  end
94
94
  end
95
95
 
96
- # Custom attribute writer method with validation
97
- # @param [Object] page Value to be assigned
98
- def page=(page)
99
- if page.nil?
100
- raise ArgumentError, "page cannot be nil"
101
- end
102
-
103
- if page < 0
104
- raise ArgumentError, "invalid value for \"page\", must be greater than or equal to 0."
105
- end
106
-
107
- @page = page
108
- end
109
-
110
- # Custom attribute writer method with validation
111
- # @param [Object] hits_per_page Value to be assigned
112
- def hits_per_page=(hits_per_page)
113
- if hits_per_page.nil?
114
- raise ArgumentError, "hits_per_page cannot be nil"
115
- end
116
-
117
- if hits_per_page > 1000
118
- raise ArgumentError, "invalid value for \"hits_per_page\", must be smaller than or equal to 1000."
119
- end
120
-
121
- if hits_per_page < 1
122
- raise ArgumentError, "invalid value for \"hits_per_page\", must be greater than or equal to 1."
123
- end
124
-
125
- @hits_per_page = hits_per_page
126
- end
127
-
128
96
  # Checks equality by comparing each attribute.
129
97
  # @param [Object] Object to be compared
130
98
  def ==(other)
@@ -112,38 +112,6 @@ module Algolia
112
112
  end
113
113
  end
114
114
 
115
- # Custom attribute writer method with validation
116
- # @param [Object] page Value to be assigned
117
- def page=(page)
118
- if page.nil?
119
- raise ArgumentError, "page cannot be nil"
120
- end
121
-
122
- if page < 0
123
- raise ArgumentError, "invalid value for \"page\", must be greater than or equal to 0."
124
- end
125
-
126
- @page = page
127
- end
128
-
129
- # Custom attribute writer method with validation
130
- # @param [Object] hits_per_page Value to be assigned
131
- def hits_per_page=(hits_per_page)
132
- if hits_per_page.nil?
133
- raise ArgumentError, "hits_per_page cannot be nil"
134
- end
135
-
136
- if hits_per_page > 1000
137
- raise ArgumentError, "invalid value for \"hits_per_page\", must be smaller than or equal to 1000."
138
- end
139
-
140
- if hits_per_page < 1
141
- raise ArgumentError, "invalid value for \"hits_per_page\", must be greater than or equal to 1."
142
- end
143
-
144
- @hits_per_page = hits_per_page
145
- end
146
-
147
115
  # Checks equality by comparing each attribute.
148
116
  # @param [Object] Object to be compared
149
117
  def ==(other)
@@ -6,10 +6,10 @@ require "time"
6
6
  module Algolia
7
7
  module Search
8
8
  class SettingsResponse
9
- # Attributes used for [faceting](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/). Facets are attributes that let you categorize search results. They can be used for filtering search results. By default, no attribute is used for faceting. Attribute names are case-sensitive. **Modifiers** - `filterOnly(\"ATTRIBUTE\")`. Allows using this attribute as a filter, but doesn't evalue the facet values. - `searchable(\"ATTRIBUTE\")`. Allows searching for facet values. - `afterDistinct(\"ATTRIBUTE\")`. Evaluates the facet count _after_ deduplication with `distinct`. This ensures accurate facet counts. You can apply this modifier to searchable facets: `afterDistinct(searchable(ATTRIBUTE))`.
9
+ # Attributes used for [faceting](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/). Facets are attributes that let you categorize search results. They can be used for filtering search results. By default, no attribute is used for faceting. Attribute names are case-sensitive. **Modifiers** - `filterOnly(\"ATTRIBUTE\")`. Allows the attribute to be used as a filter but doesn't evaluate the facet values. - `searchable(\"ATTRIBUTE\")`. Allows searching for facet values. - `afterDistinct(\"ATTRIBUTE\")`. Evaluates the facet count _after_ deduplication with `distinct`. This ensures accurate facet counts. You can apply this modifier to searchable facets: `afterDistinct(searchable(ATTRIBUTE))`.
10
10
  attr_accessor :attributes_for_faceting
11
11
 
12
- # Creates [replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/). Replicas are copies of a primary index with the same records but different settings, synonyms, or rules. If you want to offer a different ranking or sorting of your search results, you'll use replica indices. All index operations on a primary index are automatically forwarded to its replicas. To add a replica index, you must provide the complete set of replicas to this parameter. If you omit a replica from this list, the replica turns into a regular, standalone index that will no longer by synced with the primary index. **Modifier** - `virtual(\"REPLICA\")`. Create a virtual replica, Virtual replicas don't increase the number of records and are optimized for [Relevant sorting](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/relevant-sort/).
12
+ # Creates [replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/). Replicas are copies of a primary index with the same records but different settings, synonyms, or rules. If you want to offer a different ranking or sorting of your search results, you'll use replica indices. All index operations on a primary index are automatically forwarded to its replicas. To add a replica index, you must provide the complete set of replicas to this parameter. If you omit a replica from this list, the replica turns into a regular, standalone index that will no longer be synced with the primary index. **Modifier** - `virtual(\"REPLICA\")`. Create a virtual replica, Virtual replicas don't increase the number of records and are optimized for [Relevant sorting](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/relevant-sort/).
13
13
  attr_accessor :replicas
14
14
 
15
15
  # Maximum number of search results that can be obtained through pagination. Higher pagination limits might slow down your search. For pagination limits above 1,000, the sorting of results beyond the 1,000th hit can't be guaranteed.
@@ -39,13 +39,13 @@ module Algolia
39
39
  # Whether arrays with exclusively non-negative integers should be compressed for better performance. If true, the compressed arrays may be reordered.
40
40
  attr_accessor :allow_compression_of_integer_array
41
41
 
42
- # Numeric attributes that can be used as [numerical filters](https://www.algolia.com/doc/guides/managing-results/rules/detecting-intent/how-to/applying-a-custom-filter-for-a-specific-query/#numerical-filters). Attribute names are case-sensitive. By default, all numeric attributes are available as numerical filters. For faster indexing, reduce the number of numeric attributes. If you want to turn off filtering for all numeric attributes, specifiy an attribute that doesn't exist in your index, such as `NO_NUMERIC_FILTERING`. **Modifier** - `equalOnly(\"ATTRIBUTE\")`. Support only filtering based on equality comparisons `=` and `!=`.
42
+ # Numeric attributes that can be used as [numerical filters](https://www.algolia.com/doc/guides/managing-results/rules/detecting-intent/how-to/applying-a-custom-filter-for-a-specific-query/#numerical-filters). Attribute names are case-sensitive. By default, all numeric attributes are available as numerical filters. For faster indexing, reduce the number of numeric attributes. To turn off filtering for all numeric attributes, specify an attribute that doesn't exist in your index, such as `NO_NUMERIC_FILTERING`. **Modifier** - `equalOnly(\"ATTRIBUTE\")`. Support only filtering based on equality comparisons `=` and `!=`.
43
43
  attr_accessor :numeric_attributes_for_filtering
44
44
 
45
45
  # Controls which separators are indexed. Separators are all non-letter characters except spaces and currency characters, such as $€£¥. By default, separator characters aren't indexed. With `separatorsToIndex`, Algolia treats separator characters as separate words. For example, a search for `C#` would report two matches.
46
46
  attr_accessor :separators_to_index
47
47
 
48
- # Attributes used for searching. Attribute names are case-sensitive. By default, all attributes are searchable and the [Attribute](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#attribute) ranking criterion is turned off. With a non-empty list, Algolia only returns results with matches in the selected attributes. In addition, the Attribute ranking criterion is turned on: matches in attributes that are higher in the list of `searchableAttributes` rank first. To make matches in two attributes rank equally, include them in a comma-separated string, such as `\"title,alternate_title\"`. Attributes with the same priority are always unordered. For more information, see [Searchable attributes](https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/how-to/setting-searchable-attributes/). **Modifier** - `unordered(\"ATTRIBUTE\")`. Ignore the position of a match within the attribute. Without modifier, matches at the beginning of an attribute rank higer than matches at the end.
48
+ # Attributes used for searching. Attribute names are case-sensitive. By default, all attributes are searchable and the [Attribute](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#attribute) ranking criterion is turned off. With a non-empty list, Algolia only returns results with matches in the selected attributes. In addition, the Attribute ranking criterion is turned on: matches in attributes that are higher in the list of `searchableAttributes` rank first. To make matches in two attributes rank equally, include them in a comma-separated string, such as `\"title,alternate_title\"`. Attributes with the same priority are always unordered. For more information, see [Searchable attributes](https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/how-to/setting-searchable-attributes/). **Modifier** - `unordered(\"ATTRIBUTE\")`. Ignore the position of a match within the attribute. Without a modifier, matches at the beginning of an attribute rank higher than matches at the end.
49
49
  attr_accessor :searchable_attributes
50
50
 
51
51
  # An object with custom data. You can store up to 32kB as custom data.
@@ -134,10 +134,10 @@ module Algolia
134
134
  # Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported.
135
135
  attr_accessor :advanced_syntax
136
136
 
137
- # Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words dividied by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words).
137
+ # Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words divided by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words).
138
138
  attr_accessor :optional_words
139
139
 
140
- # Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelyhood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking.
140
+ # Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking.
141
141
  attr_accessor :disable_exact_on_attributes
142
142
 
143
143
  attr_accessor :exact_on_single_word_query
@@ -150,7 +150,7 @@ module Algolia
150
150
 
151
151
  attr_accessor :distinct
152
152
 
153
- # Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted. With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurences of \"house\" are replaced by \"home\" in the highlighted response.
153
+ # Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted. With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of \"house\" are replaced by \"home\" in the highlighted response.
154
154
  attr_accessor :replace_synonyms_in_highlight
155
155
 
156
156
  # Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score.
@@ -655,84 +655,6 @@ module Algolia
655
655
  end
656
656
  end
657
657
 
658
- # Custom attribute writer method with validation
659
- # @param [Object] pagination_limited_to Value to be assigned
660
- def pagination_limited_to=(pagination_limited_to)
661
- if pagination_limited_to.nil?
662
- raise ArgumentError, "pagination_limited_to cannot be nil"
663
- end
664
-
665
- if pagination_limited_to > 20000
666
- raise ArgumentError, "invalid value for \"pagination_limited_to\", must be smaller than or equal to 20000."
667
- end
668
-
669
- @pagination_limited_to = pagination_limited_to
670
- end
671
-
672
- # Custom attribute writer method with validation
673
- # @param [Object] hits_per_page Value to be assigned
674
- def hits_per_page=(hits_per_page)
675
- if hits_per_page.nil?
676
- raise ArgumentError, "hits_per_page cannot be nil"
677
- end
678
-
679
- if hits_per_page > 1000
680
- raise ArgumentError, "invalid value for \"hits_per_page\", must be smaller than or equal to 1000."
681
- end
682
-
683
- if hits_per_page < 1
684
- raise ArgumentError, "invalid value for \"hits_per_page\", must be greater than or equal to 1."
685
- end
686
-
687
- @hits_per_page = hits_per_page
688
- end
689
-
690
- # Custom attribute writer method with validation
691
- # @param [Object] min_proximity Value to be assigned
692
- def min_proximity=(min_proximity)
693
- if min_proximity.nil?
694
- raise ArgumentError, "min_proximity cannot be nil"
695
- end
696
-
697
- if min_proximity > 7
698
- raise ArgumentError, "invalid value for \"min_proximity\", must be smaller than or equal to 7."
699
- end
700
-
701
- if min_proximity < 1
702
- raise ArgumentError, "invalid value for \"min_proximity\", must be greater than or equal to 1."
703
- end
704
-
705
- @min_proximity = min_proximity
706
- end
707
-
708
- # Custom attribute writer method with validation
709
- # @param [Object] max_facet_hits Value to be assigned
710
- def max_facet_hits=(max_facet_hits)
711
- if max_facet_hits.nil?
712
- raise ArgumentError, "max_facet_hits cannot be nil"
713
- end
714
-
715
- if max_facet_hits > 100
716
- raise ArgumentError, "invalid value for \"max_facet_hits\", must be smaller than or equal to 100."
717
- end
718
-
719
- @max_facet_hits = max_facet_hits
720
- end
721
-
722
- # Custom attribute writer method with validation
723
- # @param [Object] max_values_per_facet Value to be assigned
724
- def max_values_per_facet=(max_values_per_facet)
725
- if max_values_per_facet.nil?
726
- raise ArgumentError, "max_values_per_facet cannot be nil"
727
- end
728
-
729
- if max_values_per_facet > 1000
730
- raise ArgumentError, "invalid value for \"max_values_per_facet\", must be smaller than or equal to 1000."
731
- end
732
-
733
- @max_values_per_facet = max_values_per_facet
734
- end
735
-
736
658
  # Checks equality by comparing each attribute.
737
659
  # @param [Object] Object to be compared
738
660
  def ==(other)
@@ -5,7 +5,7 @@ require "time"
5
5
 
6
6
  module Algolia
7
7
  module Search
8
- # Whether [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/) is enabled and how it is applied. If typo tolerance is true, `min`, or `strict`, [word splitting and concetenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation/) is also active.
8
+ # Whether [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/) is enabled and how it is applied. If typo tolerance is true, `min`, or `strict`, [word splitting and concatenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation/) are also active.
9
9
  module TypoTolerance
10
10
  class << self
11
11
  # List of class defined in oneOf (OpenAPI v3)
@@ -116,21 +116,6 @@ module Algolia
116
116
  end
117
117
  end
118
118
 
119
- # Custom attribute writer method with validation
120
- # @param [Object] user_id Value to be assigned
121
- def user_id=(user_id)
122
- if user_id.nil?
123
- raise ArgumentError, "user_id cannot be nil"
124
- end
125
-
126
- pattern = /^[a-zA-Z0-9 \-*.]+$/
127
- if user_id !~ pattern
128
- raise ArgumentError, "invalid value for \"user_id\", must conform to the pattern #{pattern}."
129
- end
130
-
131
- @user_id = user_id
132
- end
133
-
134
119
  # Checks equality by comparing each attribute.
135
120
  # @param [Object] Object to be compared
136
121
  def ==(other)
@@ -96,21 +96,6 @@ module Algolia
96
96
  end
97
97
  end
98
98
 
99
- # Custom attribute writer method with validation
100
- # @param [Object] user_id Value to be assigned
101
- def user_id=(user_id)
102
- if user_id.nil?
103
- raise ArgumentError, "user_id cannot be nil"
104
- end
105
-
106
- pattern = /^[a-zA-Z0-9 \-*.]+$/
107
- if user_id !~ pattern
108
- raise ArgumentError, "invalid value for \"user_id\", must conform to the pattern #{pattern}."
109
- end
110
-
111
- @user_id = user_id
112
- end
113
-
114
99
  # Checks equality by comparing each attribute.
115
100
  # @param [Object] Object to be compared
116
101
  def ==(other)
@@ -0,0 +1,212 @@
1
+ # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
2
+
3
+ require "date"
4
+ require "time"
5
+
6
+ module Algolia
7
+ module Search
8
+ # widgets returned from any rules that are applied to the current search.
9
+ class Widgets
10
+ # banners defined in the merchandising studio for the given search.
11
+ attr_accessor :banners
12
+
13
+ # Attribute mapping from ruby-style variable name to JSON key.
14
+ def self.attribute_map
15
+ {
16
+ :banners => :banners
17
+ }
18
+ end
19
+
20
+ # Returns all the JSON keys this model knows about
21
+ def self.acceptable_attributes
22
+ attribute_map.values
23
+ end
24
+
25
+ # Attribute type mapping.
26
+ def self.types_mapping
27
+ {
28
+ :banners => :"Array<Banner>"
29
+ }
30
+ end
31
+
32
+ # List of attributes with nullable: true
33
+ def self.openapi_nullable
34
+ Set.new(
35
+ []
36
+ )
37
+ end
38
+
39
+ # Initializes the object
40
+ # @param [Hash] attributes Model attributes in the form of hash
41
+ def initialize(attributes = {})
42
+ if (!attributes.is_a?(Hash))
43
+ raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::Widgets` initialize method"
44
+ end
45
+
46
+ # check to see if the attribute exists and convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}) { |(k, v), h|
48
+ if (!self.class.attribute_map.key?(k.to_sym))
49
+ raise(
50
+ ArgumentError,
51
+ "`#{k}` is not a valid attribute in `Algolia::Widgets`. Please check the name to make sure it's valid. List of attributes: " +
52
+ self.class.attribute_map.keys.inspect
53
+ )
54
+ end
55
+
56
+ h[k.to_sym] = v
57
+ }
58
+
59
+ if attributes.key?(:banners)
60
+ if (value = attributes[:banners]).is_a?(Array)
61
+ self.banners = value
62
+ end
63
+ end
64
+ end
65
+
66
+ # Checks equality by comparing each attribute.
67
+ # @param [Object] Object to be compared
68
+ def ==(other)
69
+ return true if self.equal?(other)
70
+ self.class == other.class &&
71
+ banners == other.banners
72
+ end
73
+
74
+ # @see the `==` method
75
+ # @param [Object] Object to be compared
76
+ def eql?(other)
77
+ self == other
78
+ end
79
+
80
+ # Calculates hash code according to all attributes.
81
+ # @return [Integer] Hash code
82
+ def hash
83
+ [banners].hash
84
+ end
85
+
86
+ # Builds the object from hash
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ # @return [Object] Returns the model itself
89
+ def self.build_from_hash(attributes)
90
+ return nil unless attributes.is_a?(Hash)
91
+ attributes = attributes.transform_keys(&:to_sym)
92
+ transformed_hash = {}
93
+ types_mapping.each_pair do |key, type|
94
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
95
+ transformed_hash[key.to_sym] = nil
96
+ elsif type =~ /\AArray<(.*)>/i
97
+ # check to ensure the input is an array given that the attribute
98
+ # is documented as an array but the input is not
99
+ if attributes[attribute_map[key]].is_a?(Array)
100
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
101
+ _deserialize(::Regexp.last_match(1), v)
102
+ }
103
+ end
104
+ elsif !attributes[attribute_map[key]].nil?
105
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
106
+ end
107
+ end
108
+
109
+ new(transformed_hash)
110
+ end
111
+
112
+ # Deserializes the data based on type
113
+ # @param string type Data type
114
+ # @param string value Value to be deserialized
115
+ # @return [Object] Deserialized data
116
+ def self._deserialize(type, value)
117
+ case type.to_sym
118
+ when :Time
119
+ Time.parse(value)
120
+ when :Date
121
+ Date.parse(value)
122
+ when :String
123
+ value.to_s
124
+ when :Integer
125
+ value.to_i
126
+ when :Float
127
+ value.to_f
128
+ when :Boolean
129
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
130
+ true
131
+ else
132
+ false
133
+ end
134
+
135
+ when :Object
136
+ # generic object (usually a Hash), return directly
137
+ value
138
+ when /\AArray<(?<inner_type>.+)>\z/
139
+ inner_type = Regexp.last_match[:inner_type]
140
+ value.map { |v| _deserialize(inner_type, v) }
141
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
142
+ k_type = Regexp.last_match[:k_type]
143
+ v_type = Regexp.last_match[:v_type]
144
+ {}.tap do |hash|
145
+ value.each do |k, v|
146
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
147
+ end
148
+ end
149
+ # model
150
+ else
151
+ # models (e.g. Pet) or oneOf
152
+ klass = Algolia::Search.const_get(type)
153
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
154
+ .build_from_hash(value)
155
+ end
156
+ end
157
+
158
+ # Returns the string representation of the object
159
+ # @return [String] String presentation of the object
160
+ def to_s
161
+ to_hash.to_s
162
+ end
163
+
164
+ # to_body is an alias to to_hash (backward compatibility)
165
+ # @return [Hash] Returns the object in the form of hash
166
+ def to_body
167
+ to_hash
168
+ end
169
+
170
+ def to_json(*_args)
171
+ to_hash.to_json
172
+ end
173
+
174
+ # Returns the object in the form of hash
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_hash
177
+ hash = {}
178
+ self.class.attribute_map.each_pair do |attr, param|
179
+ value = send(attr)
180
+ if value.nil?
181
+ is_nullable = self.class.openapi_nullable.include?(attr)
182
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
183
+ end
184
+
185
+ hash[param] = _to_hash(value)
186
+ end
187
+
188
+ hash
189
+ end
190
+
191
+ # Outputs non-array value in the form of hash
192
+ # For object, use to_hash. Otherwise, just return the value
193
+ # @param [Object] value Any valid value
194
+ # @return [Hash] Returns the value in the form of hash
195
+ def _to_hash(value)
196
+ if value.is_a?(Array)
197
+ value.compact.map { |v| _to_hash(v) }
198
+ elsif value.is_a?(Hash)
199
+ {}.tap do |hash|
200
+ value.each { |k, v| hash[k] = _to_hash(v) }
201
+ end
202
+ elsif value.respond_to?(:to_hash)
203
+ value.to_hash
204
+ else
205
+ value
206
+ end
207
+ end
208
+
209
+ end
210
+
211
+ end
212
+ end
@@ -1,5 +1,5 @@
1
1
  # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
2
2
 
3
3
  module Algolia
4
- VERSION = "3.4.0".freeze
4
+ VERSION = "3.5.1".freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algolia
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.0
4
+ version: 3.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - https://alg.li/support
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-01 00:00:00.000000000 Z
11
+ date: 2024-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -419,8 +419,6 @@ files:
419
419
  - lib/algolia/models/personalization/get_user_token_response.rb
420
420
  - lib/algolia/models/personalization/personalization_strategy_params.rb
421
421
  - lib/algolia/models/personalization/set_personalization_strategy_response.rb
422
- - lib/algolia/models/query-suggestions/base_query_suggestions_configuration_response.rb
423
- - lib/algolia/models/query-suggestions/base_query_suggestions_configuration_with_index.rb
424
422
  - lib/algolia/models/query-suggestions/base_response.rb
425
423
  - lib/algolia/models/query-suggestions/config_status.rb
426
424
  - lib/algolia/models/query-suggestions/configuration.rb
@@ -428,14 +426,9 @@ files:
428
426
  - lib/algolia/models/query-suggestions/configuration_with_index.rb
429
427
  - lib/algolia/models/query-suggestions/error_base.rb
430
428
  - lib/algolia/models/query-suggestions/facet.rb
431
- - lib/algolia/models/query-suggestions/get_config_status200_response.rb
432
- - lib/algolia/models/query-suggestions/get_log_file200_response.rb
433
429
  - lib/algolia/models/query-suggestions/languages.rb
434
430
  - lib/algolia/models/query-suggestions/log_file.rb
435
431
  - lib/algolia/models/query-suggestions/log_level.rb
436
- - lib/algolia/models/query-suggestions/query_suggestions_configuration.rb
437
- - lib/algolia/models/query-suggestions/query_suggestions_configuration_response.rb
438
- - lib/algolia/models/query-suggestions/query_suggestions_configuration_with_index.rb
439
432
  - lib/algolia/models/query-suggestions/source_index.rb
440
433
  - lib/algolia/models/recommend/advanced_syntax_features.rb
441
434
  - lib/algolia/models/recommend/alternatives_as_exact.rb
@@ -443,6 +436,10 @@ files:
443
436
  - lib/algolia/models/recommend/around_radius.rb
444
437
  - lib/algolia/models/recommend/around_radius_all.rb
445
438
  - lib/algolia/models/recommend/auto_facet_filter.rb
439
+ - lib/algolia/models/recommend/banner.rb
440
+ - lib/algolia/models/recommend/banner_image.rb
441
+ - lib/algolia/models/recommend/banner_image_url.rb
442
+ - lib/algolia/models/recommend/banner_link.rb
446
443
  - lib/algolia/models/recommend/boolean_string.rb
447
444
  - lib/algolia/models/recommend/bought_together_query.rb
448
445
  - lib/algolia/models/recommend/condition.rb
@@ -515,6 +512,7 @@ files:
515
512
  - lib/algolia/models/recommend/typo_tolerance.rb
516
513
  - lib/algolia/models/recommend/typo_tolerance_enum.rb
517
514
  - lib/algolia/models/recommend/value.rb
515
+ - lib/algolia/models/recommend/widgets.rb
518
516
  - lib/algolia/models/search/acl.rb
519
517
  - lib/algolia/models/search/action.rb
520
518
  - lib/algolia/models/search/add_api_key_response.rb
@@ -530,6 +528,10 @@ files:
530
528
  - lib/algolia/models/search/attribute_to_update.rb
531
529
  - lib/algolia/models/search/automatic_facet_filter.rb
532
530
  - lib/algolia/models/search/automatic_facet_filters.rb
531
+ - lib/algolia/models/search/banner.rb
532
+ - lib/algolia/models/search/banner_image.rb
533
+ - lib/algolia/models/search/banner_image_url.rb
534
+ - lib/algolia/models/search/banner_link.rb
533
535
  - lib/algolia/models/search/batch_assign_user_ids_params.rb
534
536
  - lib/algolia/models/search/batch_dictionary_entries_params.rb
535
537
  - lib/algolia/models/search/batch_dictionary_entries_request.rb
@@ -674,6 +676,7 @@ files:
674
676
  - lib/algolia/models/search/user_hit.rb
675
677
  - lib/algolia/models/search/user_id.rb
676
678
  - lib/algolia/models/search/value.rb
679
+ - lib/algolia/models/search/widgets.rb
677
680
  - lib/algolia/transport/call_type.rb
678
681
  - lib/algolia/transport/echo_requester.rb
679
682
  - lib/algolia/transport/http/http_requester.rb