algolia 3.0.0.alpha.15 → 3.0.0.alpha.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.openapi-generator/FILES +10 -167
- data/CHANGELOG.md +14 -0
- data/Gemfile.lock +1 -1
- data/lib/algolia/api/analytics_client.rb +76 -76
- data/lib/algolia/api/ingestion_client.rb +267 -196
- data/lib/algolia/api/monitoring_client.rb +49 -49
- data/lib/algolia/api/query_suggestions_client.rb +14 -14
- 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/analytics/get_status_response.rb +1 -1
- data/lib/algolia/models/ingestion/auth_algolia.rb +3 -2
- 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_algolia_partial.rb +3 -2
- data/lib/algolia/models/ingestion/auth_api_key.rb +2 -1
- data/lib/algolia/models/ingestion/auth_api_key_partial.rb +2 -1
- data/lib/algolia/models/ingestion/auth_basic.rb +3 -1
- data/lib/algolia/models/ingestion/auth_basic_partial.rb +3 -1
- data/lib/algolia/models/ingestion/auth_google_service_account.rb +3 -3
- data/lib/algolia/models/ingestion/auth_google_service_account_partial.rb +3 -3
- 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/auth_o_auth.rb +18 -8
- data/lib/algolia/models/ingestion/auth_o_auth_partial.rb +18 -8
- data/lib/algolia/models/ingestion/authentication.rb +5 -5
- data/lib/algolia/models/ingestion/authentication_create.rb +2 -2
- data/lib/algolia/models/ingestion/authentication_create_response.rb +4 -4
- data/lib/algolia/models/ingestion/authentication_search.rb +1 -1
- data/lib/algolia/models/ingestion/authentication_type.rb +2 -1
- data/lib/algolia/models/ingestion/authentication_update.rb +2 -2
- data/lib/algolia/models/ingestion/authentication_update_response.rb +4 -4
- data/lib/algolia/models/ingestion/big_commerce_channel.rb +2 -2
- data/lib/algolia/models/ingestion/big_commerce_metafield.rb +2 -2
- data/lib/algolia/models/ingestion/commercetools_custom_fields.rb +1 -1
- data/lib/algolia/models/ingestion/delete_response.rb +1 -1
- data/lib/algolia/models/ingestion/destination.rb +6 -6
- data/lib/algolia/models/ingestion/destination_create.rb +3 -3
- data/lib/algolia/models/ingestion/destination_create_response.rb +4 -4
- data/lib/algolia/models/ingestion/destination_index_name.rb +2 -2
- data/lib/algolia/models/ingestion/destination_index_prefix.rb +1 -1
- data/lib/algolia/models/ingestion/destination_search.rb +1 -1
- data/lib/algolia/models/ingestion/destination_type.rb +1 -2
- data/lib/algolia/models/ingestion/destination_update.rb +3 -3
- data/lib/algolia/models/ingestion/destination_update_response.rb +4 -4
- data/lib/algolia/models/ingestion/docker_source_discover.rb +2 -2
- data/lib/algolia/models/ingestion/event.rb +3 -3
- data/lib/algolia/models/ingestion/list_tasks_response.rb +1 -1
- data/lib/algolia/models/ingestion/mapping_format_schema.rb +32 -0
- data/lib/algolia/models/ingestion/mapping_input.rb +24 -3
- data/lib/algolia/models/ingestion/on_demand_date_utils_input.rb +3 -3
- data/lib/algolia/models/ingestion/on_demand_trigger.rb +2 -2
- data/lib/algolia/models/ingestion/on_demand_trigger_input.rb +1 -1
- data/lib/algolia/models/ingestion/pagination.rb +65 -0
- data/lib/algolia/models/ingestion/platform.rb +2 -1
- data/lib/algolia/models/ingestion/run.rb +7 -7
- data/lib/algolia/models/ingestion/run_response.rb +3 -3
- data/lib/algolia/models/ingestion/schedule_date_utils_input.rb +2 -2
- data/lib/algolia/models/ingestion/schedule_trigger.rb +4 -4
- data/lib/algolia/models/ingestion/schedule_trigger_input.rb +2 -2
- data/lib/algolia/models/ingestion/source.rb +4 -4
- data/lib/algolia/models/ingestion/source_big_commerce.rb +1 -1
- data/lib/algolia/models/ingestion/source_big_query.rb +5 -5
- data/lib/algolia/models/ingestion/source_commercetools.rb +2 -2
- data/lib/algolia/models/ingestion/source_create.rb +2 -1
- data/lib/algolia/models/ingestion/source_create_response.rb +3 -2
- data/lib/algolia/models/ingestion/source_csv.rb +3 -3
- data/lib/algolia/models/ingestion/source_docker.rb +3 -3
- data/lib/algolia/models/ingestion/source_ga4_big_query_export.rb +3 -3
- data/lib/algolia/models/ingestion/source_json.rb +2 -2
- data/lib/algolia/models/ingestion/source_type.rb +5 -3
- data/lib/algolia/models/ingestion/source_update.rb +2 -1
- data/lib/algolia/models/ingestion/source_update_commercetools.rb +2 -3
- data/lib/algolia/models/ingestion/source_update_docker.rb +3 -3
- data/lib/algolia/models/ingestion/source_update_response.rb +3 -2
- data/lib/algolia/models/ingestion/streaming_trigger.rb +1 -1
- data/lib/algolia/models/ingestion/streaming_utils_input.rb +1 -1
- data/lib/algolia/models/ingestion/subscription_trigger.rb +1 -1
- data/lib/algolia/models/ingestion/task.rb +7 -7
- data/lib/algolia/models/ingestion/task_create.rb +5 -5
- data/lib/algolia/models/ingestion/task_create_response.rb +3 -3
- data/lib/algolia/models/ingestion/task_input.rb +1 -0
- data/lib/algolia/models/ingestion/task_update.rb +4 -4
- data/lib/algolia/models/ingestion/task_update_response.rb +3 -3
- data/lib/algolia/models/ingestion/trigger.rb +1 -0
- data/lib/algolia/models/ingestion/trigger_update_input.rb +2 -2
- data/lib/algolia/models/ingestion/window.rb +3 -3
- data/lib/algolia/models/insights/added_to_cart_object_ids.rb +1 -1
- data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +1 -1
- data/lib/algolia/models/insights/clicked_filters.rb +1 -1
- data/lib/algolia/models/insights/clicked_object_ids.rb +1 -1
- data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +1 -1
- data/lib/algolia/models/insights/converted_filters.rb +1 -1
- data/lib/algolia/models/insights/converted_object_ids.rb +1 -1
- data/lib/algolia/models/insights/converted_object_ids_after_search.rb +1 -1
- data/lib/algolia/models/insights/purchased_object_ids.rb +1 -1
- data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +3 -1
- data/lib/algolia/models/insights/viewed_filters.rb +1 -1
- data/lib/algolia/models/insights/viewed_object_ids.rb +1 -1
- data/lib/algolia/models/monitoring/{get_inventory403_response.rb → get_servers403_response.rb} +3 -3
- 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/server.rb +2 -2
- data/lib/algolia/models/monitoring/time_inner.rb +1 -1
- data/lib/algolia/models/query-suggestions/app_id.rb +197 -0
- data/lib/algolia/models/query-suggestions/get_config_status200_response.rb +4 -4
- data/lib/algolia/models/query-suggestions/get_log_file200_response.rb +2 -2
- data/lib/algolia/models/query-suggestions/languages.rb +1 -1
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration.rb +2 -3
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration_response.rb +23 -34
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration_with_index.rb +18 -20
- data/lib/algolia/models/query-suggestions/source_index.rb +3 -5
- data/lib/algolia/models/recommend/auto_facet_filter.rb +208 -0
- data/lib/algolia/models/recommend/base_recommend_request.rb +36 -7
- data/lib/algolia/models/recommend/base_search_params.rb +1 -1
- data/lib/algolia/models/recommend/base_search_params_without_query.rb +1 -1
- 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} +9 -12
- 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 +5 -5
- 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/{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 +35 -15
- 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} +39 -19
- data/lib/algolia/models/recommend/{consequence_params.rb → search_params.rb} +25 -44
- data/lib/algolia/models/recommend/search_params_object.rb +6 -6
- 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 +50 -10
- data/lib/algolia/models/recommend/{base_trending_items_query.rb → trending_items.rb} +12 -15
- data/lib/algolia/models/recommend/trending_items_query.rb +42 -16
- 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 +4 -4
- data/lib/algolia/models/search/base_search_params.rb +1 -1
- data/lib/algolia/models/search/base_search_params_without_query.rb +1 -1
- data/lib/algolia/models/search/browse_params_object.rb +6 -6
- data/lib/algolia/models/search/consequence_params.rb +6 -6
- 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 +1 -1
- 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 +9 -9
- data/lib/algolia/models/search/index_settings_as_search_params.rb +5 -5
- data/lib/algolia/models/search/log.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 +6 -6
- data/lib/algolia/models/search/search_for_hits.rb +6 -6
- data/lib/algolia/models/search/search_params_object.rb +6 -6
- 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/{recommend/base_recommended_for_you_query_parameters.rb → usage/get_usage400_response.rb} +13 -14
- 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 +37 -26
- 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,243 @@
|
|
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
|
+
class TrendingFacets
|
9
|
+
# Facet attribute for which to retrieve trending facet values.
|
10
|
+
attr_accessor :facet_name
|
11
|
+
|
12
|
+
attr_accessor :model
|
13
|
+
|
14
|
+
attr_accessor :fallback_parameters
|
15
|
+
|
16
|
+
class EnumAttributeValidator
|
17
|
+
attr_reader :datatype
|
18
|
+
attr_reader :allowable_values
|
19
|
+
|
20
|
+
def initialize(datatype, allowable_values)
|
21
|
+
@allowable_values = allowable_values.map do |value|
|
22
|
+
case datatype.to_s
|
23
|
+
when /Integer/i
|
24
|
+
value.to_i
|
25
|
+
when /Float/i
|
26
|
+
value.to_f
|
27
|
+
else
|
28
|
+
value
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def valid?(value)
|
34
|
+
!value || allowable_values.include?(value)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
39
|
+
def self.attribute_map
|
40
|
+
{
|
41
|
+
:facet_name => :facetName,
|
42
|
+
:model => :model,
|
43
|
+
:fallback_parameters => :fallbackParameters
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
# Returns all the JSON keys this model knows about
|
48
|
+
def self.acceptable_attributes
|
49
|
+
attribute_map.values
|
50
|
+
end
|
51
|
+
|
52
|
+
# Attribute type mapping.
|
53
|
+
def self.types_mapping
|
54
|
+
{
|
55
|
+
:facet_name => :Object,
|
56
|
+
:model => :TrendingFacetsModel,
|
57
|
+
:fallback_parameters => :FallbackParams
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
# List of attributes with nullable: true
|
62
|
+
def self.openapi_nullable
|
63
|
+
Set.new([
|
64
|
+
:facet_name
|
65
|
+
])
|
66
|
+
end
|
67
|
+
|
68
|
+
# Initializes the object
|
69
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
70
|
+
def initialize(attributes = {})
|
71
|
+
unless attributes.is_a?(Hash)
|
72
|
+
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::TrendingFacets` initialize method"
|
73
|
+
end
|
74
|
+
|
75
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
76
|
+
attributes = attributes.each_with_object({}) do |(k, v), h|
|
77
|
+
unless self.class.attribute_map.key?(k.to_sym)
|
78
|
+
raise ArgumentError,
|
79
|
+
"`#{k}` is not a valid attribute in `Algolia::TrendingFacets`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
80
|
+
end
|
81
|
+
|
82
|
+
h[k.to_sym] = v
|
83
|
+
end
|
84
|
+
|
85
|
+
if attributes.key?(:facet_name)
|
86
|
+
self.facet_name = attributes[:facet_name]
|
87
|
+
else
|
88
|
+
self.facet_name = nil
|
89
|
+
end
|
90
|
+
|
91
|
+
if attributes.key?(:model)
|
92
|
+
self.model = attributes[:model]
|
93
|
+
else
|
94
|
+
self.model = nil
|
95
|
+
end
|
96
|
+
|
97
|
+
if attributes.key?(:fallback_parameters)
|
98
|
+
self.fallback_parameters = attributes[:fallback_parameters]
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
# Checks equality by comparing each attribute.
|
103
|
+
# @param [Object] Object to be compared
|
104
|
+
def ==(other)
|
105
|
+
return true if equal?(other)
|
106
|
+
|
107
|
+
self.class == other.class &&
|
108
|
+
facet_name == other.facet_name &&
|
109
|
+
model == other.model &&
|
110
|
+
fallback_parameters == other.fallback_parameters
|
111
|
+
end
|
112
|
+
|
113
|
+
# @see the `==` method
|
114
|
+
# @param [Object] Object to be compared
|
115
|
+
def eql?(other)
|
116
|
+
self == other
|
117
|
+
end
|
118
|
+
|
119
|
+
# Calculates hash code according to all attributes.
|
120
|
+
# @return [Integer] Hash code
|
121
|
+
def hash
|
122
|
+
[facet_name, model, fallback_parameters].hash
|
123
|
+
end
|
124
|
+
|
125
|
+
# Builds the object from hash
|
126
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
127
|
+
# @return [Object] Returns the model itself
|
128
|
+
def self.build_from_hash(attributes)
|
129
|
+
return nil unless attributes.is_a?(Hash)
|
130
|
+
|
131
|
+
attributes = attributes.transform_keys(&:to_sym)
|
132
|
+
transformed_hash = {}
|
133
|
+
types_mapping.each_pair do |key, type|
|
134
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
135
|
+
transformed_hash[key.to_sym] = nil
|
136
|
+
elsif type =~ /\AArray<(.*)>/i
|
137
|
+
# check to ensure the input is an array given that the attribute
|
138
|
+
# is documented as an array but the input is not
|
139
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
140
|
+
transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
|
141
|
+
end
|
142
|
+
elsif !attributes[attribute_map[key]].nil?
|
143
|
+
transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
|
144
|
+
end
|
145
|
+
end
|
146
|
+
new(transformed_hash)
|
147
|
+
end
|
148
|
+
|
149
|
+
# Deserializes the data based on type
|
150
|
+
# @param string type Data type
|
151
|
+
# @param string value Value to be deserialized
|
152
|
+
# @return [Object] Deserialized data
|
153
|
+
def self._deserialize(type, value)
|
154
|
+
case type.to_sym
|
155
|
+
when :Time
|
156
|
+
Time.parse(value)
|
157
|
+
when :Date
|
158
|
+
Date.parse(value)
|
159
|
+
when :String
|
160
|
+
value.to_s
|
161
|
+
when :Integer
|
162
|
+
value.to_i
|
163
|
+
when :Float
|
164
|
+
value.to_f
|
165
|
+
when :Boolean
|
166
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
167
|
+
true
|
168
|
+
else
|
169
|
+
false
|
170
|
+
end
|
171
|
+
when :Object
|
172
|
+
# generic object (usually a Hash), return directly
|
173
|
+
value
|
174
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
175
|
+
inner_type = Regexp.last_match[:inner_type]
|
176
|
+
value.map { |v| _deserialize(inner_type, v) }
|
177
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
178
|
+
k_type = Regexp.last_match[:k_type]
|
179
|
+
v_type = Regexp.last_match[:v_type]
|
180
|
+
{}.tap do |hash|
|
181
|
+
value.each do |k, v|
|
182
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
else # model
|
186
|
+
# models (e.g. Pet) or oneOf
|
187
|
+
klass = Algolia::Recommend.const_get(type)
|
188
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
# Returns the string representation of the object
|
193
|
+
# @return [String] String presentation of the object
|
194
|
+
def to_s
|
195
|
+
to_hash.to_s
|
196
|
+
end
|
197
|
+
|
198
|
+
# to_body is an alias to to_hash (backward compatibility)
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
200
|
+
def to_body
|
201
|
+
to_hash
|
202
|
+
end
|
203
|
+
|
204
|
+
def to_json(*_args)
|
205
|
+
to_hash.to_json
|
206
|
+
end
|
207
|
+
|
208
|
+
# Returns the object in the form of hash
|
209
|
+
# @return [Hash] Returns the object in the form of hash
|
210
|
+
def to_hash
|
211
|
+
hash = {}
|
212
|
+
self.class.attribute_map.each_pair do |attr, param|
|
213
|
+
value = send(attr)
|
214
|
+
if value.nil?
|
215
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
216
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
217
|
+
end
|
218
|
+
|
219
|
+
hash[param] = _to_hash(value)
|
220
|
+
end
|
221
|
+
hash
|
222
|
+
end
|
223
|
+
|
224
|
+
# Outputs non-array value in the form of hash
|
225
|
+
# For object, use to_hash. Otherwise, just return the value
|
226
|
+
# @param [Object] value Any valid value
|
227
|
+
# @return [Hash] Returns the value in the form of hash
|
228
|
+
def _to_hash(value)
|
229
|
+
if value.is_a?(Array)
|
230
|
+
value.compact.map { |v| _to_hash(v) }
|
231
|
+
elsif value.is_a?(Hash)
|
232
|
+
{}.tap do |hash|
|
233
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
234
|
+
end
|
235
|
+
elsif value.respond_to? :to_hash
|
236
|
+
value.to_hash
|
237
|
+
else
|
238
|
+
value
|
239
|
+
end
|
240
|
+
end
|
241
|
+
end
|
242
|
+
end
|
243
|
+
end
|
@@ -9,17 +9,21 @@ module Algolia
|
|
9
9
|
# Index name.
|
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
|
-
|
18
|
+
attr_accessor :query_parameters
|
19
|
+
|
20
|
+
# Facet attribute for which to retrieve trending facet values.
|
19
21
|
attr_accessor :facet_name
|
20
22
|
|
21
23
|
attr_accessor :model
|
22
24
|
|
25
|
+
attr_accessor :fallback_parameters
|
26
|
+
|
23
27
|
class EnumAttributeValidator
|
24
28
|
attr_reader :datatype
|
25
29
|
attr_reader :allowable_values
|
@@ -48,8 +52,10 @@ module Algolia
|
|
48
52
|
:index_name => :indexName,
|
49
53
|
:threshold => :threshold,
|
50
54
|
:max_recommendations => :maxRecommendations,
|
55
|
+
:query_parameters => :queryParameters,
|
51
56
|
:facet_name => :facetName,
|
52
|
-
:model => :model
|
57
|
+
:model => :model,
|
58
|
+
:fallback_parameters => :fallbackParameters
|
53
59
|
}
|
54
60
|
end
|
55
61
|
|
@@ -62,10 +68,12 @@ module Algolia
|
|
62
68
|
def self.types_mapping
|
63
69
|
{
|
64
70
|
:index_name => :String,
|
65
|
-
:threshold => :
|
71
|
+
:threshold => :Float,
|
66
72
|
:max_recommendations => :Integer,
|
67
|
-
:
|
68
|
-
:
|
73
|
+
:query_parameters => :SearchParams,
|
74
|
+
:facet_name => :Object,
|
75
|
+
:model => :TrendingFacetsModel,
|
76
|
+
:fallback_parameters => :FallbackParams
|
69
77
|
}
|
70
78
|
end
|
71
79
|
|
@@ -78,7 +86,7 @@ module Algolia
|
|
78
86
|
def self.openapi_all_of
|
79
87
|
[
|
80
88
|
:BaseRecommendRequest,
|
81
|
-
:
|
89
|
+
:TrendingFacets
|
82
90
|
]
|
83
91
|
end
|
84
92
|
|
@@ -107,12 +115,18 @@ module Algolia
|
|
107
115
|
|
108
116
|
if attributes.key?(:threshold)
|
109
117
|
self.threshold = attributes[:threshold]
|
118
|
+
else
|
119
|
+
self.threshold = nil
|
110
120
|
end
|
111
121
|
|
112
122
|
if attributes.key?(:max_recommendations)
|
113
123
|
self.max_recommendations = attributes[:max_recommendations]
|
114
124
|
end
|
115
125
|
|
126
|
+
if attributes.key?(:query_parameters)
|
127
|
+
self.query_parameters = attributes[:query_parameters]
|
128
|
+
end
|
129
|
+
|
116
130
|
if attributes.key?(:facet_name)
|
117
131
|
self.facet_name = attributes[:facet_name]
|
118
132
|
else
|
@@ -121,6 +135,12 @@ module Algolia
|
|
121
135
|
|
122
136
|
if attributes.key?(:model)
|
123
137
|
self.model = attributes[:model]
|
138
|
+
else
|
139
|
+
self.model = nil
|
140
|
+
end
|
141
|
+
|
142
|
+
if attributes.key?(:fallback_parameters)
|
143
|
+
self.fallback_parameters = attributes[:fallback_parameters]
|
124
144
|
end
|
125
145
|
end
|
126
146
|
|
@@ -142,6 +162,24 @@ module Algolia
|
|
142
162
|
@threshold = threshold
|
143
163
|
end
|
144
164
|
|
165
|
+
# Custom attribute writer method with validation
|
166
|
+
# @param [Object] max_recommendations Value to be assigned
|
167
|
+
def max_recommendations=(max_recommendations)
|
168
|
+
if max_recommendations.nil?
|
169
|
+
raise ArgumentError, 'max_recommendations cannot be nil'
|
170
|
+
end
|
171
|
+
|
172
|
+
if max_recommendations > 1000
|
173
|
+
raise ArgumentError, 'invalid value for "max_recommendations", must be smaller than or equal to 1000.'
|
174
|
+
end
|
175
|
+
|
176
|
+
if max_recommendations < 1
|
177
|
+
raise ArgumentError, 'invalid value for "max_recommendations", must be greater than or equal to 1.'
|
178
|
+
end
|
179
|
+
|
180
|
+
@max_recommendations = max_recommendations
|
181
|
+
end
|
182
|
+
|
145
183
|
# Checks equality by comparing each attribute.
|
146
184
|
# @param [Object] Object to be compared
|
147
185
|
def ==(other)
|
@@ -151,8 +189,10 @@ module Algolia
|
|
151
189
|
index_name == other.index_name &&
|
152
190
|
threshold == other.threshold &&
|
153
191
|
max_recommendations == other.max_recommendations &&
|
192
|
+
query_parameters == other.query_parameters &&
|
154
193
|
facet_name == other.facet_name &&
|
155
|
-
model == other.model
|
194
|
+
model == other.model &&
|
195
|
+
fallback_parameters == other.fallback_parameters
|
156
196
|
end
|
157
197
|
|
158
198
|
# @see the `==` method
|
@@ -164,7 +204,7 @@ module Algolia
|
|
164
204
|
# Calculates hash code according to all attributes.
|
165
205
|
# @return [Integer] Hash code
|
166
206
|
def hash
|
167
|
-
[index_name, threshold, max_recommendations, facet_name, model].hash
|
207
|
+
[index_name, threshold, max_recommendations, query_parameters, facet_name, model, fallback_parameters].hash
|
168
208
|
end
|
169
209
|
|
170
210
|
# Builds the object from hash
|
@@ -5,17 +5,15 @@ require 'time'
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Recommend
|
8
|
-
class
|
9
|
-
# Facet
|
8
|
+
class TrendingItems
|
9
|
+
# Facet attribute. To be used in combination with `facetValue`. If specified, only recommendations matching the facet filter will be returned.
|
10
10
|
attr_accessor :facet_name
|
11
11
|
|
12
|
-
# Facet value
|
12
|
+
# Facet value. To be used in combination with `facetName`. If specified, only recommendations matching the facet filter will be returned.
|
13
13
|
attr_accessor :facet_value
|
14
14
|
|
15
15
|
attr_accessor :model
|
16
16
|
|
17
|
-
attr_accessor :query_parameters
|
18
|
-
|
19
17
|
attr_accessor :fallback_parameters
|
20
18
|
|
21
19
|
class EnumAttributeValidator
|
@@ -46,7 +44,6 @@ module Algolia
|
|
46
44
|
:facet_name => :facetName,
|
47
45
|
:facet_value => :facetValue,
|
48
46
|
:model => :model,
|
49
|
-
:query_parameters => :queryParameters,
|
50
47
|
:fallback_parameters => :fallbackParameters
|
51
48
|
}
|
52
49
|
end
|
@@ -62,7 +59,6 @@ module Algolia
|
|
62
59
|
:facet_name => :String,
|
63
60
|
:facet_value => :String,
|
64
61
|
:model => :TrendingItemsModel,
|
65
|
-
:query_parameters => :SearchParamsObject,
|
66
62
|
:fallback_parameters => :SearchParamsObject
|
67
63
|
}
|
68
64
|
end
|
@@ -76,14 +72,14 @@ module Algolia
|
|
76
72
|
# @param [Hash] attributes Model attributes in the form of hash
|
77
73
|
def initialize(attributes = {})
|
78
74
|
unless attributes.is_a?(Hash)
|
79
|
-
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::
|
75
|
+
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::TrendingItems` initialize method"
|
80
76
|
end
|
81
77
|
|
82
78
|
# check to see if the attribute exists and convert string to symbol for hash key
|
83
79
|
attributes = attributes.each_with_object({}) do |(k, v), h|
|
84
80
|
unless self.class.attribute_map.key?(k.to_sym)
|
85
81
|
raise ArgumentError,
|
86
|
-
"`#{k}` is not a valid attribute in `Algolia::
|
82
|
+
"`#{k}` is not a valid attribute in `Algolia::TrendingItems`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
87
83
|
end
|
88
84
|
|
89
85
|
h[k.to_sym] = v
|
@@ -91,18 +87,20 @@ module Algolia
|
|
91
87
|
|
92
88
|
if attributes.key?(:facet_name)
|
93
89
|
self.facet_name = attributes[:facet_name]
|
90
|
+
else
|
91
|
+
self.facet_name = nil
|
94
92
|
end
|
95
93
|
|
96
94
|
if attributes.key?(:facet_value)
|
97
95
|
self.facet_value = attributes[:facet_value]
|
96
|
+
else
|
97
|
+
self.facet_value = nil
|
98
98
|
end
|
99
99
|
|
100
100
|
if attributes.key?(:model)
|
101
101
|
self.model = attributes[:model]
|
102
|
-
|
103
|
-
|
104
|
-
if attributes.key?(:query_parameters)
|
105
|
-
self.query_parameters = attributes[:query_parameters]
|
102
|
+
else
|
103
|
+
self.model = nil
|
106
104
|
end
|
107
105
|
|
108
106
|
if attributes.key?(:fallback_parameters)
|
@@ -119,7 +117,6 @@ module Algolia
|
|
119
117
|
facet_name == other.facet_name &&
|
120
118
|
facet_value == other.facet_value &&
|
121
119
|
model == other.model &&
|
122
|
-
query_parameters == other.query_parameters &&
|
123
120
|
fallback_parameters == other.fallback_parameters
|
124
121
|
end
|
125
122
|
|
@@ -132,7 +129,7 @@ module Algolia
|
|
132
129
|
# Calculates hash code according to all attributes.
|
133
130
|
# @return [Integer] Hash code
|
134
131
|
def hash
|
135
|
-
[facet_name, facet_value, model,
|
132
|
+
[facet_name, facet_value, model, fallback_parameters].hash
|
136
133
|
end
|
137
134
|
|
138
135
|
# Builds the object from hash
|
@@ -9,22 +9,22 @@ module Algolia
|
|
9
9
|
# Index name.
|
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
|
-
|
18
|
+
attr_accessor :query_parameters
|
19
|
+
|
20
|
+
# Facet attribute. To be used in combination with `facetValue`. If specified, only recommendations matching the facet filter will be returned.
|
19
21
|
attr_accessor :facet_name
|
20
22
|
|
21
|
-
# Facet value
|
23
|
+
# Facet value. To be used in combination with `facetName`. If specified, only recommendations matching the facet filter will be returned.
|
22
24
|
attr_accessor :facet_value
|
23
25
|
|
24
26
|
attr_accessor :model
|
25
27
|
|
26
|
-
attr_accessor :query_parameters
|
27
|
-
|
28
28
|
attr_accessor :fallback_parameters
|
29
29
|
|
30
30
|
class EnumAttributeValidator
|
@@ -55,10 +55,10 @@ module Algolia
|
|
55
55
|
:index_name => :indexName,
|
56
56
|
:threshold => :threshold,
|
57
57
|
:max_recommendations => :maxRecommendations,
|
58
|
+
:query_parameters => :queryParameters,
|
58
59
|
:facet_name => :facetName,
|
59
60
|
:facet_value => :facetValue,
|
60
61
|
:model => :model,
|
61
|
-
:query_parameters => :queryParameters,
|
62
62
|
:fallback_parameters => :fallbackParameters
|
63
63
|
}
|
64
64
|
end
|
@@ -72,12 +72,12 @@ module Algolia
|
|
72
72
|
def self.types_mapping
|
73
73
|
{
|
74
74
|
:index_name => :String,
|
75
|
-
:threshold => :
|
75
|
+
:threshold => :Float,
|
76
76
|
:max_recommendations => :Integer,
|
77
|
+
:query_parameters => :SearchParams,
|
77
78
|
:facet_name => :String,
|
78
79
|
:facet_value => :String,
|
79
80
|
:model => :TrendingItemsModel,
|
80
|
-
:query_parameters => :SearchParamsObject,
|
81
81
|
:fallback_parameters => :SearchParamsObject
|
82
82
|
}
|
83
83
|
end
|
@@ -91,7 +91,7 @@ module Algolia
|
|
91
91
|
def self.openapi_all_of
|
92
92
|
[
|
93
93
|
:BaseRecommendRequest,
|
94
|
-
:
|
94
|
+
:TrendingItems
|
95
95
|
]
|
96
96
|
end
|
97
97
|
|
@@ -120,26 +120,34 @@ module Algolia
|
|
120
120
|
|
121
121
|
if attributes.key?(:threshold)
|
122
122
|
self.threshold = attributes[:threshold]
|
123
|
+
else
|
124
|
+
self.threshold = nil
|
123
125
|
end
|
124
126
|
|
125
127
|
if attributes.key?(:max_recommendations)
|
126
128
|
self.max_recommendations = attributes[:max_recommendations]
|
127
129
|
end
|
128
130
|
|
131
|
+
if attributes.key?(:query_parameters)
|
132
|
+
self.query_parameters = attributes[:query_parameters]
|
133
|
+
end
|
134
|
+
|
129
135
|
if attributes.key?(:facet_name)
|
130
136
|
self.facet_name = attributes[:facet_name]
|
137
|
+
else
|
138
|
+
self.facet_name = nil
|
131
139
|
end
|
132
140
|
|
133
141
|
if attributes.key?(:facet_value)
|
134
142
|
self.facet_value = attributes[:facet_value]
|
143
|
+
else
|
144
|
+
self.facet_value = nil
|
135
145
|
end
|
136
146
|
|
137
147
|
if attributes.key?(:model)
|
138
148
|
self.model = attributes[:model]
|
139
|
-
|
140
|
-
|
141
|
-
if attributes.key?(:query_parameters)
|
142
|
-
self.query_parameters = attributes[:query_parameters]
|
149
|
+
else
|
150
|
+
self.model = nil
|
143
151
|
end
|
144
152
|
|
145
153
|
if attributes.key?(:fallback_parameters)
|
@@ -165,6 +173,24 @@ module Algolia
|
|
165
173
|
@threshold = threshold
|
166
174
|
end
|
167
175
|
|
176
|
+
# Custom attribute writer method with validation
|
177
|
+
# @param [Object] max_recommendations Value to be assigned
|
178
|
+
def max_recommendations=(max_recommendations)
|
179
|
+
if max_recommendations.nil?
|
180
|
+
raise ArgumentError, 'max_recommendations cannot be nil'
|
181
|
+
end
|
182
|
+
|
183
|
+
if max_recommendations > 1000
|
184
|
+
raise ArgumentError, 'invalid value for "max_recommendations", must be smaller than or equal to 1000.'
|
185
|
+
end
|
186
|
+
|
187
|
+
if max_recommendations < 1
|
188
|
+
raise ArgumentError, 'invalid value for "max_recommendations", must be greater than or equal to 1.'
|
189
|
+
end
|
190
|
+
|
191
|
+
@max_recommendations = max_recommendations
|
192
|
+
end
|
193
|
+
|
168
194
|
# Checks equality by comparing each attribute.
|
169
195
|
# @param [Object] Object to be compared
|
170
196
|
def ==(other)
|
@@ -174,10 +200,10 @@ module Algolia
|
|
174
200
|
index_name == other.index_name &&
|
175
201
|
threshold == other.threshold &&
|
176
202
|
max_recommendations == other.max_recommendations &&
|
203
|
+
query_parameters == other.query_parameters &&
|
177
204
|
facet_name == other.facet_name &&
|
178
205
|
facet_value == other.facet_value &&
|
179
206
|
model == other.model &&
|
180
|
-
query_parameters == other.query_parameters &&
|
181
207
|
fallback_parameters == other.fallback_parameters
|
182
208
|
end
|
183
209
|
|
@@ -190,7 +216,7 @@ module Algolia
|
|
190
216
|
# Calculates hash code according to all attributes.
|
191
217
|
# @return [Integer] Hash code
|
192
218
|
def hash
|
193
|
-
[index_name, threshold, max_recommendations, facet_name, facet_value, model,
|
219
|
+
[index_name, threshold, max_recommendations, query_parameters, facet_name, facet_value, model, fallback_parameters].hash
|
194
220
|
end
|
195
221
|
|
196
222
|
# Builds the object from hash
|
@@ -9,7 +9,7 @@ module Algolia
|
|
9
9
|
# API key.
|
10
10
|
attr_accessor :key
|
11
11
|
|
12
|
-
#
|
12
|
+
# Date and time when the object was created, in RFC 3339 format.
|
13
13
|
attr_accessor :created_at
|
14
14
|
|
15
15
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -9,7 +9,7 @@ module Algolia
|
|
9
9
|
# API key.
|
10
10
|
attr_accessor :value
|
11
11
|
|
12
|
-
# Timestamp
|
12
|
+
# Timestamp when the object was created, in milliseconds since the Unix epoch.
|
13
13
|
attr_accessor :created_at
|
14
14
|
|
15
15
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -6,10 +6,10 @@ require 'time'
|
|
6
6
|
module Algolia
|
7
7
|
module Search
|
8
8
|
class BaseIndexSettings
|
9
|
-
# Attributes used for [faceting](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/). Facets are ways to categorize search results based on attributes. Facets can be used to let user filter search results. By default, no attribute is used for faceting. **Modifiers**
|
9
|
+
# Attributes used for [faceting](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/). Facets are ways to categorize search results based on attributes. Facets can be used to let user filter search results. By default, no attribute is used for faceting. **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))`.
|
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**
|
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/).
|
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). 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**
|
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). 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 `!=`.
|
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. 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**
|
48
|
+
# Attributes used for searching. 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.
|
49
49
|
attr_accessor :searchable_attributes
|
50
50
|
|
51
51
|
# An object with custom data. You can store up to 32 kB as custom data.
|