algolia 3.0.0.alpha.16 → 3.0.0.alpha.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.openapi-generator/FILES +10 -167
- data/CHANGELOG.md +16 -0
- data/Gemfile.lock +4 -4
- data/lib/algolia/api/abtesting_client.rb +20 -20
- data/lib/algolia/api/analytics_client.rb +76 -76
- data/lib/algolia/api/personalization_client.rb +12 -12
- data/lib/algolia/api/recommend_client.rb +22 -22
- data/lib/algolia/api/search_client.rb +8 -8
- data/lib/algolia/api/usage_client.rb +329 -0
- data/lib/algolia/models/abtesting/ab_test.rb +41 -16
- data/lib/algolia/models/abtesting/ab_test_configuration.rb +217 -0
- data/lib/algolia/models/abtesting/ab_test_response.rb +2 -2
- data/lib/algolia/models/abtesting/ab_tests_variant.rb +21 -3
- data/lib/algolia/models/abtesting/ab_tests_variant_search_params.rb +21 -3
- data/lib/algolia/models/abtesting/add_ab_tests_request.rb +1 -1
- data/lib/algolia/models/abtesting/custom_search_params.rb +1 -1
- data/lib/algolia/models/abtesting/effect.rb +35 -0
- data/lib/algolia/models/abtesting/empty_search.rb +198 -0
- data/lib/algolia/models/abtesting/list_ab_tests_response.rb +1 -1
- data/lib/algolia/models/abtesting/minimum_detectable_effect.rb +247 -0
- data/lib/algolia/models/abtesting/outliers.rb +198 -0
- data/lib/algolia/models/abtesting/status.rb +35 -0
- data/lib/algolia/models/abtesting/variant.rb +31 -13
- data/lib/algolia/models/analytics/get_status_response.rb +1 -1
- data/lib/algolia/models/ingestion/auth_algolia_insights.rb +212 -0
- data/lib/algolia/models/{recommend/consequence_query_object.rb → ingestion/auth_algolia_insights_partial.rb} +21 -24
- data/lib/algolia/models/ingestion/auth_input.rb +1 -0
- data/lib/algolia/models/ingestion/auth_input_partial.rb +1 -0
- data/lib/algolia/models/ingestion/authentication_type.rb +2 -1
- data/lib/algolia/models/ingestion/destination_index_name.rb +1 -1
- data/lib/algolia/models/ingestion/shopify_input.rb +212 -0
- data/lib/algolia/models/ingestion/shopify_market.rb +227 -0
- data/lib/algolia/models/ingestion/shopify_metafield.rb +221 -0
- data/lib/algolia/models/ingestion/source_input.rb +2 -1
- data/lib/algolia/models/ingestion/source_shopify.rb +278 -0
- data/lib/algolia/models/{recommend/base_recommended_for_you_query_parameters.rb → ingestion/source_shopify_base.rb} +14 -14
- data/lib/algolia/models/ingestion/source_update_input.rb +2 -1
- data/lib/algolia/models/ingestion/source_update_shopify.rb +258 -0
- data/lib/algolia/models/ingestion/task_input.rb +1 -0
- data/lib/algolia/models/insights/added_to_cart_object_ids.rb +2 -2
- data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +2 -2
- data/lib/algolia/models/insights/clicked_filters.rb +2 -2
- data/lib/algolia/models/insights/clicked_object_ids.rb +2 -2
- data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +2 -2
- data/lib/algolia/models/insights/converted_filters.rb +2 -2
- data/lib/algolia/models/insights/converted_object_ids.rb +2 -2
- data/lib/algolia/models/insights/converted_object_ids_after_search.rb +2 -2
- data/lib/algolia/models/insights/purchased_object_ids.rb +2 -2
- data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +2 -2
- data/lib/algolia/models/insights/viewed_filters.rb +2 -2
- data/lib/algolia/models/insights/viewed_object_ids.rb +2 -2
- data/lib/algolia/models/monitoring/incidents_inner.rb +1 -1
- data/lib/algolia/models/monitoring/probes_metric.rb +1 -1
- data/lib/algolia/models/monitoring/time_inner.rb +1 -1
- data/lib/algolia/models/personalization/delete_user_profile_response.rb +2 -2
- data/lib/algolia/models/personalization/event_scoring.rb +25 -4
- data/lib/algolia/models/personalization/event_type.rb +34 -0
- data/lib/algolia/models/personalization/facet_scoring.rb +2 -2
- data/lib/algolia/models/personalization/get_user_token_response.rb +3 -3
- data/lib/algolia/models/personalization/personalization_strategy_params.rb +21 -3
- data/lib/algolia/models/query-suggestions/get_config_status200_response.rb +3 -3
- data/lib/algolia/models/query-suggestions/get_log_file200_response.rb +1 -1
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration_response.rb +1 -1
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration_with_index.rb +1 -1
- data/lib/algolia/models/query-suggestions/source_index.rb +1 -1
- data/lib/algolia/models/recommend/auto_facet_filter.rb +208 -0
- data/lib/algolia/models/recommend/base_recommend_request.rb +37 -8
- data/lib/algolia/models/recommend/base_search_params.rb +4 -4
- data/lib/algolia/models/recommend/base_search_params_without_query.rb +4 -4
- data/lib/algolia/models/recommend/bought_together_query.rb +319 -0
- data/lib/algolia/models/recommend/condition.rb +12 -62
- data/lib/algolia/models/recommend/consequence.rb +32 -54
- data/lib/algolia/models/recommend/deleted_at_response.rb +1 -1
- data/lib/algolia/models/recommend/{recommended_for_you_query_parameters.rb → fallback_params.rb} +17 -20
- data/lib/algolia/models/recommend/{edit_type.rb → fbt_model.rb} +5 -6
- data/lib/algolia/models/recommend/{base_trending_facets_query.rb → frequently_bought_together.rb} +20 -18
- data/lib/algolia/models/recommend/get_recommendations_params.rb +2 -2
- data/lib/algolia/models/recommend/{consequence_hide.rb → hide_consequence_object.rb} +4 -6
- data/lib/algolia/models/recommend/index_settings_as_search_params.rb +10 -10
- data/lib/algolia/models/recommend/{base_recommendations_query.rb → looking_similar.rb} +6 -15
- data/lib/algolia/models/recommend/{anchoring.rb → looking_similar_model.rb} +5 -8
- data/lib/algolia/models/recommend/looking_similar_query.rb +328 -0
- data/lib/algolia/models/recommend/{params.rb → params_consequence.rb} +26 -28
- data/lib/algolia/models/recommend/{promote_object_id.rb → promote_consequence_object.rb} +19 -9
- data/lib/algolia/models/recommend/re_ranking_apply_filter.rb +1 -1
- data/lib/algolia/models/recommend/{rule_response.rb → recommend_rule.rb} +13 -18
- data/lib/algolia/models/recommend/{rule_response_metadata.rb → recommend_rule_metadata.rb} +5 -4
- data/lib/algolia/models/recommend/recommendations_hits.rb +4 -24
- data/lib/algolia/models/recommend/recommendations_request.rb +3 -1
- data/lib/algolia/models/recommend/recommendations_results.rb +4 -24
- data/lib/algolia/models/recommend/{base_recommended_for_you_query.rb → recommended_for_you.rb} +5 -14
- data/lib/algolia/models/recommend/recommended_for_you_query.rb +36 -16
- data/lib/algolia/models/recommend/{recommendation_models.rb → related_model.rb} +4 -5
- data/lib/algolia/models/recommend/{edit.rb → related_products.rb} +27 -24
- data/lib/algolia/models/recommend/{recommendations_query.rb → related_query.rb} +40 -20
- data/lib/algolia/models/recommend/{consequence_params.rb → search_params.rb} +33 -52
- data/lib/algolia/models/recommend/search_params_object.rb +15 -14
- data/lib/algolia/models/recommend/search_recommend_rules_params.rb +58 -10
- data/lib/algolia/models/recommend/search_recommend_rules_response.rb +2 -2
- data/lib/algolia/models/recommend/trending_facet_hit.rb +2 -2
- data/lib/algolia/models/recommend/trending_facets.rb +243 -0
- data/lib/algolia/models/recommend/trending_facets_query.rb +51 -11
- data/lib/algolia/models/recommend/{base_trending_items_query.rb → trending_items.rb} +12 -15
- data/lib/algolia/models/recommend/trending_items_query.rb +43 -17
- data/lib/algolia/models/search/add_api_key_response.rb +1 -1
- data/lib/algolia/models/search/base_get_api_key_response.rb +1 -1
- data/lib/algolia/models/search/base_index_settings.rb +10 -10
- data/lib/algolia/models/search/base_search_params.rb +4 -4
- data/lib/algolia/models/search/base_search_params_without_query.rb +4 -4
- data/lib/algolia/models/search/browse_params_object.rb +14 -14
- data/lib/algolia/models/search/consequence_params.rb +14 -14
- data/lib/algolia/models/search/created_at_response.rb +1 -1
- data/lib/algolia/models/search/delete_api_key_response.rb +1 -1
- data/lib/algolia/models/search/delete_by_params.rb +2 -2
- data/lib/algolia/models/search/delete_source_response.rb +1 -1
- data/lib/algolia/models/search/deleted_at_response.rb +1 -1
- data/lib/algolia/models/search/fetched_index.rb +1 -1
- data/lib/algolia/models/search/get_api_key_response.rb +1 -1
- data/lib/algolia/models/search/index_settings.rb +20 -20
- data/lib/algolia/models/search/index_settings_as_search_params.rb +10 -10
- data/lib/algolia/models/search/log.rb +1 -1
- data/lib/algolia/models/search/multiple_batch_request.rb +1 -1
- data/lib/algolia/models/search/operation_index_params.rb +1 -1
- data/lib/algolia/models/search/re_ranking_apply_filter.rb +1 -1
- data/lib/algolia/models/search/remove_user_id_response.rb +1 -1
- data/lib/algolia/models/search/replace_source_response.rb +1 -1
- data/lib/algolia/models/search/save_object_response.rb +1 -1
- data/lib/algolia/models/search/save_synonym_response.rb +1 -1
- data/lib/algolia/models/search/search_for_facets.rb +15 -15
- data/lib/algolia/models/search/search_for_facets_options.rb +1 -1
- data/lib/algolia/models/search/search_for_hits.rb +15 -15
- data/lib/algolia/models/search/search_for_hits_options.rb +1 -1
- data/lib/algolia/models/search/search_params_object.rb +15 -14
- data/lib/algolia/models/search/search_user_ids_response.rb +1 -1
- data/lib/algolia/models/search/secured_api_key_restrictions.rb +1 -1
- data/lib/algolia/models/search/update_api_key_response.rb +1 -1
- data/lib/algolia/models/search/updated_at_response.rb +1 -1
- data/lib/algolia/models/search/updated_at_with_object_id_response.rb +1 -1
- data/lib/algolia/models/search/updated_rule_response.rb +1 -1
- data/lib/algolia/models/search/user_hit.rb +1 -1
- data/lib/algolia/models/search/user_id.rb +1 -1
- data/lib/algolia/models/usage/error_base.rb +205 -0
- data/lib/algolia/models/usage/get_usage200_response.rb +198 -0
- data/lib/algolia/models/usage/get_usage200_response_statistics_inner.rb +206 -0
- data/lib/algolia/models/usage/get_usage400_response.rb +198 -0
- data/lib/algolia/models/usage/get_usage400_response_error.rb +216 -0
- data/lib/algolia/models/usage/get_usage400_response_error_errors_inner.rb +225 -0
- data/lib/algolia/models/usage/granularity.rb +33 -0
- data/lib/algolia/models/usage/statistic.rb +116 -0
- data/lib/algolia/models/{recommend/promote.rb → usage/statistic_value.rb} +5 -5
- data/lib/algolia/version.rb +1 -1
- metadata +47 -25
- data/lib/algolia/models/recommend/automatic_facet_filter.rb +0 -220
- data/lib/algolia/models/recommend/automatic_facet_filters.rb +0 -97
- data/lib/algolia/models/recommend/consequence_query.rb +0 -97
- data/lib/algolia/models/recommend/promote_object_ids.rb +0 -228
@@ -0,0 +1,208 @@
|
|
1
|
+
# Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
require 'time'
|
5
|
+
|
6
|
+
module Algolia
|
7
|
+
module Recommend
|
8
|
+
# Facet attribute. Only recommendations with the same value (or only recommendations with a different value) as the original viewed item are included.
|
9
|
+
class AutoFacetFilter
|
10
|
+
# Facet attribute.
|
11
|
+
attr_accessor :facet
|
12
|
+
|
13
|
+
# Whether the filter is negative. If true, recommendations must not have the same value for the `facet` attribute. If false, recommendations must have the same value for the `facet` attribute.
|
14
|
+
attr_accessor :negative
|
15
|
+
|
16
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:facet => :facet,
|
20
|
+
:negative => :negative
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
# Returns all the JSON keys this model knows about
|
25
|
+
def self.acceptable_attributes
|
26
|
+
attribute_map.values
|
27
|
+
end
|
28
|
+
|
29
|
+
# Attribute type mapping.
|
30
|
+
def self.types_mapping
|
31
|
+
{
|
32
|
+
:facet => :String,
|
33
|
+
:negative => :Boolean
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# List of attributes with nullable: true
|
38
|
+
def self.openapi_nullable
|
39
|
+
Set.new([])
|
40
|
+
end
|
41
|
+
|
42
|
+
# Initializes the object
|
43
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
44
|
+
def initialize(attributes = {})
|
45
|
+
unless attributes.is_a?(Hash)
|
46
|
+
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::AutoFacetFilter` initialize method"
|
47
|
+
end
|
48
|
+
|
49
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
50
|
+
attributes = attributes.each_with_object({}) do |(k, v), h|
|
51
|
+
unless self.class.attribute_map.key?(k.to_sym)
|
52
|
+
raise ArgumentError,
|
53
|
+
"`#{k}` is not a valid attribute in `Algolia::AutoFacetFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
54
|
+
end
|
55
|
+
|
56
|
+
h[k.to_sym] = v
|
57
|
+
end
|
58
|
+
|
59
|
+
if attributes.key?(:facet)
|
60
|
+
self.facet = attributes[:facet]
|
61
|
+
end
|
62
|
+
|
63
|
+
if attributes.key?(:negative)
|
64
|
+
self.negative = attributes[:negative]
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# Checks equality by comparing each attribute.
|
69
|
+
# @param [Object] Object to be compared
|
70
|
+
def ==(other)
|
71
|
+
return true if equal?(other)
|
72
|
+
|
73
|
+
self.class == other.class &&
|
74
|
+
facet == other.facet &&
|
75
|
+
negative == other.negative
|
76
|
+
end
|
77
|
+
|
78
|
+
# @see the `==` method
|
79
|
+
# @param [Object] Object to be compared
|
80
|
+
def eql?(other)
|
81
|
+
self == other
|
82
|
+
end
|
83
|
+
|
84
|
+
# Calculates hash code according to all attributes.
|
85
|
+
# @return [Integer] Hash code
|
86
|
+
def hash
|
87
|
+
[facet, negative].hash
|
88
|
+
end
|
89
|
+
|
90
|
+
# Builds the object from hash
|
91
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
92
|
+
# @return [Object] Returns the model itself
|
93
|
+
def self.build_from_hash(attributes)
|
94
|
+
return nil unless attributes.is_a?(Hash)
|
95
|
+
|
96
|
+
attributes = attributes.transform_keys(&:to_sym)
|
97
|
+
transformed_hash = {}
|
98
|
+
types_mapping.each_pair do |key, type|
|
99
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
100
|
+
transformed_hash[key.to_sym] = nil
|
101
|
+
elsif type =~ /\AArray<(.*)>/i
|
102
|
+
# check to ensure the input is an array given that the attribute
|
103
|
+
# is documented as an array but the input is not
|
104
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
105
|
+
transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
|
106
|
+
end
|
107
|
+
elsif !attributes[attribute_map[key]].nil?
|
108
|
+
transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
|
109
|
+
end
|
110
|
+
end
|
111
|
+
new(transformed_hash)
|
112
|
+
end
|
113
|
+
|
114
|
+
# Deserializes the data based on type
|
115
|
+
# @param string type Data type
|
116
|
+
# @param string value Value to be deserialized
|
117
|
+
# @return [Object] Deserialized data
|
118
|
+
def self._deserialize(type, value)
|
119
|
+
case type.to_sym
|
120
|
+
when :Time
|
121
|
+
Time.parse(value)
|
122
|
+
when :Date
|
123
|
+
Date.parse(value)
|
124
|
+
when :String
|
125
|
+
value.to_s
|
126
|
+
when :Integer
|
127
|
+
value.to_i
|
128
|
+
when :Float
|
129
|
+
value.to_f
|
130
|
+
when :Boolean
|
131
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
132
|
+
true
|
133
|
+
else
|
134
|
+
false
|
135
|
+
end
|
136
|
+
when :Object
|
137
|
+
# generic object (usually a Hash), return directly
|
138
|
+
value
|
139
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
140
|
+
inner_type = Regexp.last_match[:inner_type]
|
141
|
+
value.map { |v| _deserialize(inner_type, v) }
|
142
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
143
|
+
k_type = Regexp.last_match[:k_type]
|
144
|
+
v_type = Regexp.last_match[:v_type]
|
145
|
+
{}.tap do |hash|
|
146
|
+
value.each do |k, v|
|
147
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
148
|
+
end
|
149
|
+
end
|
150
|
+
else # model
|
151
|
+
# models (e.g. Pet) or oneOf
|
152
|
+
klass = Algolia::Recommend.const_get(type)
|
153
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
# Returns the string representation of the object
|
158
|
+
# @return [String] String presentation of the object
|
159
|
+
def to_s
|
160
|
+
to_hash.to_s
|
161
|
+
end
|
162
|
+
|
163
|
+
# to_body is an alias to to_hash (backward compatibility)
|
164
|
+
# @return [Hash] Returns the object in the form of hash
|
165
|
+
def to_body
|
166
|
+
to_hash
|
167
|
+
end
|
168
|
+
|
169
|
+
def to_json(*_args)
|
170
|
+
to_hash.to_json
|
171
|
+
end
|
172
|
+
|
173
|
+
# Returns the object in the form of hash
|
174
|
+
# @return [Hash] Returns the object in the form of hash
|
175
|
+
def to_hash
|
176
|
+
hash = {}
|
177
|
+
self.class.attribute_map.each_pair do |attr, param|
|
178
|
+
value = send(attr)
|
179
|
+
if value.nil?
|
180
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
181
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
182
|
+
end
|
183
|
+
|
184
|
+
hash[param] = _to_hash(value)
|
185
|
+
end
|
186
|
+
hash
|
187
|
+
end
|
188
|
+
|
189
|
+
# Outputs non-array value in the form of hash
|
190
|
+
# For object, use to_hash. Otherwise, just return the value
|
191
|
+
# @param [Object] value Any valid value
|
192
|
+
# @return [Hash] Returns the value in the form of hash
|
193
|
+
def _to_hash(value)
|
194
|
+
if value.is_a?(Array)
|
195
|
+
value.compact.map { |v| _to_hash(v) }
|
196
|
+
elsif value.is_a?(Hash)
|
197
|
+
{}.tap do |hash|
|
198
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
199
|
+
end
|
200
|
+
elsif value.respond_to? :to_hash
|
201
|
+
value.to_hash
|
202
|
+
else
|
203
|
+
value
|
204
|
+
end
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
@@ -6,21 +6,24 @@ require 'time'
|
|
6
6
|
module Algolia
|
7
7
|
module Recommend
|
8
8
|
class BaseRecommendRequest
|
9
|
-
# Index name.
|
9
|
+
# Index name (case-sensitive).
|
10
10
|
attr_accessor :index_name
|
11
11
|
|
12
|
-
#
|
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.
|
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
|
# Attribute mapping from ruby-style variable name to JSON key.
|
19
21
|
def self.attribute_map
|
20
22
|
{
|
21
23
|
:index_name => :indexName,
|
22
24
|
:threshold => :threshold,
|
23
|
-
:max_recommendations => :maxRecommendations
|
25
|
+
:max_recommendations => :maxRecommendations,
|
26
|
+
:query_parameters => :queryParameters
|
24
27
|
}
|
25
28
|
end
|
26
29
|
|
@@ -33,8 +36,9 @@ module Algolia
|
|
33
36
|
def self.types_mapping
|
34
37
|
{
|
35
38
|
:index_name => :String,
|
36
|
-
:threshold => :
|
37
|
-
:max_recommendations => :Integer
|
39
|
+
:threshold => :Float,
|
40
|
+
:max_recommendations => :Integer,
|
41
|
+
:query_parameters => :SearchParams
|
38
42
|
}
|
39
43
|
end
|
40
44
|
|
@@ -68,11 +72,17 @@ module Algolia
|
|
68
72
|
|
69
73
|
if attributes.key?(:threshold)
|
70
74
|
self.threshold = attributes[:threshold]
|
75
|
+
else
|
76
|
+
self.threshold = nil
|
71
77
|
end
|
72
78
|
|
73
79
|
if attributes.key?(:max_recommendations)
|
74
80
|
self.max_recommendations = attributes[:max_recommendations]
|
75
81
|
end
|
82
|
+
|
83
|
+
if attributes.key?(:query_parameters)
|
84
|
+
self.query_parameters = attributes[:query_parameters]
|
85
|
+
end
|
76
86
|
end
|
77
87
|
|
78
88
|
# Custom attribute writer method with validation
|
@@ -93,6 +103,24 @@ module Algolia
|
|
93
103
|
@threshold = threshold
|
94
104
|
end
|
95
105
|
|
106
|
+
# Custom attribute writer method with validation
|
107
|
+
# @param [Object] max_recommendations Value to be assigned
|
108
|
+
def max_recommendations=(max_recommendations)
|
109
|
+
if max_recommendations.nil?
|
110
|
+
raise ArgumentError, 'max_recommendations cannot be nil'
|
111
|
+
end
|
112
|
+
|
113
|
+
if max_recommendations > 1000
|
114
|
+
raise ArgumentError, 'invalid value for "max_recommendations", must be smaller than or equal to 1000.'
|
115
|
+
end
|
116
|
+
|
117
|
+
if max_recommendations < 1
|
118
|
+
raise ArgumentError, 'invalid value for "max_recommendations", must be greater than or equal to 1.'
|
119
|
+
end
|
120
|
+
|
121
|
+
@max_recommendations = max_recommendations
|
122
|
+
end
|
123
|
+
|
96
124
|
# Checks equality by comparing each attribute.
|
97
125
|
# @param [Object] Object to be compared
|
98
126
|
def ==(other)
|
@@ -101,7 +129,8 @@ module Algolia
|
|
101
129
|
self.class == other.class &&
|
102
130
|
index_name == other.index_name &&
|
103
131
|
threshold == other.threshold &&
|
104
|
-
max_recommendations == other.max_recommendations
|
132
|
+
max_recommendations == other.max_recommendations &&
|
133
|
+
query_parameters == other.query_parameters
|
105
134
|
end
|
106
135
|
|
107
136
|
# @see the `==` method
|
@@ -113,7 +142,7 @@ module Algolia
|
|
113
142
|
# Calculates hash code according to all attributes.
|
114
143
|
# @return [Integer] Hash code
|
115
144
|
def hash
|
116
|
-
[index_name, threshold, max_recommendations].hash
|
145
|
+
[index_name, threshold, max_recommendations, query_parameters].hash
|
117
146
|
end
|
118
147
|
|
119
148
|
# 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
|
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
|
@@ -26,7 +26,7 @@ module Algolia
|
|
26
26
|
# 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).
|
27
27
|
attr_accessor :sum_or_filters_scores
|
28
28
|
|
29
|
-
# Restricts a search to a subset of your searchable attributes.
|
29
|
+
# Restricts a search to a subset of your searchable attributes. Attribute names are case-sensitive.
|
30
30
|
attr_accessor :restrict_searchable_attributes
|
31
31
|
|
32
32
|
# 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).
|
@@ -60,7 +60,7 @@ module Algolia
|
|
60
60
|
# 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).
|
61
61
|
attr_accessor :inside_bounding_box
|
62
62
|
|
63
|
-
# 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
|
63
|
+
# 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`.
|
64
64
|
attr_accessor :inside_polygon
|
65
65
|
|
66
66
|
# 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`.
|
@@ -163,7 +163,7 @@ module Algolia
|
|
163
163
|
:minimum_around_radius => :Integer,
|
164
164
|
:inside_bounding_box => :'Array<Array<Float>>',
|
165
165
|
:inside_polygon => :'Array<Array<Float>>',
|
166
|
-
:natural_languages => :'Array<
|
166
|
+
:natural_languages => :'Array<SupportedLanguage>',
|
167
167
|
:rule_contexts => :'Array<String>',
|
168
168
|
:personalization_impact => :Integer,
|
169
169
|
:user_token => :String,
|
@@ -9,7 +9,7 @@ module Algolia
|
|
9
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
|
12
|
+
# 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
13
|
attr_accessor :filters
|
14
14
|
|
15
15
|
attr_accessor :facet_filters
|
@@ -23,7 +23,7 @@ module Algolia
|
|
23
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 search to a subset of your searchable attributes.
|
26
|
+
# Restricts a search to a subset of your searchable attributes. Attribute names are case-sensitive.
|
27
27
|
attr_accessor :restrict_searchable_attributes
|
28
28
|
|
29
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).
|
@@ -57,7 +57,7 @@ module Algolia
|
|
57
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
|
-
# 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
|
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
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`.
|
@@ -158,7 +158,7 @@ module Algolia
|
|
158
158
|
:minimum_around_radius => :Integer,
|
159
159
|
:inside_bounding_box => :'Array<Array<Float>>',
|
160
160
|
:inside_polygon => :'Array<Array<Float>>',
|
161
|
-
:natural_languages => :'Array<
|
161
|
+
:natural_languages => :'Array<SupportedLanguage>',
|
162
162
|
:rule_contexts => :'Array<String>',
|
163
163
|
:personalization_impact => :Integer,
|
164
164
|
:user_token => :String,
|