algolia 3.42.1 → 3.42.3
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/do-not-edit-this-repository.yml +1 -1
- data/.github/workflows/release.yml +2 -2
- data/CHANGELOG.md +11 -0
- data/Gemfile.lock +4 -4
- data/lib/algolia/api/search_client.rb +16 -0
- data/lib/algolia/api_client.rb +4 -0
- data/lib/algolia/models/recommend/fallback_params.rb +18 -50
- data/lib/algolia/models/recommend/recommend_search_params.rb +15 -49
- data/lib/algolia/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c7ee727296f4ef0f5097f1e9a17f8b76e0a2e04303aeaaa1b84a78a8cc3e899e
|
|
4
|
+
data.tar.gz: 340f56004e8c495e8585bf43dc0b5a8cf36208c69b239b3d029e7b6b9428e8b7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0c50e49997bdfb4101478f6800ce76397c73d51e7755a1c7c425e6c6565d7c4435c04d792707fbee1c1cc3efc7a7cc8ef2fea740312d579651338c4cac953563
|
|
7
|
+
data.tar.gz: 2d38395ca0ec5f708b0ba6a3210ff2c60d988829aac5cf80b8de2e767f408722932c899e86902555df17d064569612d9bf86ed5f115f9ee4f6bdff3c1b8a6821
|
|
@@ -16,12 +16,12 @@ jobs:
|
|
|
16
16
|
id-token: write
|
|
17
17
|
contents: write
|
|
18
18
|
steps:
|
|
19
|
-
- uses: actions/checkout@
|
|
19
|
+
- uses: actions/checkout@v7
|
|
20
20
|
|
|
21
21
|
- name: Install Ruby
|
|
22
22
|
uses: ruby/setup-ruby@v1
|
|
23
23
|
with:
|
|
24
|
-
ruby-version: 4.0.
|
|
24
|
+
ruby-version: 4.0.5
|
|
25
25
|
bundler-cache: true
|
|
26
26
|
|
|
27
27
|
- uses: rubygems/release-gem@e9a6361a0b14562539327c2a02373edc56dd3169
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## [3.42.3](https://github.com/algolia/algoliasearch-client-ruby/compare/3.42.2...3.42.3)
|
|
2
|
+
|
|
3
|
+
- [772f7055cc](https://github.com/algolia/api-clients-automation/commit/772f7055cc) fix(clients): add warning in replace_all_objects for empty objects ([#6610](https://github.com/algolia/api-clients-automation/pull/6610)) by [@eric-zaharia](https://github.com/eric-zaharia/)
|
|
4
|
+
- [ac68c1a79c](https://github.com/algolia/api-clients-automation/commit/ac68c1a79c) fix(specs): add facetFilters back to recommend fallbackParameters ([#6727](https://github.com/algolia/api-clients-automation/pull/6727)) by [@raed667](https://github.com/raed667/)
|
|
5
|
+
|
|
6
|
+
## [3.42.2](https://github.com/algolia/algoliasearch-client-ruby/compare/3.42.1...3.42.2)
|
|
7
|
+
|
|
8
|
+
- [035c03ecad](https://github.com/algolia/api-clients-automation/commit/035c03ecad) fix(specs): BREAKING CHANGE – remove recommend query params overridden by the API ([#6604](https://github.com/algolia/api-clients-automation/pull/6604)) by [@raed667](https://github.com/raed667/)
|
|
9
|
+
- The `ranking`, `facetFilters`, and `enableABTest` parameters have been removed from the Recommend request, and `enableRules` from its fallback parameters, as the Recommend API ignores them. API behavior is unchanged, but code setting these fields must be updated.
|
|
10
|
+
- [5031c65633](https://github.com/algolia/api-clients-automation/commit/5031c65633) chore(deps): dependencies 2026-06-15 ([#6508](https://github.com/algolia/api-clients-automation/pull/6508)) by [@algolia-api-clients-automation-bot[bot]](https://github.com/apps/algolia-api-clients-automation-bot)
|
|
11
|
+
|
|
1
12
|
## [3.42.1](https://github.com/algolia/algoliasearch-client-ruby/compare/3.42.0...3.42.1)
|
|
2
13
|
|
|
3
14
|
- [a676cd9cef](https://github.com/algolia/api-clients-automation/commit/a676cd9cef) fix(clients): bump replaceAllObjects default maxRetries from 100 to 800 ([#6580](https://github.com/algolia/api-clients-automation/pull/6580)) by [@Fluf22](https://github.com/Fluf22/)
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
algolia (3.42.
|
|
4
|
+
algolia (3.42.3)
|
|
5
5
|
base64 (>= 0.2.0, < 1)
|
|
6
6
|
faraday (>= 1.0.1, < 3.0)
|
|
7
7
|
faraday-net_http_persistent (>= 0.15, < 3)
|
|
@@ -12,16 +12,16 @@ GEM
|
|
|
12
12
|
specs:
|
|
13
13
|
base64 (0.3.0)
|
|
14
14
|
connection_pool (2.5.4)
|
|
15
|
-
faraday (2.14.
|
|
15
|
+
faraday (2.14.3)
|
|
16
16
|
faraday-net_http (>= 2.0, < 3.5)
|
|
17
17
|
json
|
|
18
18
|
logger
|
|
19
|
-
faraday-net_http (3.4.
|
|
19
|
+
faraday-net_http (3.4.4)
|
|
20
20
|
net-http (~> 0.5)
|
|
21
21
|
faraday-net_http_persistent (2.3.1)
|
|
22
22
|
faraday (~> 2.5)
|
|
23
23
|
net-http-persistent (>= 4.0.4, < 5)
|
|
24
|
-
json (2.
|
|
24
|
+
json (2.20.0)
|
|
25
25
|
logger (1.7.0)
|
|
26
26
|
net-http (0.9.1)
|
|
27
27
|
uri (>= 0.11.1)
|
|
@@ -3542,6 +3542,8 @@ module Algolia
|
|
|
3542
3542
|
# in order to transform records before indexing them to Algolia.
|
|
3543
3543
|
# `set_transformation_options` must have been called, or the client created via `SearchClient.with_transformation`.
|
|
3544
3544
|
#
|
|
3545
|
+
# Warning: Calling this method with an empty `objects` array will delete all records currently in the given `index_name`.
|
|
3546
|
+
#
|
|
3545
3547
|
# @param index_name [String] the `index_name` to replace objects in. (required)
|
|
3546
3548
|
# @param objects [Array] the array of objects to store in the given Algolia `index_name`. (required)
|
|
3547
3549
|
# @param batch_size [Integer] the size of each chunk of objects sent in a single push call. (optional, default: 1000)
|
|
@@ -3559,6 +3561,12 @@ module Algolia
|
|
|
3559
3561
|
)
|
|
3560
3562
|
assert_ingestion_transporter!
|
|
3561
3563
|
|
|
3564
|
+
if objects.empty?
|
|
3565
|
+
@api_client.logger.warn(
|
|
3566
|
+
"replace_all_objects_with_transformation was called with an empty list of objects, which will delete all records currently in the \"#{index_name}\" index."
|
|
3567
|
+
)
|
|
3568
|
+
end
|
|
3569
|
+
|
|
3562
3570
|
opts = Algolia::ChunkedHelperOptions.resolve(
|
|
3563
3571
|
chunked_options,
|
|
3564
3572
|
default_max_retries: Algolia::ChunkedHelperOptions::DEFAULT_REPLACE_ALL_OBJECTS_MAX_RETRIES
|
|
@@ -4049,6 +4057,8 @@ module Algolia
|
|
|
4049
4057
|
|
|
4050
4058
|
# Helper: Replaces all objects (records) in the given `index_name` with the given `objects`. A temporary index is created during this process in order to backup your data.
|
|
4051
4059
|
#
|
|
4060
|
+
# Warning: Calling this method with an empty `objects` array will delete all records currently in the given `index_name`.
|
|
4061
|
+
#
|
|
4052
4062
|
# @param index_name [String] The `index_name` to replace `objects` in.
|
|
4053
4063
|
# @param objects [Array] The array of `objects` to store in the given Algolia `index_name`.
|
|
4054
4064
|
# @param batch_size [int] The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
|
|
@@ -4064,6 +4074,12 @@ module Algolia
|
|
|
4064
4074
|
request_options = {},
|
|
4065
4075
|
chunked_options = nil
|
|
4066
4076
|
)
|
|
4077
|
+
if objects.empty?
|
|
4078
|
+
@api_client.logger.warn(
|
|
4079
|
+
"replace_all_objects was called with an empty list of objects, which will delete all records currently in the \"#{index_name}\" index."
|
|
4080
|
+
)
|
|
4081
|
+
end
|
|
4082
|
+
|
|
4067
4083
|
opts = Algolia::ChunkedHelperOptions.resolve(
|
|
4068
4084
|
chunked_options,
|
|
4069
4085
|
default_max_retries: Algolia::ChunkedHelperOptions::DEFAULT_REPLACE_ALL_OBJECTS_MAX_RETRIES
|
data/lib/algolia/api_client.rb
CHANGED
|
@@ -8,11 +8,15 @@ module Algolia
|
|
|
8
8
|
|
|
9
9
|
attr_accessor :transporter
|
|
10
10
|
|
|
11
|
+
# The logger, shared with the requester when it provides one.
|
|
12
|
+
attr_reader :logger
|
|
13
|
+
|
|
11
14
|
# Initializes the ApiClient
|
|
12
15
|
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
|
13
16
|
def initialize(config = Configuration.default)
|
|
14
17
|
@config = config
|
|
15
18
|
@requester = config.requester || Http::HttpRequester.new("net_http_persistent", LoggerHelper.create)
|
|
19
|
+
@logger = (@requester.logger if @requester.respond_to?(:logger)) || LoggerHelper.create
|
|
16
20
|
@transporter = Transport::Transport.new(config, @requester)
|
|
17
21
|
end
|
|
18
22
|
|
|
@@ -7,6 +7,7 @@ require "time"
|
|
|
7
7
|
|
|
8
8
|
module Algolia
|
|
9
9
|
module Recommend
|
|
10
|
+
# Search parameters to use for a fallback request if there aren't enough recommendations.
|
|
10
11
|
class FallbackParams
|
|
11
12
|
# Keywords to be used instead of the search query to conduct a more broader search Using the `similarQuery` parameter changes other settings - `queryType` is set to `prefixNone`. - `removeStopWords` is set to true. - `words` is set as the first ranking criterion. - All remaining words are treated as `optionalWords` Since the `similarQuery` is supposed to do a broad search, they usually return many results. Combine it with `filters` to narrow down the list of results.
|
|
12
13
|
attr_accessor :similar_query
|
|
@@ -14,8 +15,6 @@ module Algolia
|
|
|
14
15
|
# Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `<facet>:<lower> TO <upper>`, where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive). - **Facet filters.** `<facet>:<value>`, where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value. - **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive). - **Boolean filters.** `<facet>: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can't use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can't combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes if the facet attribute name or facet value contains spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering).
|
|
15
16
|
attr_accessor :filters
|
|
16
17
|
|
|
17
|
-
attr_accessor :facet_filters
|
|
18
|
-
|
|
19
18
|
attr_accessor :optional_filters
|
|
20
19
|
|
|
21
20
|
attr_accessor :numeric_filters
|
|
@@ -82,9 +81,6 @@ module Algolia
|
|
|
82
81
|
# Whether to include this search when calculating processing-time percentiles.
|
|
83
82
|
attr_accessor :percentile_computation
|
|
84
83
|
|
|
85
|
-
# Whether to enable A/B testing for this search.
|
|
86
|
-
attr_accessor :enable_ab_test
|
|
87
|
-
|
|
88
84
|
# Search query.
|
|
89
85
|
attr_accessor :query
|
|
90
86
|
|
|
@@ -151,9 +147,6 @@ module Algolia
|
|
|
151
147
|
# Attributes to include in the API response To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included.
|
|
152
148
|
attr_accessor :attributes_to_retrieve
|
|
153
149
|
|
|
154
|
-
# Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If you configure a replica index for [sorting by an attribute](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute), you put the sorting attribute at the top of the list. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing).
|
|
155
|
-
attr_accessor :ranking
|
|
156
|
-
|
|
157
150
|
# Relevancy threshold below which less relevant results aren't included in the results You can only set `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#what-are-virtual-replicas). Use this setting to strike a balance between the relevance and number of returned results.
|
|
158
151
|
attr_accessor :relevancy_strictness
|
|
159
152
|
|
|
@@ -199,9 +192,6 @@ module Algolia
|
|
|
199
192
|
# 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).
|
|
200
193
|
attr_accessor :decompound_query
|
|
201
194
|
|
|
202
|
-
# Whether to enable rules.
|
|
203
|
-
attr_accessor :enable_rules
|
|
204
|
-
|
|
205
195
|
# Whether to enable Personalization.
|
|
206
196
|
attr_accessor :enable_personalization
|
|
207
197
|
|
|
@@ -252,12 +242,13 @@ module Algolia
|
|
|
252
242
|
|
|
253
243
|
attr_accessor :re_ranking_apply_filter
|
|
254
244
|
|
|
245
|
+
attr_accessor :facet_filters
|
|
246
|
+
|
|
255
247
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
256
248
|
def self.attribute_map
|
|
257
249
|
{
|
|
258
250
|
:similar_query => :similarQuery,
|
|
259
251
|
:filters => :filters,
|
|
260
|
-
:facet_filters => :facetFilters,
|
|
261
252
|
:optional_filters => :optionalFilters,
|
|
262
253
|
:numeric_filters => :numericFilters,
|
|
263
254
|
:tag_filters => :tagFilters,
|
|
@@ -282,7 +273,6 @@ module Algolia
|
|
|
282
273
|
:analytics => :analytics,
|
|
283
274
|
:analytics_tags => :analyticsTags,
|
|
284
275
|
:percentile_computation => :percentileComputation,
|
|
285
|
-
:enable_ab_test => :enableABTest,
|
|
286
276
|
:query => :query,
|
|
287
277
|
:attributes_for_faceting => :attributesForFaceting,
|
|
288
278
|
:replicas => :replicas,
|
|
@@ -305,7 +295,6 @@ module Algolia
|
|
|
305
295
|
:keep_diacritics_on_characters => :keepDiacriticsOnCharacters,
|
|
306
296
|
:custom_ranking => :customRanking,
|
|
307
297
|
:attributes_to_retrieve => :attributesToRetrieve,
|
|
308
|
-
:ranking => :ranking,
|
|
309
298
|
:relevancy_strictness => :relevancyStrictness,
|
|
310
299
|
:attributes_to_highlight => :attributesToHighlight,
|
|
311
300
|
:attributes_to_snippet => :attributesToSnippet,
|
|
@@ -322,7 +311,6 @@ module Algolia
|
|
|
322
311
|
:remove_stop_words => :removeStopWords,
|
|
323
312
|
:query_languages => :queryLanguages,
|
|
324
313
|
:decompound_query => :decompoundQuery,
|
|
325
|
-
:enable_rules => :enableRules,
|
|
326
314
|
:enable_personalization => :enablePersonalization,
|
|
327
315
|
:query_type => :queryType,
|
|
328
316
|
:remove_words_if_no_results => :removeWordsIfNoResults,
|
|
@@ -341,7 +329,8 @@ module Algolia
|
|
|
341
329
|
:attribute_criteria_computed_by_min_proximity => :attributeCriteriaComputedByMinProximity,
|
|
342
330
|
:rendering_content => :renderingContent,
|
|
343
331
|
:enable_re_ranking => :enableReRanking,
|
|
344
|
-
:re_ranking_apply_filter => :reRankingApplyFilter
|
|
332
|
+
:re_ranking_apply_filter => :reRankingApplyFilter,
|
|
333
|
+
:facet_filters => :facetFilters
|
|
345
334
|
}
|
|
346
335
|
end
|
|
347
336
|
|
|
@@ -350,7 +339,6 @@ module Algolia
|
|
|
350
339
|
{
|
|
351
340
|
:similar_query => :"String",
|
|
352
341
|
:filters => :"String",
|
|
353
|
-
:facet_filters => :"FacetFilters",
|
|
354
342
|
:optional_filters => :"OptionalFilters",
|
|
355
343
|
:numeric_filters => :"NumericFilters",
|
|
356
344
|
:tag_filters => :"TagFilters",
|
|
@@ -375,7 +363,6 @@ module Algolia
|
|
|
375
363
|
:analytics => :"Boolean",
|
|
376
364
|
:analytics_tags => :"Array<String>",
|
|
377
365
|
:percentile_computation => :"Boolean",
|
|
378
|
-
:enable_ab_test => :"Boolean",
|
|
379
366
|
:query => :"String",
|
|
380
367
|
:attributes_for_faceting => :"Array<String>",
|
|
381
368
|
:replicas => :"Array<String>",
|
|
@@ -398,7 +385,6 @@ module Algolia
|
|
|
398
385
|
:keep_diacritics_on_characters => :"String",
|
|
399
386
|
:custom_ranking => :"Array<String>",
|
|
400
387
|
:attributes_to_retrieve => :"Array<String>",
|
|
401
|
-
:ranking => :"Array<String>",
|
|
402
388
|
:relevancy_strictness => :"Integer",
|
|
403
389
|
:attributes_to_highlight => :"Array<String>",
|
|
404
390
|
:attributes_to_snippet => :"Array<String>",
|
|
@@ -415,7 +401,6 @@ module Algolia
|
|
|
415
401
|
:remove_stop_words => :"RemoveStopWords",
|
|
416
402
|
:query_languages => :"Array<SupportedLanguage>",
|
|
417
403
|
:decompound_query => :"Boolean",
|
|
418
|
-
:enable_rules => :"Boolean",
|
|
419
404
|
:enable_personalization => :"Boolean",
|
|
420
405
|
:query_type => :"QueryType",
|
|
421
406
|
:remove_words_if_no_results => :"RemoveWordsIfNoResults",
|
|
@@ -434,7 +419,8 @@ module Algolia
|
|
|
434
419
|
:attribute_criteria_computed_by_min_proximity => :"Boolean",
|
|
435
420
|
:rendering_content => :"RenderingContent",
|
|
436
421
|
:enable_re_ranking => :"Boolean",
|
|
437
|
-
:re_ranking_apply_filter => :"ReRankingApplyFilter"
|
|
422
|
+
:re_ranking_apply_filter => :"ReRankingApplyFilter",
|
|
423
|
+
:facet_filters => :"FacetFilters"
|
|
438
424
|
}
|
|
439
425
|
end
|
|
440
426
|
|
|
@@ -453,7 +439,9 @@ module Algolia
|
|
|
453
439
|
# List of class defined in allOf (OpenAPI v3)
|
|
454
440
|
def self.openapi_all_of
|
|
455
441
|
[
|
|
456
|
-
:"
|
|
442
|
+
:"BaseRecommendSearchParams",
|
|
443
|
+
:"RecommendIndexSettings",
|
|
444
|
+
:"SearchParamsQuery"
|
|
457
445
|
]
|
|
458
446
|
end
|
|
459
447
|
|
|
@@ -488,10 +476,6 @@ module Algolia
|
|
|
488
476
|
self.filters = attributes[:filters]
|
|
489
477
|
end
|
|
490
478
|
|
|
491
|
-
if attributes.key?(:facet_filters)
|
|
492
|
-
self.facet_filters = attributes[:facet_filters]
|
|
493
|
-
end
|
|
494
|
-
|
|
495
479
|
if attributes.key?(:optional_filters)
|
|
496
480
|
self.optional_filters = attributes[:optional_filters]
|
|
497
481
|
end
|
|
@@ -600,10 +584,6 @@ module Algolia
|
|
|
600
584
|
self.percentile_computation = attributes[:percentile_computation]
|
|
601
585
|
end
|
|
602
586
|
|
|
603
|
-
if attributes.key?(:enable_ab_test)
|
|
604
|
-
self.enable_ab_test = attributes[:enable_ab_test]
|
|
605
|
-
end
|
|
606
|
-
|
|
607
587
|
if attributes.key?(:query)
|
|
608
588
|
self.query = attributes[:query]
|
|
609
589
|
end
|
|
@@ -718,12 +698,6 @@ module Algolia
|
|
|
718
698
|
end
|
|
719
699
|
end
|
|
720
700
|
|
|
721
|
-
if attributes.key?(:ranking)
|
|
722
|
-
if (value = attributes[:ranking]).is_a?(Array)
|
|
723
|
-
self.ranking = value
|
|
724
|
-
end
|
|
725
|
-
end
|
|
726
|
-
|
|
727
701
|
if attributes.key?(:relevancy_strictness)
|
|
728
702
|
self.relevancy_strictness = attributes[:relevancy_strictness]
|
|
729
703
|
end
|
|
@@ -796,10 +770,6 @@ module Algolia
|
|
|
796
770
|
self.decompound_query = attributes[:decompound_query]
|
|
797
771
|
end
|
|
798
772
|
|
|
799
|
-
if attributes.key?(:enable_rules)
|
|
800
|
-
self.enable_rules = attributes[:enable_rules]
|
|
801
|
-
end
|
|
802
|
-
|
|
803
773
|
if attributes.key?(:enable_personalization)
|
|
804
774
|
self.enable_personalization = attributes[:enable_personalization]
|
|
805
775
|
end
|
|
@@ -883,6 +853,10 @@ module Algolia
|
|
|
883
853
|
if attributes.key?(:re_ranking_apply_filter)
|
|
884
854
|
self.re_ranking_apply_filter = attributes[:re_ranking_apply_filter]
|
|
885
855
|
end
|
|
856
|
+
|
|
857
|
+
if attributes.key?(:facet_filters)
|
|
858
|
+
self.facet_filters = attributes[:facet_filters]
|
|
859
|
+
end
|
|
886
860
|
end
|
|
887
861
|
|
|
888
862
|
# Checks equality by comparing each attribute.
|
|
@@ -892,7 +866,6 @@ module Algolia
|
|
|
892
866
|
self.class == other.class &&
|
|
893
867
|
similar_query == other.similar_query &&
|
|
894
868
|
filters == other.filters &&
|
|
895
|
-
facet_filters == other.facet_filters &&
|
|
896
869
|
optional_filters == other.optional_filters &&
|
|
897
870
|
numeric_filters == other.numeric_filters &&
|
|
898
871
|
tag_filters == other.tag_filters &&
|
|
@@ -917,7 +890,6 @@ module Algolia
|
|
|
917
890
|
analytics == other.analytics &&
|
|
918
891
|
analytics_tags == other.analytics_tags &&
|
|
919
892
|
percentile_computation == other.percentile_computation &&
|
|
920
|
-
enable_ab_test == other.enable_ab_test &&
|
|
921
893
|
query == other.query &&
|
|
922
894
|
attributes_for_faceting == other.attributes_for_faceting &&
|
|
923
895
|
replicas == other.replicas &&
|
|
@@ -940,7 +912,6 @@ module Algolia
|
|
|
940
912
|
keep_diacritics_on_characters == other.keep_diacritics_on_characters &&
|
|
941
913
|
custom_ranking == other.custom_ranking &&
|
|
942
914
|
attributes_to_retrieve == other.attributes_to_retrieve &&
|
|
943
|
-
ranking == other.ranking &&
|
|
944
915
|
relevancy_strictness == other.relevancy_strictness &&
|
|
945
916
|
attributes_to_highlight == other.attributes_to_highlight &&
|
|
946
917
|
attributes_to_snippet == other.attributes_to_snippet &&
|
|
@@ -957,7 +928,6 @@ module Algolia
|
|
|
957
928
|
remove_stop_words == other.remove_stop_words &&
|
|
958
929
|
query_languages == other.query_languages &&
|
|
959
930
|
decompound_query == other.decompound_query &&
|
|
960
|
-
enable_rules == other.enable_rules &&
|
|
961
931
|
enable_personalization == other.enable_personalization &&
|
|
962
932
|
query_type == other.query_type &&
|
|
963
933
|
remove_words_if_no_results == other.remove_words_if_no_results &&
|
|
@@ -976,7 +946,8 @@ module Algolia
|
|
|
976
946
|
attribute_criteria_computed_by_min_proximity == other.attribute_criteria_computed_by_min_proximity &&
|
|
977
947
|
rendering_content == other.rendering_content &&
|
|
978
948
|
enable_re_ranking == other.enable_re_ranking &&
|
|
979
|
-
re_ranking_apply_filter == other.re_ranking_apply_filter
|
|
949
|
+
re_ranking_apply_filter == other.re_ranking_apply_filter &&
|
|
950
|
+
facet_filters == other.facet_filters
|
|
980
951
|
end
|
|
981
952
|
|
|
982
953
|
# @see the `==` method
|
|
@@ -991,7 +962,6 @@ module Algolia
|
|
|
991
962
|
[
|
|
992
963
|
similar_query,
|
|
993
964
|
filters,
|
|
994
|
-
facet_filters,
|
|
995
965
|
optional_filters,
|
|
996
966
|
numeric_filters,
|
|
997
967
|
tag_filters,
|
|
@@ -1016,7 +986,6 @@ module Algolia
|
|
|
1016
986
|
analytics,
|
|
1017
987
|
analytics_tags,
|
|
1018
988
|
percentile_computation,
|
|
1019
|
-
enable_ab_test,
|
|
1020
989
|
query,
|
|
1021
990
|
attributes_for_faceting,
|
|
1022
991
|
replicas,
|
|
@@ -1039,7 +1008,6 @@ module Algolia
|
|
|
1039
1008
|
keep_diacritics_on_characters,
|
|
1040
1009
|
custom_ranking,
|
|
1041
1010
|
attributes_to_retrieve,
|
|
1042
|
-
ranking,
|
|
1043
1011
|
relevancy_strictness,
|
|
1044
1012
|
attributes_to_highlight,
|
|
1045
1013
|
attributes_to_snippet,
|
|
@@ -1056,7 +1024,6 @@ module Algolia
|
|
|
1056
1024
|
remove_stop_words,
|
|
1057
1025
|
query_languages,
|
|
1058
1026
|
decompound_query,
|
|
1059
|
-
enable_rules,
|
|
1060
1027
|
enable_personalization,
|
|
1061
1028
|
query_type,
|
|
1062
1029
|
remove_words_if_no_results,
|
|
@@ -1075,7 +1042,8 @@ module Algolia
|
|
|
1075
1042
|
attribute_criteria_computed_by_min_proximity,
|
|
1076
1043
|
rendering_content,
|
|
1077
1044
|
enable_re_ranking,
|
|
1078
|
-
re_ranking_apply_filter
|
|
1045
|
+
re_ranking_apply_filter,
|
|
1046
|
+
facet_filters
|
|
1079
1047
|
].hash
|
|
1080
1048
|
end
|
|
1081
1049
|
|
|
@@ -15,8 +15,6 @@ module Algolia
|
|
|
15
15
|
# Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `<facet>:<lower> TO <upper>`, where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive). - **Facet filters.** `<facet>:<value>`, where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value. - **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive). - **Boolean filters.** `<facet>: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can't use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can't combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes if the facet attribute name or facet value contains spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering).
|
|
16
16
|
attr_accessor :filters
|
|
17
17
|
|
|
18
|
-
attr_accessor :facet_filters
|
|
19
|
-
|
|
20
18
|
attr_accessor :optional_filters
|
|
21
19
|
|
|
22
20
|
attr_accessor :numeric_filters
|
|
@@ -83,9 +81,6 @@ module Algolia
|
|
|
83
81
|
# Whether to include this search when calculating processing-time percentiles.
|
|
84
82
|
attr_accessor :percentile_computation
|
|
85
83
|
|
|
86
|
-
# Whether to enable A/B testing for this search.
|
|
87
|
-
attr_accessor :enable_ab_test
|
|
88
|
-
|
|
89
84
|
# Search query.
|
|
90
85
|
attr_accessor :query
|
|
91
86
|
|
|
@@ -152,9 +147,6 @@ module Algolia
|
|
|
152
147
|
# Attributes to include in the API response To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included.
|
|
153
148
|
attr_accessor :attributes_to_retrieve
|
|
154
149
|
|
|
155
|
-
# Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If you configure a replica index for [sorting by an attribute](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute), you put the sorting attribute at the top of the list. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing).
|
|
156
|
-
attr_accessor :ranking
|
|
157
|
-
|
|
158
150
|
# Relevancy threshold below which less relevant results aren't included in the results You can only set `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#what-are-virtual-replicas). Use this setting to strike a balance between the relevance and number of returned results.
|
|
159
151
|
attr_accessor :relevancy_strictness
|
|
160
152
|
|
|
@@ -200,9 +192,6 @@ module Algolia
|
|
|
200
192
|
# 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).
|
|
201
193
|
attr_accessor :decompound_query
|
|
202
194
|
|
|
203
|
-
# Whether to enable rules.
|
|
204
|
-
attr_accessor :enable_rules
|
|
205
|
-
|
|
206
195
|
# Whether to enable Personalization.
|
|
207
196
|
attr_accessor :enable_personalization
|
|
208
197
|
|
|
@@ -253,12 +242,14 @@ module Algolia
|
|
|
253
242
|
|
|
254
243
|
attr_accessor :re_ranking_apply_filter
|
|
255
244
|
|
|
245
|
+
# Whether to enable rules.
|
|
246
|
+
attr_accessor :enable_rules
|
|
247
|
+
|
|
256
248
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
257
249
|
def self.attribute_map
|
|
258
250
|
{
|
|
259
251
|
:similar_query => :similarQuery,
|
|
260
252
|
:filters => :filters,
|
|
261
|
-
:facet_filters => :facetFilters,
|
|
262
253
|
:optional_filters => :optionalFilters,
|
|
263
254
|
:numeric_filters => :numericFilters,
|
|
264
255
|
:tag_filters => :tagFilters,
|
|
@@ -283,7 +274,6 @@ module Algolia
|
|
|
283
274
|
:analytics => :analytics,
|
|
284
275
|
:analytics_tags => :analyticsTags,
|
|
285
276
|
:percentile_computation => :percentileComputation,
|
|
286
|
-
:enable_ab_test => :enableABTest,
|
|
287
277
|
:query => :query,
|
|
288
278
|
:attributes_for_faceting => :attributesForFaceting,
|
|
289
279
|
:replicas => :replicas,
|
|
@@ -306,7 +296,6 @@ module Algolia
|
|
|
306
296
|
:keep_diacritics_on_characters => :keepDiacriticsOnCharacters,
|
|
307
297
|
:custom_ranking => :customRanking,
|
|
308
298
|
:attributes_to_retrieve => :attributesToRetrieve,
|
|
309
|
-
:ranking => :ranking,
|
|
310
299
|
:relevancy_strictness => :relevancyStrictness,
|
|
311
300
|
:attributes_to_highlight => :attributesToHighlight,
|
|
312
301
|
:attributes_to_snippet => :attributesToSnippet,
|
|
@@ -323,7 +312,6 @@ module Algolia
|
|
|
323
312
|
:remove_stop_words => :removeStopWords,
|
|
324
313
|
:query_languages => :queryLanguages,
|
|
325
314
|
:decompound_query => :decompoundQuery,
|
|
326
|
-
:enable_rules => :enableRules,
|
|
327
315
|
:enable_personalization => :enablePersonalization,
|
|
328
316
|
:query_type => :queryType,
|
|
329
317
|
:remove_words_if_no_results => :removeWordsIfNoResults,
|
|
@@ -342,7 +330,8 @@ module Algolia
|
|
|
342
330
|
:attribute_criteria_computed_by_min_proximity => :attributeCriteriaComputedByMinProximity,
|
|
343
331
|
:rendering_content => :renderingContent,
|
|
344
332
|
:enable_re_ranking => :enableReRanking,
|
|
345
|
-
:re_ranking_apply_filter => :reRankingApplyFilter
|
|
333
|
+
:re_ranking_apply_filter => :reRankingApplyFilter,
|
|
334
|
+
:enable_rules => :enableRules
|
|
346
335
|
}
|
|
347
336
|
end
|
|
348
337
|
|
|
@@ -351,7 +340,6 @@ module Algolia
|
|
|
351
340
|
{
|
|
352
341
|
:similar_query => :"String",
|
|
353
342
|
:filters => :"String",
|
|
354
|
-
:facet_filters => :"FacetFilters",
|
|
355
343
|
:optional_filters => :"OptionalFilters",
|
|
356
344
|
:numeric_filters => :"NumericFilters",
|
|
357
345
|
:tag_filters => :"TagFilters",
|
|
@@ -376,7 +364,6 @@ module Algolia
|
|
|
376
364
|
:analytics => :"Boolean",
|
|
377
365
|
:analytics_tags => :"Array<String>",
|
|
378
366
|
:percentile_computation => :"Boolean",
|
|
379
|
-
:enable_ab_test => :"Boolean",
|
|
380
367
|
:query => :"String",
|
|
381
368
|
:attributes_for_faceting => :"Array<String>",
|
|
382
369
|
:replicas => :"Array<String>",
|
|
@@ -399,7 +386,6 @@ module Algolia
|
|
|
399
386
|
:keep_diacritics_on_characters => :"String",
|
|
400
387
|
:custom_ranking => :"Array<String>",
|
|
401
388
|
:attributes_to_retrieve => :"Array<String>",
|
|
402
|
-
:ranking => :"Array<String>",
|
|
403
389
|
:relevancy_strictness => :"Integer",
|
|
404
390
|
:attributes_to_highlight => :"Array<String>",
|
|
405
391
|
:attributes_to_snippet => :"Array<String>",
|
|
@@ -416,7 +402,6 @@ module Algolia
|
|
|
416
402
|
:remove_stop_words => :"RemoveStopWords",
|
|
417
403
|
:query_languages => :"Array<SupportedLanguage>",
|
|
418
404
|
:decompound_query => :"Boolean",
|
|
419
|
-
:enable_rules => :"Boolean",
|
|
420
405
|
:enable_personalization => :"Boolean",
|
|
421
406
|
:query_type => :"QueryType",
|
|
422
407
|
:remove_words_if_no_results => :"RemoveWordsIfNoResults",
|
|
@@ -435,7 +420,8 @@ module Algolia
|
|
|
435
420
|
:attribute_criteria_computed_by_min_proximity => :"Boolean",
|
|
436
421
|
:rendering_content => :"RenderingContent",
|
|
437
422
|
:enable_re_ranking => :"Boolean",
|
|
438
|
-
:re_ranking_apply_filter => :"ReRankingApplyFilter"
|
|
423
|
+
:re_ranking_apply_filter => :"ReRankingApplyFilter",
|
|
424
|
+
:enable_rules => :"Boolean"
|
|
439
425
|
}
|
|
440
426
|
end
|
|
441
427
|
|
|
@@ -491,10 +477,6 @@ module Algolia
|
|
|
491
477
|
self.filters = attributes[:filters]
|
|
492
478
|
end
|
|
493
479
|
|
|
494
|
-
if attributes.key?(:facet_filters)
|
|
495
|
-
self.facet_filters = attributes[:facet_filters]
|
|
496
|
-
end
|
|
497
|
-
|
|
498
480
|
if attributes.key?(:optional_filters)
|
|
499
481
|
self.optional_filters = attributes[:optional_filters]
|
|
500
482
|
end
|
|
@@ -603,10 +585,6 @@ module Algolia
|
|
|
603
585
|
self.percentile_computation = attributes[:percentile_computation]
|
|
604
586
|
end
|
|
605
587
|
|
|
606
|
-
if attributes.key?(:enable_ab_test)
|
|
607
|
-
self.enable_ab_test = attributes[:enable_ab_test]
|
|
608
|
-
end
|
|
609
|
-
|
|
610
588
|
if attributes.key?(:query)
|
|
611
589
|
self.query = attributes[:query]
|
|
612
590
|
end
|
|
@@ -721,12 +699,6 @@ module Algolia
|
|
|
721
699
|
end
|
|
722
700
|
end
|
|
723
701
|
|
|
724
|
-
if attributes.key?(:ranking)
|
|
725
|
-
if (value = attributes[:ranking]).is_a?(Array)
|
|
726
|
-
self.ranking = value
|
|
727
|
-
end
|
|
728
|
-
end
|
|
729
|
-
|
|
730
702
|
if attributes.key?(:relevancy_strictness)
|
|
731
703
|
self.relevancy_strictness = attributes[:relevancy_strictness]
|
|
732
704
|
end
|
|
@@ -799,10 +771,6 @@ module Algolia
|
|
|
799
771
|
self.decompound_query = attributes[:decompound_query]
|
|
800
772
|
end
|
|
801
773
|
|
|
802
|
-
if attributes.key?(:enable_rules)
|
|
803
|
-
self.enable_rules = attributes[:enable_rules]
|
|
804
|
-
end
|
|
805
|
-
|
|
806
774
|
if attributes.key?(:enable_personalization)
|
|
807
775
|
self.enable_personalization = attributes[:enable_personalization]
|
|
808
776
|
end
|
|
@@ -886,6 +854,10 @@ module Algolia
|
|
|
886
854
|
if attributes.key?(:re_ranking_apply_filter)
|
|
887
855
|
self.re_ranking_apply_filter = attributes[:re_ranking_apply_filter]
|
|
888
856
|
end
|
|
857
|
+
|
|
858
|
+
if attributes.key?(:enable_rules)
|
|
859
|
+
self.enable_rules = attributes[:enable_rules]
|
|
860
|
+
end
|
|
889
861
|
end
|
|
890
862
|
|
|
891
863
|
# Checks equality by comparing each attribute.
|
|
@@ -895,7 +867,6 @@ module Algolia
|
|
|
895
867
|
self.class == other.class &&
|
|
896
868
|
similar_query == other.similar_query &&
|
|
897
869
|
filters == other.filters &&
|
|
898
|
-
facet_filters == other.facet_filters &&
|
|
899
870
|
optional_filters == other.optional_filters &&
|
|
900
871
|
numeric_filters == other.numeric_filters &&
|
|
901
872
|
tag_filters == other.tag_filters &&
|
|
@@ -920,7 +891,6 @@ module Algolia
|
|
|
920
891
|
analytics == other.analytics &&
|
|
921
892
|
analytics_tags == other.analytics_tags &&
|
|
922
893
|
percentile_computation == other.percentile_computation &&
|
|
923
|
-
enable_ab_test == other.enable_ab_test &&
|
|
924
894
|
query == other.query &&
|
|
925
895
|
attributes_for_faceting == other.attributes_for_faceting &&
|
|
926
896
|
replicas == other.replicas &&
|
|
@@ -943,7 +913,6 @@ module Algolia
|
|
|
943
913
|
keep_diacritics_on_characters == other.keep_diacritics_on_characters &&
|
|
944
914
|
custom_ranking == other.custom_ranking &&
|
|
945
915
|
attributes_to_retrieve == other.attributes_to_retrieve &&
|
|
946
|
-
ranking == other.ranking &&
|
|
947
916
|
relevancy_strictness == other.relevancy_strictness &&
|
|
948
917
|
attributes_to_highlight == other.attributes_to_highlight &&
|
|
949
918
|
attributes_to_snippet == other.attributes_to_snippet &&
|
|
@@ -960,7 +929,6 @@ module Algolia
|
|
|
960
929
|
remove_stop_words == other.remove_stop_words &&
|
|
961
930
|
query_languages == other.query_languages &&
|
|
962
931
|
decompound_query == other.decompound_query &&
|
|
963
|
-
enable_rules == other.enable_rules &&
|
|
964
932
|
enable_personalization == other.enable_personalization &&
|
|
965
933
|
query_type == other.query_type &&
|
|
966
934
|
remove_words_if_no_results == other.remove_words_if_no_results &&
|
|
@@ -979,7 +947,8 @@ module Algolia
|
|
|
979
947
|
attribute_criteria_computed_by_min_proximity == other.attribute_criteria_computed_by_min_proximity &&
|
|
980
948
|
rendering_content == other.rendering_content &&
|
|
981
949
|
enable_re_ranking == other.enable_re_ranking &&
|
|
982
|
-
re_ranking_apply_filter == other.re_ranking_apply_filter
|
|
950
|
+
re_ranking_apply_filter == other.re_ranking_apply_filter &&
|
|
951
|
+
enable_rules == other.enable_rules
|
|
983
952
|
end
|
|
984
953
|
|
|
985
954
|
# @see the `==` method
|
|
@@ -994,7 +963,6 @@ module Algolia
|
|
|
994
963
|
[
|
|
995
964
|
similar_query,
|
|
996
965
|
filters,
|
|
997
|
-
facet_filters,
|
|
998
966
|
optional_filters,
|
|
999
967
|
numeric_filters,
|
|
1000
968
|
tag_filters,
|
|
@@ -1019,7 +987,6 @@ module Algolia
|
|
|
1019
987
|
analytics,
|
|
1020
988
|
analytics_tags,
|
|
1021
989
|
percentile_computation,
|
|
1022
|
-
enable_ab_test,
|
|
1023
990
|
query,
|
|
1024
991
|
attributes_for_faceting,
|
|
1025
992
|
replicas,
|
|
@@ -1042,7 +1009,6 @@ module Algolia
|
|
|
1042
1009
|
keep_diacritics_on_characters,
|
|
1043
1010
|
custom_ranking,
|
|
1044
1011
|
attributes_to_retrieve,
|
|
1045
|
-
ranking,
|
|
1046
1012
|
relevancy_strictness,
|
|
1047
1013
|
attributes_to_highlight,
|
|
1048
1014
|
attributes_to_snippet,
|
|
@@ -1059,7 +1025,6 @@ module Algolia
|
|
|
1059
1025
|
remove_stop_words,
|
|
1060
1026
|
query_languages,
|
|
1061
1027
|
decompound_query,
|
|
1062
|
-
enable_rules,
|
|
1063
1028
|
enable_personalization,
|
|
1064
1029
|
query_type,
|
|
1065
1030
|
remove_words_if_no_results,
|
|
@@ -1078,7 +1043,8 @@ module Algolia
|
|
|
1078
1043
|
attribute_criteria_computed_by_min_proximity,
|
|
1079
1044
|
rendering_content,
|
|
1080
1045
|
enable_re_ranking,
|
|
1081
|
-
re_ranking_apply_filter
|
|
1046
|
+
re_ranking_apply_filter,
|
|
1047
|
+
enable_rules
|
|
1082
1048
|
].hash
|
|
1083
1049
|
end
|
|
1084
1050
|
|
data/lib/algolia/version.rb
CHANGED