algolia 3.0.0.beta.11 → 3.0.0.beta.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/Gemfile.lock +2 -2
- data/lib/algolia/api/ingestion_client.rb +127 -3
- data/lib/algolia/api/query_suggestions_client.rb +4 -10
- data/lib/algolia/api/search_client.rb +2 -2
- data/lib/algolia/api/usage_client.rb +4 -4
- data/lib/algolia/models/abtesting/{filter_effects_empty_search.rb → empty_search_filter.rb} +3 -3
- data/lib/algolia/models/abtesting/filter_effects.rb +2 -2
- data/lib/algolia/models/abtesting/{filter_effects_outliers.rb → outliers_filter.rb} +3 -3
- data/lib/algolia/models/analytics/{click_positions_inner.rb → click_position.rb} +3 -3
- data/lib/algolia/models/analytics/get_click_positions_response.rb +1 -1
- data/lib/algolia/models/analytics/top_search_with_analytics.rb +1 -1
- data/lib/algolia/models/analytics/top_search_with_revenue_analytics.rb +1 -1
- data/lib/algolia/models/ingestion/destination.rb +15 -4
- data/lib/algolia/models/ingestion/destination_create.rb +15 -4
- data/lib/algolia/models/ingestion/destination_input.rb +1 -2
- data/lib/algolia/models/ingestion/destination_update.rb +15 -4
- data/lib/algolia/models/ingestion/docker_streams_input.rb +1 -0
- data/lib/algolia/models/ingestion/entity_type.rb +32 -0
- data/lib/algolia/models/ingestion/{destination_index_prefix.rb → model.rb} +55 -15
- data/lib/algolia/models/{recommend/trending_items.rb → ingestion/run_source_payload.rb} +39 -34
- data/lib/algolia/models/{search/base_get_api_key_response.rb → ingestion/run_source_response.rb} +19 -15
- data/lib/algolia/models/ingestion/{transformation_try_response_error.rb → transformation_error.rb} +3 -3
- data/lib/algolia/models/ingestion/{source_shopify_base.rb → transformation_models.rb} +14 -12
- data/lib/algolia/models/ingestion/transformation_try_response.rb +1 -1
- data/lib/algolia/models/monitoring/{incidents_inner.rb → incident_entry.rb} +3 -3
- data/lib/algolia/models/monitoring/{indexing_time_response_metrics.rb → indexing_metric.rb} +3 -3
- data/lib/algolia/models/monitoring/indexing_time_response.rb +1 -1
- data/lib/algolia/models/monitoring/infrastructure_response.rb +1 -1
- data/lib/algolia/models/monitoring/{latency_response_metrics.rb → latency_metric.rb} +3 -3
- data/lib/algolia/models/monitoring/latency_response.rb +1 -1
- data/lib/algolia/models/monitoring/{infrastructure_response_metrics.rb → metrics.rb} +3 -6
- data/lib/algolia/models/monitoring/{time_inner.rb → time_entry.rb} +3 -3
- data/lib/algolia/models/{search/search_for_hits_options.rb → query-suggestions/config_status.rb} +43 -36
- data/lib/algolia/models/{recommend/related_products.rb → query-suggestions/log_file.rb} +36 -32
- data/lib/algolia/models/recommend/around_precision.rb +1 -1
- data/lib/algolia/models/recommend/fallback_params.rb +1 -1
- data/lib/algolia/models/recommend/{around_precision_from_value_inner.rb → range.rb} +3 -6
- data/lib/algolia/models/recommend/recommend_rule.rb +1 -1
- data/lib/algolia/models/recommend/{redirect_rule_index_metadata_data.rb → redirect_rule_index_data.rb} +3 -3
- data/lib/algolia/models/recommend/redirect_rule_index_metadata.rb +1 -1
- data/lib/algolia/models/recommend/{recommend_rule_metadata.rb → rule_metadata.rb} +3 -3
- data/lib/algolia/models/recommend/search_params.rb +1 -1
- data/lib/algolia/models/recommend/search_params_object.rb +1 -1
- data/lib/algolia/models/search/around_precision.rb +1 -1
- data/lib/algolia/models/search/browse_params_object.rb +1 -1
- data/lib/algolia/models/search/built_in_operation.rb +1 -2
- data/lib/algolia/models/search/built_in_operation_value.rb +105 -0
- data/lib/algolia/models/search/consequence_params.rb +1 -1
- data/lib/algolia/models/search/dictionary_entry.rb +13 -6
- data/lib/algolia/models/search/dictionary_entry_type.rb +32 -0
- data/lib/algolia/models/search/index_settings.rb +2 -2
- data/lib/algolia/models/search/multiple_batch_request.rb +0 -2
- data/lib/algolia/models/search/{around_precision_from_value_inner.rb → range.rb} +3 -6
- data/lib/algolia/models/search/{redirect_rule_index_metadata_data.rb → redirect_rule_index_data.rb} +3 -3
- data/lib/algolia/models/search/redirect_rule_index_metadata.rb +1 -1
- data/lib/algolia/models/search/search_for_facets.rb +1 -1
- data/lib/algolia/models/search/search_for_hits.rb +1 -1
- data/lib/algolia/models/search/search_params_object.rb +1 -1
- data/lib/algolia/models/search/search_params_string.rb +1 -0
- data/lib/algolia/models/search/settings_response.rb +2 -2
- data/lib/algolia/models/usage/{get_usage400_response_error_errors_inner.rb → error_item.rb} +3 -3
- data/lib/algolia/models/usage/{get_usage400_response_error.rb → forbidden_error.rb} +4 -4
- data/lib/algolia/models/usage/{get_usage200_response.rb → index_usage.rb} +4 -4
- data/lib/algolia/models/usage/invalid_request_error.rb +231 -0
- data/lib/algolia/models/usage/{get_usage200_response_statistics_inner.rb → statistic_entry.rb} +3 -3
- data/lib/algolia/version.rb +1 -1
- metadata +30 -65
- data/lib/algolia/models/abtesting/custom_search_params.rb +0 -214
- data/lib/algolia/models/abtesting/error_base.rb +0 -212
- data/lib/algolia/models/analytics/error_base.rb +0 -212
- data/lib/algolia/models/ingestion/error_base.rb +0 -212
- data/lib/algolia/models/insights/error_base.rb +0 -212
- data/lib/algolia/models/monitoring/error_base.rb +0 -212
- data/lib/algolia/models/monitoring/get_servers403_response.rb +0 -211
- data/lib/algolia/models/personalization/error_base.rb +0 -212
- data/lib/algolia/models/query-suggestions/app_id.rb +0 -209
- data/lib/algolia/models/query-suggestions/error_base.rb +0 -212
- data/lib/algolia/models/recommend/base_recommend_request.rb +0 -281
- data/lib/algolia/models/recommend/base_search_params.rb +0 -635
- data/lib/algolia/models/recommend/base_search_params_without_query.rb +0 -616
- data/lib/algolia/models/recommend/base_search_response.rb +0 -499
- data/lib/algolia/models/recommend/error_base.rb +0 -212
- data/lib/algolia/models/recommend/frequently_bought_together.rb +0 -247
- data/lib/algolia/models/recommend/index_settings_as_search_params.rb +0 -788
- data/lib/algolia/models/recommend/looking_similar.rb +0 -256
- data/lib/algolia/models/recommend/recommendations_hits.rb +0 -215
- data/lib/algolia/models/recommend/recommended_for_you.rb +0 -244
- data/lib/algolia/models/recommend/search_pagination.rb +0 -282
- data/lib/algolia/models/recommend/search_params_query.rb +0 -212
- data/lib/algolia/models/recommend/trending_facets.rb +0 -258
- data/lib/algolia/models/search/base_index_settings.rb +0 -426
- data/lib/algolia/models/search/base_search_params.rb +0 -635
- data/lib/algolia/models/search/base_search_params_without_query.rb +0 -616
- data/lib/algolia/models/search/base_search_response.rb +0 -499
- data/lib/algolia/models/search/browse_pagination.rb +0 -274
- data/lib/algolia/models/search/cursor.rb +0 -209
- data/lib/algolia/models/search/error_base.rb +0 -212
- data/lib/algolia/models/search/index_settings_as_search_params.rb +0 -788
- data/lib/algolia/models/search/params.rb +0 -236
- data/lib/algolia/models/search/search_for_facets_options.rb +0 -293
- data/lib/algolia/models/search/search_hits.rb +0 -240
- data/lib/algolia/models/search/search_pagination.rb +0 -282
- data/lib/algolia/models/search/search_params_query.rb +0 -212
- data/lib/algolia/models/search/with_primary.rb +0 -212
- data/lib/algolia/models/usage/error_base.rb +0 -212
- data/lib/algolia/models/usage/get_usage400_response.rb +0 -213
@@ -5,7 +5,7 @@ require "time"
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Monitoring
|
8
|
-
class
|
8
|
+
class TimeEntry
|
9
9
|
# Timestamp, measured in milliseconds since the Unix epoch.
|
10
10
|
attr_accessor :t
|
11
11
|
|
@@ -46,7 +46,7 @@ module Algolia
|
|
46
46
|
if (!attributes.is_a?(Hash))
|
47
47
|
raise(
|
48
48
|
ArgumentError,
|
49
|
-
"The input argument (attributes) must be a hash in `Algolia::
|
49
|
+
"The input argument (attributes) must be a hash in `Algolia::TimeEntry` initialize method"
|
50
50
|
)
|
51
51
|
end
|
52
52
|
|
@@ -55,7 +55,7 @@ module Algolia
|
|
55
55
|
if (!self.class.attribute_map.key?(k.to_sym))
|
56
56
|
raise(
|
57
57
|
ArgumentError,
|
58
|
-
"`#{k}` is not a valid attribute in `Algolia::
|
58
|
+
"`#{k}` is not a valid attribute in `Algolia::TimeEntry`. Please check the name to make sure it's valid. List of attributes: " +
|
59
59
|
self.class.attribute_map.keys.inspect
|
60
60
|
)
|
61
61
|
end
|
data/lib/algolia/models/{search/search_for_hits_options.rb → query-suggestions/config_status.rb}
RENAMED
@@ -4,40 +4,31 @@ require "date"
|
|
4
4
|
require "time"
|
5
5
|
|
6
6
|
module Algolia
|
7
|
-
module
|
8
|
-
class
|
9
|
-
#
|
7
|
+
module QuerySuggestions
|
8
|
+
class ConfigStatus
|
9
|
+
# Name of the Query Suggestions index (case-sensitive).
|
10
10
|
attr_accessor :index_name
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
class EnumAttributeValidator
|
15
|
-
attr_reader :datatype
|
16
|
-
attr_reader :allowable_values
|
17
|
-
|
18
|
-
def initialize(datatype, allowable_values)
|
19
|
-
@allowable_values = allowable_values.map do |value|
|
20
|
-
case datatype.to_s
|
21
|
-
when /Integer/i
|
22
|
-
value.to_i
|
23
|
-
when /Float/i
|
24
|
-
value.to_f
|
25
|
-
else
|
26
|
-
value
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
12
|
+
# Whether the creation or update of the Query Suggestions index is in progress.
|
13
|
+
attr_accessor :is_running
|
30
14
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
15
|
+
# Date and time when the Query Suggestions index was last built, in RFC 3339 format.
|
16
|
+
attr_accessor :last_built_at
|
17
|
+
|
18
|
+
# Date and time when the Query Suggestions index was last updated successfully.
|
19
|
+
attr_accessor :last_successful_built_at
|
20
|
+
|
21
|
+
# Duration of the last successful build in seconds.
|
22
|
+
attr_accessor :last_successful_build_duration
|
35
23
|
|
36
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
37
25
|
def self.attribute_map
|
38
26
|
{
|
39
27
|
:index_name => :indexName,
|
40
|
-
:
|
28
|
+
:is_running => :isRunning,
|
29
|
+
:last_built_at => :lastBuiltAt,
|
30
|
+
:last_successful_built_at => :lastSuccessfulBuiltAt,
|
31
|
+
:last_successful_build_duration => :lastSuccessfulBuildDuration
|
41
32
|
}
|
42
33
|
end
|
43
34
|
|
@@ -50,7 +41,10 @@ module Algolia
|
|
50
41
|
def self.types_mapping
|
51
42
|
{
|
52
43
|
:index_name => :"String",
|
53
|
-
:
|
44
|
+
:is_running => :"Boolean",
|
45
|
+
:last_built_at => :"String",
|
46
|
+
:last_successful_built_at => :"String",
|
47
|
+
:last_successful_build_duration => :"String"
|
54
48
|
}
|
55
49
|
end
|
56
50
|
|
@@ -67,7 +61,7 @@ module Algolia
|
|
67
61
|
if (!attributes.is_a?(Hash))
|
68
62
|
raise(
|
69
63
|
ArgumentError,
|
70
|
-
"The input argument (attributes) must be a hash in `Algolia::
|
64
|
+
"The input argument (attributes) must be a hash in `Algolia::ConfigStatus` initialize method"
|
71
65
|
)
|
72
66
|
end
|
73
67
|
|
@@ -76,7 +70,7 @@ module Algolia
|
|
76
70
|
if (!self.class.attribute_map.key?(k.to_sym))
|
77
71
|
raise(
|
78
72
|
ArgumentError,
|
79
|
-
"`#{k}` is not a valid attribute in `Algolia::
|
73
|
+
"`#{k}` is not a valid attribute in `Algolia::ConfigStatus`. Please check the name to make sure it's valid. List of attributes: " +
|
80
74
|
self.class.attribute_map.keys.inspect
|
81
75
|
)
|
82
76
|
end
|
@@ -86,12 +80,22 @@ module Algolia
|
|
86
80
|
|
87
81
|
if attributes.key?(:index_name)
|
88
82
|
self.index_name = attributes[:index_name]
|
89
|
-
else
|
90
|
-
self.index_name = nil
|
91
83
|
end
|
92
84
|
|
93
|
-
if attributes.key?(:
|
94
|
-
self.
|
85
|
+
if attributes.key?(:is_running)
|
86
|
+
self.is_running = attributes[:is_running]
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.key?(:last_built_at)
|
90
|
+
self.last_built_at = attributes[:last_built_at]
|
91
|
+
end
|
92
|
+
|
93
|
+
if attributes.key?(:last_successful_built_at)
|
94
|
+
self.last_successful_built_at = attributes[:last_successful_built_at]
|
95
|
+
end
|
96
|
+
|
97
|
+
if attributes.key?(:last_successful_build_duration)
|
98
|
+
self.last_successful_build_duration = attributes[:last_successful_build_duration]
|
95
99
|
end
|
96
100
|
end
|
97
101
|
|
@@ -101,7 +105,10 @@ module Algolia
|
|
101
105
|
return true if self.equal?(other)
|
102
106
|
self.class == other.class &&
|
103
107
|
index_name == other.index_name &&
|
104
|
-
|
108
|
+
is_running == other.is_running &&
|
109
|
+
last_built_at == other.last_built_at &&
|
110
|
+
last_successful_built_at == other.last_successful_built_at &&
|
111
|
+
last_successful_build_duration == other.last_successful_build_duration
|
105
112
|
end
|
106
113
|
|
107
114
|
# @see the `==` method
|
@@ -113,7 +120,7 @@ module Algolia
|
|
113
120
|
# Calculates hash code according to all attributes.
|
114
121
|
# @return [Integer] Hash code
|
115
122
|
def hash
|
116
|
-
[index_name,
|
123
|
+
[index_name, is_running, last_built_at, last_successful_built_at, last_successful_build_duration].hash
|
117
124
|
end
|
118
125
|
|
119
126
|
# Builds the object from hash
|
@@ -182,7 +189,7 @@ module Algolia
|
|
182
189
|
# model
|
183
190
|
else
|
184
191
|
# models (e.g. Pet) or oneOf
|
185
|
-
klass = Algolia::
|
192
|
+
klass = Algolia::QuerySuggestions.const_get(type)
|
186
193
|
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
|
187
194
|
.build_from_hash(value)
|
188
195
|
end
|
@@ -4,14 +4,18 @@ require "date"
|
|
4
4
|
require "time"
|
5
5
|
|
6
6
|
module Algolia
|
7
|
-
module
|
8
|
-
class
|
9
|
-
|
7
|
+
module QuerySuggestions
|
8
|
+
class LogFile
|
9
|
+
# Date and time of the log entry, in RFC 3339 format.
|
10
|
+
attr_accessor :timestamp
|
10
11
|
|
11
|
-
|
12
|
-
attr_accessor :object_id
|
12
|
+
attr_accessor :level
|
13
13
|
|
14
|
-
|
14
|
+
# Details about this log entry.
|
15
|
+
attr_accessor :message
|
16
|
+
|
17
|
+
# Level indicating the position of a suggestion in a hierarchy of records. For example, a `contextLevel` of 1 indicates that this suggestion belongs to a previous suggestion with `contextLevel` 0.
|
18
|
+
attr_accessor :context_level
|
15
19
|
|
16
20
|
class EnumAttributeValidator
|
17
21
|
attr_reader :datatype
|
@@ -38,9 +42,10 @@ module Algolia
|
|
38
42
|
# Attribute mapping from ruby-style variable name to JSON key.
|
39
43
|
def self.attribute_map
|
40
44
|
{
|
41
|
-
:
|
42
|
-
:
|
43
|
-
:
|
45
|
+
:timestamp => :timestamp,
|
46
|
+
:level => :level,
|
47
|
+
:message => :message,
|
48
|
+
:context_level => :contextLevel
|
44
49
|
}
|
45
50
|
end
|
46
51
|
|
@@ -52,9 +57,10 @@ module Algolia
|
|
52
57
|
# Attribute type mapping.
|
53
58
|
def self.types_mapping
|
54
59
|
{
|
55
|
-
:
|
56
|
-
:
|
57
|
-
:
|
60
|
+
:timestamp => :"String",
|
61
|
+
:level => :"LogLevel",
|
62
|
+
:message => :"String",
|
63
|
+
:context_level => :"Integer"
|
58
64
|
}
|
59
65
|
end
|
60
66
|
|
@@ -69,10 +75,7 @@ module Algolia
|
|
69
75
|
# @param [Hash] attributes Model attributes in the form of hash
|
70
76
|
def initialize(attributes = {})
|
71
77
|
if (!attributes.is_a?(Hash))
|
72
|
-
raise(
|
73
|
-
ArgumentError,
|
74
|
-
"The input argument (attributes) must be a hash in `Algolia::RelatedProducts` initialize method"
|
75
|
-
)
|
78
|
+
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::LogFile` initialize method"
|
76
79
|
end
|
77
80
|
|
78
81
|
# check to see if the attribute exists and convert string to symbol for hash key
|
@@ -80,7 +83,7 @@ module Algolia
|
|
80
83
|
if (!self.class.attribute_map.key?(k.to_sym))
|
81
84
|
raise(
|
82
85
|
ArgumentError,
|
83
|
-
"`#{k}` is not a valid attribute in `Algolia::
|
86
|
+
"`#{k}` is not a valid attribute in `Algolia::LogFile`. Please check the name to make sure it's valid. List of attributes: " +
|
84
87
|
self.class.attribute_map.keys.inspect
|
85
88
|
)
|
86
89
|
end
|
@@ -88,20 +91,20 @@ module Algolia
|
|
88
91
|
h[k.to_sym] = v
|
89
92
|
}
|
90
93
|
|
91
|
-
if attributes.key?(:
|
92
|
-
self.
|
93
|
-
else
|
94
|
-
self.model = nil
|
94
|
+
if attributes.key?(:timestamp)
|
95
|
+
self.timestamp = attributes[:timestamp]
|
95
96
|
end
|
96
97
|
|
97
|
-
if attributes.key?(:
|
98
|
-
self.
|
99
|
-
|
100
|
-
|
98
|
+
if attributes.key?(:level)
|
99
|
+
self.level = attributes[:level]
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.key?(:message)
|
103
|
+
self.message = attributes[:message]
|
101
104
|
end
|
102
105
|
|
103
|
-
if attributes.key?(:
|
104
|
-
self.
|
106
|
+
if attributes.key?(:context_level)
|
107
|
+
self.context_level = attributes[:context_level]
|
105
108
|
end
|
106
109
|
end
|
107
110
|
|
@@ -110,9 +113,10 @@ module Algolia
|
|
110
113
|
def ==(other)
|
111
114
|
return true if self.equal?(other)
|
112
115
|
self.class == other.class &&
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
+
timestamp == other.timestamp &&
|
117
|
+
level == other.level &&
|
118
|
+
message == other.message &&
|
119
|
+
context_level == other.context_level
|
116
120
|
end
|
117
121
|
|
118
122
|
# @see the `==` method
|
@@ -124,7 +128,7 @@ module Algolia
|
|
124
128
|
# Calculates hash code according to all attributes.
|
125
129
|
# @return [Integer] Hash code
|
126
130
|
def hash
|
127
|
-
[
|
131
|
+
[timestamp, level, message, context_level].hash
|
128
132
|
end
|
129
133
|
|
130
134
|
# Builds the object from hash
|
@@ -193,7 +197,7 @@ module Algolia
|
|
193
197
|
# model
|
194
198
|
else
|
195
199
|
# models (e.g. Pet) or oneOf
|
196
|
-
klass = Algolia::
|
200
|
+
klass = Algolia::QuerySuggestions.const_get(type)
|
197
201
|
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
|
198
202
|
.build_from_hash(value)
|
199
203
|
end
|
@@ -153,7 +153,7 @@ module Algolia
|
|
153
153
|
# Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. This setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals` settings. This setting also sets a dictionary for word detection in the logogram-based [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) languages. To support this, you must place the CJK language **first**. **You should always specify a query language.** If you don't specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages/), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/).
|
154
154
|
attr_accessor :query_languages
|
155
155
|
|
156
|
-
# Whether to split compound words into their building blocks. For more information, see [Word segmentation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#splitting-compound-words). Word segmentation is supported for these languages: German, Dutch, Finnish, Swedish, and Norwegian.
|
156
|
+
# Whether to split compound words in the query into their building blocks. For more information, see [Word segmentation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#splitting-compound-words). Word segmentation is supported for these languages: German, Dutch, Finnish, Swedish, and Norwegian. Decompounding doesn't work for words with [non-spacing mark Unicode characters](https://www.charactercodes.net/category/non-spacing_mark). For example, `Gartenstühle` won't be decompounded if the `ü` consists of `u` (U+0075) and `◌̈` (U+0308).
|
157
157
|
attr_accessor :decompound_query
|
158
158
|
|
159
159
|
# Whether to enable rules.
|
@@ -6,7 +6,7 @@ require "time"
|
|
6
6
|
module Algolia
|
7
7
|
module Recommend
|
8
8
|
# Range object with lower and upper values in meters to define custom ranges.
|
9
|
-
class
|
9
|
+
class Range
|
10
10
|
# Lower boundary of a range in meters. The Geo ranking criterion considers all records within the range to be equal.
|
11
11
|
attr_accessor :from
|
12
12
|
|
@@ -45,10 +45,7 @@ module Algolia
|
|
45
45
|
# @param [Hash] attributes Model attributes in the form of hash
|
46
46
|
def initialize(attributes = {})
|
47
47
|
if (!attributes.is_a?(Hash))
|
48
|
-
raise(
|
49
|
-
ArgumentError,
|
50
|
-
"The input argument (attributes) must be a hash in `Algolia::AroundPrecisionFromValueInner` initialize method"
|
51
|
-
)
|
48
|
+
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::Range` initialize method"
|
52
49
|
end
|
53
50
|
|
54
51
|
# check to see if the attribute exists and convert string to symbol for hash key
|
@@ -56,7 +53,7 @@ module Algolia
|
|
56
53
|
if (!self.class.attribute_map.key?(k.to_sym))
|
57
54
|
raise(
|
58
55
|
ArgumentError,
|
59
|
-
"`#{k}` is not a valid attribute in `Algolia::
|
56
|
+
"`#{k}` is not a valid attribute in `Algolia::Range`. Please check the name to make sure it's valid. List of attributes: " +
|
60
57
|
self.class.attribute_map.keys.inspect
|
61
58
|
)
|
62
59
|
end
|
@@ -6,7 +6,7 @@ require "time"
|
|
6
6
|
module Algolia
|
7
7
|
module Recommend
|
8
8
|
# Redirect rule data.
|
9
|
-
class
|
9
|
+
class RedirectRuleIndexData
|
10
10
|
attr_accessor :rule_object_id
|
11
11
|
|
12
12
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -41,7 +41,7 @@ module Algolia
|
|
41
41
|
if (!attributes.is_a?(Hash))
|
42
42
|
raise(
|
43
43
|
ArgumentError,
|
44
|
-
"The input argument (attributes) must be a hash in `Algolia::
|
44
|
+
"The input argument (attributes) must be a hash in `Algolia::RedirectRuleIndexData` initialize method"
|
45
45
|
)
|
46
46
|
end
|
47
47
|
|
@@ -50,7 +50,7 @@ module Algolia
|
|
50
50
|
if (!self.class.attribute_map.key?(k.to_sym))
|
51
51
|
raise(
|
52
52
|
ArgumentError,
|
53
|
-
"`#{k}` is not a valid attribute in `Algolia::
|
53
|
+
"`#{k}` is not a valid attribute in `Algolia::RedirectRuleIndexData`. Please check the name to make sure it's valid. List of attributes: " +
|
54
54
|
self.class.attribute_map.keys.inspect
|
55
55
|
)
|
56
56
|
end
|
@@ -6,7 +6,7 @@ require "time"
|
|
6
6
|
module Algolia
|
7
7
|
module Recommend
|
8
8
|
# Rule metadata.
|
9
|
-
class
|
9
|
+
class RuleMetadata
|
10
10
|
# Date and time when the object was updated, in RFC 3339 format.
|
11
11
|
attr_accessor :last_update
|
12
12
|
|
@@ -42,7 +42,7 @@ module Algolia
|
|
42
42
|
if (!attributes.is_a?(Hash))
|
43
43
|
raise(
|
44
44
|
ArgumentError,
|
45
|
-
"The input argument (attributes) must be a hash in `Algolia::
|
45
|
+
"The input argument (attributes) must be a hash in `Algolia::RuleMetadata` initialize method"
|
46
46
|
)
|
47
47
|
end
|
48
48
|
|
@@ -51,7 +51,7 @@ module Algolia
|
|
51
51
|
if (!self.class.attribute_map.key?(k.to_sym))
|
52
52
|
raise(
|
53
53
|
ArgumentError,
|
54
|
-
"`#{k}` is not a valid attribute in `Algolia::
|
54
|
+
"`#{k}` is not a valid attribute in `Algolia::RuleMetadata`. Please check the name to make sure it's valid. List of attributes: " +
|
55
55
|
self.class.attribute_map.keys.inspect
|
56
56
|
)
|
57
57
|
end
|
@@ -153,7 +153,7 @@ module Algolia
|
|
153
153
|
# Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. This setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals` settings. This setting also sets a dictionary for word detection in the logogram-based [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) languages. To support this, you must place the CJK language **first**. **You should always specify a query language.** If you don't specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages/), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/).
|
154
154
|
attr_accessor :query_languages
|
155
155
|
|
156
|
-
# Whether to split compound words into their building blocks. For more information, see [Word segmentation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#splitting-compound-words). Word segmentation is supported for these languages: German, Dutch, Finnish, Swedish, and Norwegian.
|
156
|
+
# Whether to split compound words in the query into their building blocks. For more information, see [Word segmentation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#splitting-compound-words). Word segmentation is supported for these languages: German, Dutch, Finnish, Swedish, and Norwegian. Decompounding doesn't work for words with [non-spacing mark Unicode characters](https://www.charactercodes.net/category/non-spacing_mark). For example, `Gartenstühle` won't be decompounded if the `ü` consists of `u` (U+0075) and `◌̈` (U+0308).
|
157
157
|
attr_accessor :decompound_query
|
158
158
|
|
159
159
|
# Whether to enable rules.
|
@@ -154,7 +154,7 @@ module Algolia
|
|
154
154
|
# Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. This setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals` settings. This setting also sets a dictionary for word detection in the logogram-based [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) languages. To support this, you must place the CJK language **first**. **You should always specify a query language.** If you don't specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages/), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/).
|
155
155
|
attr_accessor :query_languages
|
156
156
|
|
157
|
-
# Whether to split compound words into their building blocks. For more information, see [Word segmentation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#splitting-compound-words). Word segmentation is supported for these languages: German, Dutch, Finnish, Swedish, and Norwegian.
|
157
|
+
# Whether to split compound words in the query into their building blocks. For more information, see [Word segmentation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#splitting-compound-words). Word segmentation is supported for these languages: German, Dutch, Finnish, Swedish, and Norwegian. Decompounding doesn't work for words with [non-spacing mark Unicode characters](https://www.charactercodes.net/category/non-spacing_mark). For example, `Gartenstühle` won't be decompounded if the `ü` consists of `u` (U+0075) and `◌̈` (U+0308).
|
158
158
|
attr_accessor :decompound_query
|
159
159
|
|
160
160
|
# Whether to enable rules.
|
@@ -153,7 +153,7 @@ module Algolia
|
|
153
153
|
# Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. This setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals` settings. This setting also sets a dictionary for word detection in the logogram-based [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) languages. To support this, you must place the CJK language **first**. **You should always specify a query language.** If you don't specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages/), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/).
|
154
154
|
attr_accessor :query_languages
|
155
155
|
|
156
|
-
# Whether to split compound words into their building blocks. For more information, see [Word segmentation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#splitting-compound-words). Word segmentation is supported for these languages: German, Dutch, Finnish, Swedish, and Norwegian.
|
156
|
+
# Whether to split compound words in the query into their building blocks. For more information, see [Word segmentation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#splitting-compound-words). Word segmentation is supported for these languages: German, Dutch, Finnish, Swedish, and Norwegian. Decompounding doesn't work for words with [non-spacing mark Unicode characters](https://www.charactercodes.net/category/non-spacing_mark). For example, `Gartenstühle` won't be decompounded if the `ü` consists of `u` (U+0075) and `◌̈` (U+0308).
|
157
157
|
attr_accessor :decompound_query
|
158
158
|
|
159
159
|
# Whether to enable rules.
|
@@ -9,7 +9,6 @@ module Algolia
|
|
9
9
|
class BuiltInOperation
|
10
10
|
attr_accessor :_operation
|
11
11
|
|
12
|
-
# Value that corresponds to the operation, for example an `Increment` or `Decrement` step, or an `Add` or `Remove` value.
|
13
12
|
attr_accessor :value
|
14
13
|
|
15
14
|
class EnumAttributeValidator
|
@@ -51,7 +50,7 @@ module Algolia
|
|
51
50
|
def self.types_mapping
|
52
51
|
{
|
53
52
|
:_operation => :"BuiltInOperationType",
|
54
|
-
:value => :"
|
53
|
+
:value => :"BuiltInOperationValue"
|
55
54
|
}
|
56
55
|
end
|
57
56
|
|
@@ -0,0 +1,105 @@
|
|
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
|
+
module BuiltInOperationValue
|
9
|
+
class << self
|
10
|
+
# List of class defined in oneOf (OpenAPI v3)
|
11
|
+
def openapi_one_of
|
12
|
+
[
|
13
|
+
:"Integer",
|
14
|
+
:"String"
|
15
|
+
]
|
16
|
+
end
|
17
|
+
|
18
|
+
# Builds the object
|
19
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
20
|
+
# @return [Object] Returns the model or the data itself
|
21
|
+
def build(data)
|
22
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
23
|
+
# Note:
|
24
|
+
# - We do not attempt to check whether exactly one item matches.
|
25
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
26
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
27
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
28
|
+
# - TODO: logging when debugging is set.
|
29
|
+
openapi_one_of.each do |klass|
|
30
|
+
begin
|
31
|
+
# "nullable: true"
|
32
|
+
next if klass == :AnyType
|
33
|
+
typed_data = find_and_cast_into_type(klass, data)
|
34
|
+
return typed_data if typed_data
|
35
|
+
# rescue all errors so we keep iterating even if the current item lookup raises
|
36
|
+
rescue
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
SchemaMismatchError = Class.new(StandardError)
|
46
|
+
|
47
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
48
|
+
def find_and_cast_into_type(klass, data)
|
49
|
+
return if data.nil?
|
50
|
+
|
51
|
+
case klass.to_s
|
52
|
+
when "Boolean"
|
53
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
54
|
+
when "Float"
|
55
|
+
return data if data.instance_of?(Float)
|
56
|
+
when "Integer"
|
57
|
+
return data if data.instance_of?(Integer)
|
58
|
+
when "Time"
|
59
|
+
return Time.parse(data)
|
60
|
+
when "Date"
|
61
|
+
return Date.parse(data)
|
62
|
+
when "String"
|
63
|
+
return data if data.instance_of?(String)
|
64
|
+
# "type: object"
|
65
|
+
when "Object"
|
66
|
+
return data if data.instance_of?(Hash)
|
67
|
+
# "type: array"
|
68
|
+
when /\AArray<(?<sub_type>.+)>\z/
|
69
|
+
if data.instance_of?(Array)
|
70
|
+
sub_type = Regexp.last_match[:sub_type]
|
71
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
72
|
+
end
|
73
|
+
# "type: object" with "additionalProperties: { ... }"
|
74
|
+
when /\AHash<String, (?<sub_type>.+)>\z/
|
75
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
76
|
+
sub_type = Regexp.last_match[:sub_type]
|
77
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
78
|
+
end
|
79
|
+
# model
|
80
|
+
else
|
81
|
+
const = Algolia::Search.const_get(klass)
|
82
|
+
if const
|
83
|
+
# nested oneOf model
|
84
|
+
if const.respond_to?(:openapi_one_of)
|
85
|
+
model = const.build(data)
|
86
|
+
else
|
87
|
+
# raise if data contains keys that are not known to the model
|
88
|
+
raise unless (data.keys - const.acceptable_attributes).empty?
|
89
|
+
model = const.build_from_hash(data)
|
90
|
+
end
|
91
|
+
|
92
|
+
return model if model
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
# if no match by now, raise
|
97
|
+
raise
|
98
|
+
rescue
|
99
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
end
|
105
|
+
end
|
@@ -150,7 +150,7 @@ module Algolia
|
|
150
150
|
# Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. This setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals` settings. This setting also sets a dictionary for word detection in the logogram-based [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) languages. To support this, you must place the CJK language **first**. **You should always specify a query language.** If you don't specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages/), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/).
|
151
151
|
attr_accessor :query_languages
|
152
152
|
|
153
|
-
# Whether to split compound words into their building blocks. For more information, see [Word segmentation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#splitting-compound-words). Word segmentation is supported for these languages: German, Dutch, Finnish, Swedish, and Norwegian.
|
153
|
+
# Whether to split compound words in the query into their building blocks. For more information, see [Word segmentation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#splitting-compound-words). Word segmentation is supported for these languages: German, Dutch, Finnish, Swedish, and Norwegian. Decompounding doesn't work for words with [non-spacing mark Unicode characters](https://www.charactercodes.net/category/non-spacing_mark). For example, `Gartenstühle` won't be decompounded if the `ü` consists of `u` (U+0075) and `◌̈` (U+0308).
|
154
154
|
attr_accessor :decompound_query
|
155
155
|
|
156
156
|
# Whether to enable rules.
|