Skip to content

Commit faaa38f

Browse files
algolia-botmillotp
andcommitted
fix(specs): move customRanking and keepDiacriticsOnCharacters to indexSettings [skip-bc] (generated)
algolia/api-clients-automation#4324 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent 5efef59 commit faaa38f

File tree

9 files changed

+96
-168
lines changed

9 files changed

+96
-168
lines changed

lib/algolia/models/recommend/fallback_params.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,12 @@ class FallbackParams
140140
# Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values).
141141
attr_accessor :max_facet_hits
142142

143+
# Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep their diacritics.
144+
attr_accessor :keep_diacritics_on_characters
145+
146+
# Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Attribute names are case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria are equal. Records with missing values for your selected custom ranking attributes are always sorted last. Boolean attributes are sorted based on their alphabetical order. **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. If you use two or more custom ranking attributes, [reduce the precision](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/controlling-custom-ranking-metrics-precision/) of your first attributes, or the other attributes will never be applied.
147+
attr_accessor :custom_ranking
148+
143149
# 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.
144150
attr_accessor :attributes_to_retrieve
145151

@@ -294,6 +300,8 @@ def self.attribute_map
294300
:custom_normalization => :customNormalization,
295301
:attribute_for_distinct => :attributeForDistinct,
296302
:max_facet_hits => :maxFacetHits,
303+
:keep_diacritics_on_characters => :keepDiacriticsOnCharacters,
304+
:custom_ranking => :customRanking,
297305
:attributes_to_retrieve => :attributesToRetrieve,
298306
:ranking => :ranking,
299307
:relevancy_strictness => :relevancyStrictness,
@@ -385,6 +393,8 @@ def self.types_mapping
385393
:custom_normalization => :"Hash<String, Hash<String, String>>",
386394
:attribute_for_distinct => :"String",
387395
:max_facet_hits => :"Integer",
396+
:keep_diacritics_on_characters => :"String",
397+
:custom_ranking => :"Array<String>",
388398
:attributes_to_retrieve => :"Array<String>",
389399
:ranking => :"Array<String>",
390400
:relevancy_strictness => :"Integer",
@@ -688,6 +698,16 @@ def initialize(attributes = {})
688698
self.max_facet_hits = attributes[:max_facet_hits]
689699
end
690700

701+
if attributes.key?(:keep_diacritics_on_characters)
702+
self.keep_diacritics_on_characters = attributes[:keep_diacritics_on_characters]
703+
end
704+
705+
if attributes.key?(:custom_ranking)
706+
if (value = attributes[:custom_ranking]).is_a?(Array)
707+
self.custom_ranking = value
708+
end
709+
end
710+
691711
if attributes.key?(:attributes_to_retrieve)
692712
if (value = attributes[:attributes_to_retrieve]).is_a?(Array)
693713
self.attributes_to_retrieve = value
@@ -913,6 +933,8 @@ def ==(other)
913933
custom_normalization == other.custom_normalization &&
914934
attribute_for_distinct == other.attribute_for_distinct &&
915935
max_facet_hits == other.max_facet_hits &&
936+
keep_diacritics_on_characters == other.keep_diacritics_on_characters &&
937+
custom_ranking == other.custom_ranking &&
916938
attributes_to_retrieve == other.attributes_to_retrieve &&
917939
ranking == other.ranking &&
918940
relevancy_strictness == other.relevancy_strictness &&
@@ -1010,6 +1032,8 @@ def hash
10101032
custom_normalization,
10111033
attribute_for_distinct,
10121034
max_facet_hits,
1035+
keep_diacritics_on_characters,
1036+
custom_ranking,
10131037
attributes_to_retrieve,
10141038
ranking,
10151039
relevancy_strictness,

lib/algolia/models/recommend/recommend_search_params.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ class RecommendSearchParams
141141
# Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values).
142142
attr_accessor :max_facet_hits
143143

