algolia 3.24.0 → 3.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/issue.yml +1 -1
- data/.github/workflows/release.yml +1 -1
- data/CHANGELOG.md +18 -0
- data/Gemfile.lock +1 -1
- data/lib/algolia/api/composition_client.rb +765 -0
- data/lib/algolia/api/ingestion_client.rb +63 -6
- data/lib/algolia/api/search_client.rb +10 -5
- data/lib/algolia/models/composition/action.rb +34 -0
- data/lib/algolia/models/composition/advanced_syntax_features.rb +34 -0
- data/lib/algolia/models/composition/alternatives_as_exact.rb +36 -0
- data/lib/algolia/models/composition/anchoring.rb +36 -0
- data/lib/algolia/models/composition/base_injection_query_parameters.rb +732 -0
- data/lib/algolia/models/composition/batch_composition_action.rb +109 -0
- data/lib/algolia/models/composition/batch_params.rb +213 -0
- data/lib/algolia/models/composition/boolean_string.rb +34 -0
- data/lib/algolia/models/composition/composition.rb +244 -0
- data/lib/algolia/models/composition/composition_behavior.rb +210 -0
- data/lib/algolia/models/composition/composition_rule.rb +280 -0
- data/lib/algolia/models/composition/composition_rule_consequence.rb +211 -0
- data/lib/algolia/models/composition/composition_rules_batch_params.rb +211 -0
- data/lib/algolia/models/composition/composition_source.rb +210 -0
- data/lib/algolia/models/composition/composition_source_search.rb +220 -0
- data/lib/algolia/models/composition/condition.rb +238 -0
- data/lib/algolia/models/composition/delete_composition_action.rb +212 -0
- data/lib/algolia/models/composition/delete_composition_rule_action.rb +212 -0
- data/lib/algolia/models/composition/distinct.rb +110 -0
- data/lib/algolia/models/composition/exact_on_single_word_query.rb +35 -0
- data/lib/algolia/models/composition/external.rb +226 -0
- data/lib/algolia/models/composition/external_injected_item.rb +212 -0
- data/lib/algolia/models/composition/external_injection.rb +223 -0
- data/lib/algolia/models/composition/external_ordering.rb +34 -0
- data/lib/algolia/models/composition/external_source.rb +211 -0
- data/lib/algolia/models/composition/get_task_response.rb +210 -0
- data/lib/algolia/models/composition/ignore_plurals.rb +111 -0
- data/lib/algolia/models/composition/injected_item.rb +253 -0
- data/lib/algolia/models/composition/injected_item_hits_metadata.rb +222 -0
- data/lib/algolia/models/composition/injected_item_metadata.rb +209 -0
- data/lib/algolia/models/composition/injected_item_source.rb +109 -0
- data/lib/algolia/models/composition/injection.rb +222 -0
- data/lib/algolia/models/composition/list_compositions_response.rb +261 -0
- data/lib/algolia/models/composition/main.rb +207 -0
- data/lib/algolia/models/composition/main_injection_query_parameters.rb +807 -0
- data/lib/algolia/models/composition/multiple_batch_request.rb +221 -0
- data/lib/algolia/models/composition/multiple_batch_response.rb +213 -0
- data/lib/algolia/models/composition/optional_words.rb +110 -0
- data/lib/algolia/models/composition/params.rb +17 -4
- data/lib/algolia/models/composition/query_type.rb +35 -0
- data/lib/algolia/models/composition/remove_stop_words.rb +110 -0
- data/lib/algolia/models/composition/remove_words_if_no_results.rb +36 -0
- data/lib/algolia/models/composition/rules_batch_composition_action.rb +109 -0
- data/lib/algolia/models/composition/rules_multiple_batch_request.rb +221 -0
- data/lib/algolia/models/composition/rules_multiple_batch_response.rb +211 -0
- data/lib/algolia/models/composition/search.rb +217 -0
- data/lib/algolia/models/composition/search_composition_rules_params.rb +261 -0
- data/lib/algolia/models/composition/search_composition_rules_response.rb +249 -0
- data/lib/algolia/models/composition/search_source.rb +211 -0
- data/lib/algolia/models/composition/task_id_response.rb +211 -0
- data/lib/algolia/models/composition/task_status.rb +34 -0
- data/lib/algolia/models/composition/time_range.rb +219 -0
- data/lib/algolia/models/composition/typo_tolerance.rb +110 -0
- data/lib/algolia/models/composition/typo_tolerance_enum.rb +36 -0
- data/lib/algolia/models/ingestion/task_replace.rb +310 -0
- data/lib/algolia/models/ingestion/task_update.rb +1 -1
- data/lib/algolia/models/search/consequence.rb +1 -1
- data/lib/algolia/transport/transport.rb +6 -1
- data/lib/algolia/version.rb +1 -1
- metadata +55 -1
@@ -2086,6 +2086,7 @@ module Algolia
|
|
2086
2086
|
# @param page [Integer] Page number of the paginated API response.
|
2087
2087
|
# @param sort [TransformationSortKeys] Property by which to sort the list of transformations. (default to 'createdAt')
|
2088
2088
|
# @param order [OrderKeys] Sort order of the response, ascending or descending. (default to 'desc')
|
2089
|
+
# @param type [TransformationType] Whether to filter the list of transformations by the type of transformation.
|
2089
2090
|
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
2090
2091
|
# @return [Http::Response] the response
|
2091
2092
|
def list_transformations_with_http_info(
|
@@ -2093,6 +2094,7 @@ module Algolia
|
|
2093
2094
|
page = nil,
|
2094
2095
|
sort = nil,
|
2095
2096
|
order = nil,
|
2097
|
+
type = nil,
|
2096
2098
|
request_options = {}
|
2097
2099
|
)
|
2098
2100
|
path = "/1/transformations"
|
@@ -2101,6 +2103,7 @@ module Algolia
|
|
2101
2103
|
query_params[:page] = page unless page.nil?
|
2102
2104
|
query_params[:sort] = sort unless sort.nil?
|
2103
2105
|
query_params[:order] = order unless order.nil?
|
2106
|
+
query_params[:type] = type unless type.nil?
|
2104
2107
|
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
2105
2108
|
header_params = {}
|
2106
2109
|
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
@@ -2128,10 +2131,18 @@ module Algolia
|
|
2128
2131
|
# @param page [Integer] Page number of the paginated API response.
|
2129
2132
|
# @param sort [TransformationSortKeys] Property by which to sort the list of transformations. (default to 'createdAt')
|
2130
2133
|
# @param order [OrderKeys] Sort order of the response, ascending or descending. (default to 'desc')
|
2134
|
+
# @param type [TransformationType] Whether to filter the list of transformations by the type of transformation.
|
2131
2135
|
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
2132
2136
|
# @return [ListTransformationsResponse]
|
2133
|
-
def list_transformations(
|
2134
|
-
|
2137
|
+
def list_transformations(
|
2138
|
+
items_per_page = nil,
|
2139
|
+
page = nil,
|
2140
|
+
sort = nil,
|
2141
|
+
order = nil,
|
2142
|
+
type = nil,
|
2143
|
+
request_options = {}
|
2144
|
+
)
|
2145
|
+
response = list_transformations_with_http_info(items_per_page, page, sort, order, type, request_options)
|
2135
2146
|
@api_client.deserialize(
|
2136
2147
|
response.body,
|
2137
2148
|
request_options[:debug_return_type] || "Ingestion::ListTransformationsResponse"
|
@@ -2206,7 +2217,7 @@ module Algolia
|
|
2206
2217
|
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Ingestion::WatchResponse")
|
2207
2218
|
end
|
2208
2219
|
|
2209
|
-
# Pushes records through the
|
2220
|
+
# Pushes records through the pipeline, directly to an index. You can make the call synchronous by providing the `watch` parameter, for asynchronous calls, you can use the observability endpoints or the debugger dashboard to see the status of your task. If you want to transform your data before indexing, this is the recommended way of ingesting your records. This method is similar to `push`, but requires a `taskID` instead of a `indexName`, which is useful when many `destinations` target the same `indexName`.
|
2210
2221
|
#
|
2211
2222
|
# Required API Key ACLs:
|
2212
2223
|
# - addObject
|
@@ -2249,7 +2260,7 @@ module Algolia
|
|
2249
2260
|
@api_client.call_api(:POST, path, new_options)
|
2250
2261
|
end
|
2251
2262
|
|
2252
|
-
# Pushes records through the
|
2263
|
+
# Pushes records through the pipeline, directly to an index. You can make the call synchronous by providing the `watch` parameter, for asynchronous calls, you can use the observability endpoints or the debugger dashboard to see the status of your task. If you want to transform your data before indexing, this is the recommended way of ingesting your records. This method is similar to `push`, but requires a `taskID` instead of a `indexName`, which is useful when many `destinations` target the same `indexName`.
|
2253
2264
|
#
|
2254
2265
|
# Required API Key ACLs:
|
2255
2266
|
# - addObject
|
@@ -2265,6 +2276,52 @@ module Algolia
|
|
2265
2276
|
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Ingestion::WatchResponse")
|
2266
2277
|
end
|
2267
2278
|
|
2279
|
+
# Fully updates a task by its ID, use partialUpdateTask if you only want to update a subset of fields.
|
2280
|
+
|
2281
|
+
# @param task_id [String] Unique identifier of a task. (required)
|
2282
|
+
# @param task_replace [TaskReplace] (required)
|
2283
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
2284
|
+
# @return [Http::Response] the response
|
2285
|
+
def replace_task_with_http_info(task_id, task_replace, request_options = {})
|
2286
|
+
# verify the required parameter 'task_id' is set
|
2287
|
+
if @api_client.config.client_side_validation && task_id.nil?
|
2288
|
+
raise ArgumentError, "Parameter `task_id` is required when calling `replace_task`."
|
2289
|
+
end
|
2290
|
+
# verify the required parameter 'task_replace' is set
|
2291
|
+
if @api_client.config.client_side_validation && task_replace.nil?
|
2292
|
+
raise ArgumentError, "Parameter `task_replace` is required when calling `replace_task`."
|
2293
|
+
end
|
2294
|
+
|
2295
|
+
path = "/2/tasks/{taskID}".sub("{" + "taskID" + "}", Transport.encode_uri(task_id.to_s))
|
2296
|
+
query_params = {}
|
2297
|
+
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
2298
|
+
header_params = {}
|
2299
|
+
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
2300
|
+
|
2301
|
+
post_body = request_options[:debug_body] || @api_client.object_to_http_body(task_replace)
|
2302
|
+
|
2303
|
+
new_options = request_options.merge(
|
2304
|
+
:operation => :"IngestionClient.replace_task",
|
2305
|
+
:header_params => header_params,
|
2306
|
+
:query_params => query_params,
|
2307
|
+
:body => post_body,
|
2308
|
+
:use_read_transporter => false
|
2309
|
+
)
|
2310
|
+
|
2311
|
+
@api_client.call_api(:PUT, path, new_options)
|
2312
|
+
end
|
2313
|
+
|
2314
|
+
# Fully updates a task by its ID, use partialUpdateTask if you only want to update a subset of fields.
|
2315
|
+
|
2316
|
+
# @param task_id [String] Unique identifier of a task. (required)
|
2317
|
+
# @param task_replace [TaskReplace] (required)
|
2318
|
+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
2319
|
+
# @return [TaskUpdateResponse]
|
2320
|
+
def replace_task(task_id, task_replace, request_options = {})
|
2321
|
+
response = replace_task_with_http_info(task_id, task_replace, request_options)
|
2322
|
+
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Ingestion::TaskUpdateResponse")
|
2323
|
+
end
|
2324
|
+
|
2268
2325
|
# Runs all tasks linked to a source, only available for Shopify, BigCommerce and commercetools sources. Creates one run per task.
|
2269
2326
|
#
|
2270
2327
|
# Required API Key ACLs:
|
@@ -3046,7 +3103,7 @@ module Algolia
|
|
3046
3103
|
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Ingestion::SourceUpdateResponse")
|
3047
3104
|
end
|
3048
3105
|
|
3049
|
-
#
|
3106
|
+
# Partially updates a task by its ID.
|
3050
3107
|
|
3051
3108
|
# @param task_id [String] Unique identifier of a task. (required)
|
3052
3109
|
# @param task_update [TaskUpdate] (required)
|
@@ -3081,7 +3138,7 @@ module Algolia
|
|
3081
3138
|
@api_client.call_api(:PATCH, path, new_options)
|
3082
3139
|
end
|
3083
3140
|
|
3084
|
-
#
|
3141
|
+
# Partially updates a task by its ID.
|
3085
3142
|
|
3086
3143
|
# @param task_id [String] Unique identifier of a task. (required)
|
3087
3144
|
# @param task_update [TaskUpdate] (required)
|
@@ -1503,9 +1503,10 @@ module Algolia
|
|
1503
1503
|
# Required API Key ACLs:
|
1504
1504
|
# - settings
|
1505
1505
|
# @param index_name [String] Name of the index on which to perform the operation. (required)
|
1506
|
+
# @param get_version [Integer] When set to 2, the endpoint will not include `synonyms` in the response. This parameter is here for backward compatibility. (default to 1)
|
1506
1507
|
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
1507
1508
|
# @return [Http::Response] the response
|
1508
|
-
def get_settings_with_http_info(index_name, request_options = {})
|
1509
|
+
def get_settings_with_http_info(index_name, get_version = nil, request_options = {})
|
1509
1510
|
# verify the required parameter 'index_name' is set
|
1510
1511
|
if @api_client.config.client_side_validation && index_name.nil?
|
1511
1512
|
raise ArgumentError, "Parameter `index_name` is required when calling `get_settings`."
|
@@ -1513,6 +1514,7 @@ module Algolia
|
|
1513
1514
|
|
1514
1515
|
path = "/1/indexes/{indexName}/settings".sub("{" + "indexName" + "}", Transport.encode_uri(index_name.to_s))
|
1515
1516
|
query_params = {}
|
1517
|
+
query_params[:getVersion] = get_version unless get_version.nil?
|
1516
1518
|
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
1517
1519
|
header_params = {}
|
1518
1520
|
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
@@ -1535,10 +1537,11 @@ module Algolia
|
|
1535
1537
|
# Required API Key ACLs:
|
1536
1538
|
# - settings
|
1537
1539
|
# @param index_name [String] Name of the index on which to perform the operation. (required)
|
1540
|
+
# @param get_version [Integer] When set to 2, the endpoint will not include `synonyms` in the response. This parameter is here for backward compatibility. (default to 1)
|
1538
1541
|
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
1539
1542
|
# @return [SettingsResponse]
|
1540
|
-
def get_settings(index_name, request_options = {})
|
1541
|
-
response = get_settings_with_http_info(index_name, request_options)
|
1543
|
+
def get_settings(index_name, get_version = nil, request_options = {})
|
1544
|
+
response = get_settings_with_http_info(index_name, get_version, request_options)
|
1542
1545
|
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Search::SettingsResponse")
|
1543
1546
|
end
|
1544
1547
|
|
@@ -3269,7 +3272,8 @@ module Algolia
|
|
3269
3272
|
def browse_rules(index_name, search_rules_params = Search::SearchRulesParams.new, request_options = {}, &block)
|
3270
3273
|
search_rules_params = api_client.object_to_hash(search_rules_params)
|
3271
3274
|
|
3272
|
-
search_rules_params[:
|
3275
|
+
search_rules_params[:page] ||= 0
|
3276
|
+
search_rules_params[:hitsPerPage] ||= 1000
|
3273
3277
|
|
3274
3278
|
rules = []
|
3275
3279
|
loop do
|
@@ -3303,7 +3307,8 @@ module Algolia
|
|
3303
3307
|
)
|
3304
3308
|
search_synonyms_params = api_client.object_to_hash(search_synonyms_params)
|
3305
3309
|
|
3306
|
-
search_synonyms_params[:
|
3310
|
+
search_synonyms_params[:page] ||= 0
|
3311
|
+
search_synonyms_params[:hitsPerPage] ||= 1000
|
3307
3312
|
|
3308
3313
|
synonyms = []
|
3309
3314
|
loop do
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# 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.
|
4
|
+
|
5
|
+
require "date"
|
6
|
+
require "time"
|
7
|
+
|
8
|
+
module Algolia
|
9
|
+
module Composition
|
10
|
+
class Action
|
11
|
+
UPSERT = "upsert".freeze
|
12
|
+
DELETE = "delete".freeze
|
13
|
+
|
14
|
+
def self.all_vars
|
15
|
+
@all_vars ||= [UPSERT, DELETE].freeze
|
16
|
+
end
|
17
|
+
|
18
|
+
# Builds the enum from string
|
19
|
+
# @param [String] The enum value in the form of the string
|
20
|
+
# @return [String] The enum value
|
21
|
+
def self.build_from_hash(value)
|
22
|
+
new.build_from_hash(value)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Builds the enum from string
|
26
|
+
# @param [String] The enum value in the form of the string
|
27
|
+
# @return [String] The enum value
|
28
|
+
def build_from_hash(value)
|
29
|
+
return value if Action.all_vars.include?(value)
|
30
|
+
raise "Invalid ENUM value #{value} for class #Action"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# 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.
|
4
|
+
|
5
|
+
require "date"
|
6
|
+
require "time"
|
7
|
+
|
8
|
+
module Algolia
|
9
|
+
module Composition
|
10
|
+
class AdvancedSyntaxFeatures
|
11
|
+
EXACT_PHRASE = "exactPhrase".freeze
|
12
|
+
EXCLUDE_WORDS = "excludeWords".freeze
|
13
|
+
|
14
|
+
def self.all_vars
|
15
|
+
@all_vars ||= [EXACT_PHRASE, EXCLUDE_WORDS].freeze
|
16
|
+
end
|
17
|
+
|
18
|
+
# Builds the enum from string
|
19
|
+
# @param [String] The enum value in the form of the string
|
20
|
+
# @return [String] The enum value
|
21
|
+
def self.build_from_hash(value)
|
22
|
+
new.build_from_hash(value)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Builds the enum from string
|
26
|
+
# @param [String] The enum value in the form of the string
|
27
|
+
# @return [String] The enum value
|
28
|
+
def build_from_hash(value)
|
29
|
+
return value if AdvancedSyntaxFeatures.all_vars.include?(value)
|
30
|
+
raise "Invalid ENUM value #{value} for class #AdvancedSyntaxFeatures"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# 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.
|
4
|
+
|
5
|
+
require "date"
|
6
|
+
require "time"
|
7
|
+
|
8
|
+
module Algolia
|
9
|
+
module Composition
|
10
|
+
class AlternativesAsExact
|
11
|
+
IGNORE_PLURALS = "ignorePlurals".freeze
|
12
|
+
SINGLE_WORD_SYNONYM = "singleWordSynonym".freeze
|
13
|
+
MULTI_WORDS_SYNONYM = "multiWordsSynonym".freeze
|
14
|
+
IGNORE_CONJUGATIONS = "ignoreConjugations".freeze
|
15
|
+
|
16
|
+
def self.all_vars
|
17
|
+
@all_vars ||= [IGNORE_PLURALS, SINGLE_WORD_SYNONYM, MULTI_WORDS_SYNONYM, IGNORE_CONJUGATIONS].freeze
|
18
|
+
end
|
19
|
+
|
20
|
+
# Builds the enum from string
|
21
|
+
# @param [String] The enum value in the form of the string
|
22
|
+
# @return [String] The enum value
|
23
|
+
def self.build_from_hash(value)
|
24
|
+
new.build_from_hash(value)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Builds the enum from string
|
28
|
+
# @param [String] The enum value in the form of the string
|
29
|
+
# @return [String] The enum value
|
30
|
+
def build_from_hash(value)
|
31
|
+
return value if AlternativesAsExact.all_vars.include?(value)
|
32
|
+
raise "Invalid ENUM value #{value} for class #AlternativesAsExact"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# 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.
|
4
|
+
|
5
|
+
require "date"
|
6
|
+
require "time"
|
7
|
+
|
8
|
+
module Algolia
|
9
|
+
module Composition
|
10
|
+
class Anchoring
|
11
|
+
IS = "is".freeze
|
12
|
+
STARTS_WITH = "startsWith".freeze
|
13
|
+
ENDS_WITH = "endsWith".freeze
|
14
|
+
CONTAINS = "contains".freeze
|
15
|
+
|
16
|
+
def self.all_vars
|
17
|
+
@all_vars ||= [IS, STARTS_WITH, ENDS_WITH, CONTAINS].freeze
|
18
|
+
end
|
19
|
+
|
20
|
+
# Builds the enum from string
|
21
|
+
# @param [String] The enum value in the form of the string
|
22
|
+
# @return [String] The enum value
|
23
|
+
def self.build_from_hash(value)
|
24
|
+
new.build_from_hash(value)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Builds the enum from string
|
28
|
+
# @param [String] The enum value in the form of the string
|
29
|
+
# @return [String] The enum value
|
30
|
+
def build_from_hash(value)
|
31
|
+
return value if Anchoring.all_vars.include?(value)
|
32
|
+
raise "Invalid ENUM value #{value} for class #Anchoring"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|