algolia 3.0.0.beta.10 → 3.0.0.beta.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/Gemfile.lock +2 -2
- data/lib/algolia/api/ingestion_client.rb +912 -359
- data/lib/algolia/api/query_suggestions_client.rb +4 -10
- data/lib/algolia/api/search_client.rb +4 -4
- data/lib/algolia/api/usage_client.rb +4 -4
- data/lib/algolia/error.rb +10 -0
- data/lib/algolia/logger_helper.rb +11 -2
- 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/action.rb +45 -0
- data/lib/algolia/models/{search/search_for_hits_options.rb → ingestion/batch_request.rb} +22 -20
- data/lib/algolia/models/ingestion/{source_shopify_base.rb → batch_write_params.rb} +14 -12
- data/lib/algolia/models/ingestion/docker_streams_input.rb +1 -0
- data/lib/algolia/models/{recommend/recommendations_hits.rb → ingestion/list_tasks_response_v1.rb} +26 -14
- data/lib/algolia/models/ingestion/task.rb +30 -9
- data/lib/algolia/models/ingestion/task_create.rb +11 -12
- data/lib/algolia/models/{search/search_for_facets_options.rb → ingestion/task_create_v1.rb} +86 -51
- data/lib/algolia/models/ingestion/task_update.rb +8 -7
- data/lib/algolia/models/{search/browse_pagination.rb → ingestion/task_update_v1.rb} +50 -55
- data/lib/algolia/models/{recommend/looking_similar.rb → ingestion/task_v1.rb} +147 -30
- data/lib/algolia/models/ingestion/{transformation_try_response_error.rb → transformation_error.rb} +3 -3
- 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/{recommend/trending_items.rb → query-suggestions/config_status.rb} +46 -58
- 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 +0 -2
- data/lib/algolia/models/search/index_settings.rb +2 -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/{index_settings_as_search_params.rb → settings_response.rb} +251 -11
- 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/transport/transport.rb +8 -2
- data/lib/algolia/version.rb +1 -1
- metadata +32 -63
- 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/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_get_api_key_response.rb +0 -224
- 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/cursor.rb +0 -209
- data/lib/algolia/models/search/error_base.rb +0 -212
- data/lib/algolia/models/search/params.rb +0 -236
- 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/usage/error_base.rb +0 -212
- data/lib/algolia/models/usage/get_usage400_response.rb +0 -213
@@ -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.
|
@@ -28,7 +28,7 @@ module Algolia
|
|
28
28
|
# Attributes for which to split [camel case](https://wikipedia.org/wiki/Camel_case) words. Attribute names are case-sensitive.
|
29
29
|
attr_accessor :camel_case_attributes
|
30
30
|
|
31
|
-
# Searchable attributes to which Algolia should apply [word segmentation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-segmentation/) (decompounding). Attribute names are case-sensitive. Compound words are formed by combining two or more individual words, and are particularly prevalent in Germanic languages—for example, \"firefighter\". With decompounding, the individual components are indexed separately. You can specify different lists for different languages. Decompounding is supported for these languages: Dutch (`nl`), German (`de`), Finnish (`fi`), Danish (`da`), Swedish (`sv`), and Norwegian (`no`).
|
31
|
+
# Searchable attributes to which Algolia should apply [word segmentation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-segmentation/) (decompounding). Attribute names are case-sensitive. Compound words are formed by combining two or more individual words, and are particularly prevalent in Germanic languages—for example, \"firefighter\". With decompounding, the individual components are indexed separately. You can specify different lists for different languages. Decompounding is supported for these languages: Dutch (`nl`), German (`de`), Finnish (`fi`), Danish (`da`), Swedish (`sv`), and Norwegian (`no`). 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).
|
32
32
|
attr_accessor :decompounded_attributes
|
33
33
|
|
34
34
|
# Languages for language-specific processing steps, such as word detection and dictionary settings. **You should always specify an indexing 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/).
|
@@ -115,7 +115,7 @@ module Algolia
|
|
115
115
|
# 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/).
|
116
116
|
attr_accessor :query_languages
|
117
117
|
|
118
|
-
# 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.
|
118
|
+
# 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).
|
119
119
|
attr_accessor :decompound_query
|
120
120
|
|
121
121
|
# Whether to enable rules.
|
@@ -6,7 +6,7 @@ require "time"
|
|
6
6
|
module Algolia
|
7
7
|
module Search
|
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
|
data/lib/algolia/models/search/{redirect_rule_index_metadata_data.rb → redirect_rule_index_data.rb}
RENAMED
@@ -6,7 +6,7 @@ require "time"
|
|
6
6
|
module Algolia
|
7
7
|
module Search
|
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
|
@@ -156,7 +156,7 @@ module Algolia
|
|
156
156
|
# 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/).
|
157
157
|
attr_accessor :query_languages
|
158
158
|
|
159
|
-
# 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.
|
159
|
+
# 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).
|
160
160
|
attr_accessor :decompound_query
|
161
161
|
|
162
162
|
# Whether to enable rules.
|
@@ -156,7 +156,7 @@ module Algolia
|
|
156
156
|
# 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/).
|
157
157
|
attr_accessor :query_languages
|
158
158
|
|
159
|
-
# 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.
|
159
|
+
# 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).
|
160
160
|
attr_accessor :decompound_query
|
161
161
|
|
162
162
|
# 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.
|