144+
# Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep their diacritics.
145+
attr_accessor :keep_diacritics_on_characters
146+
147+
# Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Attribute names are case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria are equal. Records with missing values for your selected custom ranking attributes are always sorted last. Boolean attributes are sorted based on their alphabetical order. **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. If you use two or more custom ranking attributes, [reduce the precision](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/controlling-custom-ranking-metrics-precision/) of your first attributes, or the other attributes will never be applied.
148+
attr_accessor :custom_ranking
149+
144150
# 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.
145151
attr_accessor :attributes_to_retrieve
146152

@@ -295,6 +301,8 @@ def self.attribute_map
295301
:custom_normalization => :customNormalization,
296302
:attribute_for_distinct => :attributeForDistinct,
297303
:max_facet_hits => :maxFacetHits,
304+
:keep_diacritics_on_characters => :keepDiacriticsOnCharacters,
305+
:custom_ranking => :customRanking,
298306
:attributes_to_retrieve => :attributesToRetrieve,
299307
:ranking => :ranking,
300308
:relevancy_strictness => :relevancyStrictness,
@@ -386,6 +394,8 @@ def self.types_mapping
386394
:custom_normalization => :"Hash<String, Hash<String, String>>",
387395
:attribute_for_distinct => :"String",
388396
:max_facet_hits => :"Integer",
397+
:keep_diacritics_on_characters => :"String",
398+
:custom_ranking => :"Array<String>",
389399
:attributes_to_retrieve => :"Array<String>",
390400
:ranking => :"Array<String>",
391401
:relevancy_strictness => :"Integer",
@@ -691,6 +701,16 @@ def initialize(attributes = {})
691701
self.max_facet_hits = attributes[:max_facet_hits]
692702
end
693703

704+
if attributes.key?(:keep_diacritics_on_characters)
705+
self.keep_diacritics_on_characters = attributes[:keep_diacritics_on_characters]
706+
end
707+
708+
if attributes.key?(:custom_ranking)
709+
if (value = attributes[:custom_ranking]).is_a?(Array)
710+
self.custom_ranking = value
711+
end
712+
end
713+
694714
if attributes.key?(:attributes_to_retrieve)
695715
if (value = attributes[:attributes_to_retrieve]).is_a?(Array)
696716
self.attributes_to_retrieve = value
@@ -916,6 +936,8 @@ def ==(other)
916936
custom_normalization == other.custom_normalization &&
917937
attribute_for_distinct == other.attribute_for_distinct &&
918938
max_facet_hits == other.max_facet_hits &&
939+
keep_diacritics_on_characters == other.keep_diacritics_on_characters &&
940+
custom_ranking == other.custom_ranking &&
919941
attributes_to_retrieve == other.attributes_to_retrieve &&
920942
ranking == other.ranking &&
921943
relevancy_strictness == other.relevancy_strictness &&
@@ -1013,6 +1035,8 @@ def hash
10131035
custom_normalization,
10141036
attribute_for_distinct,
10151037
max_facet_hits,
1038+
keep_diacritics_on_characters,
1039+
custom_ranking,
10161040
attributes_to_retrieve,
10171041
ranking,
10181042
relevancy_strictness,

lib/algolia/models/search/browse_params_object.rb

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@ class BrowseParamsObject
101101
# 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, you should test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/).
102102
attr_accessor :ranking
103103

104-
# Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Attribute names are case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria are equal. Records with missing values for your selected custom ranking attributes are always sorted last. Boolean attributes are sorted based on their alphabetical order. **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. If you use two or more custom ranking attributes, [reduce the precision](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/controlling-custom-ranking-metrics-precision/) of your first attributes, or the other attributes will never be applied.
105-
attr_accessor :custom_ranking
106-
107104
# 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.
108105
attr_accessor :relevancy_strictness
109106

@@ -146,9 +143,6 @@ class BrowseParamsObject
146143

147144
attr_accessor :remove_stop_words
148145

149-
# Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep their diacritics.
150-
attr_accessor :keep_diacritics_on_characters
151-
152146
# 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/).
153147
attr_accessor :query_languages
154148

@@ -252,7 +246,6 @@ def self.attribute_map
252246
:enable_ab_test => :enableABTest,
253247
:attributes_to_retrieve => :attributesToRetrieve,
254248
:ranking => :ranking,
255-
:custom_ranking => :customRanking,
256249
:relevancy_strictness => :relevancyStrictness,
257250
:attributes_to_highlight => :attributesToHighlight,
258251
:attributes_to_snippet => :attributesToSnippet,
@@ -268,7 +261,6 @@ def self.attribute_map
268261
:disable_typo_tolerance_on_attributes => :disableTypoToleranceOnAttributes,
269262
:ignore_plurals => :ignorePlurals,
270263
:remove_stop_words => :removeStopWords,
271-
:keep_diacritics_on_characters => :keepDiacriticsOnCharacters,
272264
:query_languages => :queryLanguages,
273265
:decompound_query => :decompoundQuery,
274266
:enable_rules => :enableRules,
@@ -334,7 +326,6 @@ def self.types_mapping
334326
:enable_ab_test => :"Boolean",
335327
:attributes_to_retrieve => :"Array<String>",
336328
:ranking => :"Array<String>",
337-
:custom_ranking => :"Array<String>",
338329
:relevancy_strictness => :"Integer",
339330
:attributes_to_highlight => :"Array<String>",
340331
:attributes_to_snippet => :"Array<String>",
@@ -350,7 +341,6 @@ def self.types_mapping
350341
:disable_typo_tolerance_on_attributes => :"Array<String>",
351342
:ignore_plurals => :"IgnorePlurals",
352343
:remove_stop_words => :"RemoveStopWords",
353-
:keep_diacritics_on_characters => :"String",
354344
:query_languages => :"Array<SupportedLanguage>",
355345
:decompound_query => :"Boolean",
356346
:enable_rules => :"Boolean",
@@ -572,12 +562,6 @@ def initialize(attributes = {})
572562
end
573563
end
574564

575-
if attributes.key?(:custom_ranking)
576-
if (value = attributes[:custom_ranking]).is_a?(Array)
577-
self.custom_ranking = value
578-
end
579-
end
580-
581565
if attributes.key?(:relevancy_strictness)
582566
self.relevancy_strictness = attributes[:relevancy_strictness]
583567
end
@@ -644,10 +628,6 @@ def initialize(attributes = {})
644628
self.remove_stop_words = attributes[:remove_stop_words]
645629
end
646630

647-
if attributes.key?(:keep_diacritics_on_characters)
648-
self.keep_diacritics_on_characters = attributes[:keep_diacritics_on_characters]
649-
end
650-
651631
if attributes.key?(:query_languages)
652632
if (value = attributes[:query_languages]).is_a?(Array)
653633
self.query_languages = value
@@ -798,7 +778,6 @@ def ==(other)
798778
enable_ab_test == other.enable_ab_test &&
799779
attributes_to_retrieve == other.attributes_to_retrieve &&
800780
ranking == other.ranking &&
801-
custom_ranking == other.custom_ranking &&
802781
relevancy_strictness == other.relevancy_strictness &&
803782
attributes_to_highlight == other.attributes_to_highlight &&
804783
attributes_to_snippet == other.attributes_to_snippet &&
@@ -814,7 +793,6 @@ def ==(other)
814793
disable_typo_tolerance_on_attributes == other.disable_typo_tolerance_on_attributes &&
815794
ignore_plurals == other.ignore_plurals &&
816795
remove_stop_words == other.remove_stop_words &&
817-
keep_diacritics_on_characters == other.keep_diacritics_on_characters &&
818796
query_languages == other.query_languages &&
819797
decompound_query == other.decompound_query &&
820798
enable_rules == other.enable_rules &&
@@ -886,7 +864,6 @@ def hash
886864
enable_ab_test,
887865
attributes_to_retrieve,
888866
ranking,
889-
custom_ranking,
890867
relevancy_strictness,
891868
attributes_to_highlight,
892869
attributes_to_snippet,
@@ -902,7 +879,6 @@ def hash
902879
disable_typo_tolerance_on_attributes,
903880
ignore_plurals,
904881
remove_stop_words,
905-
keep_diacritics_on_characters,
906882
query_languages,
907883
decompound_query,
908884
enable_rules,

0 commit comments

Comments
 (0)