Skip to content

Commit c5b8ab2

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 2525b8c commit c5b8ab2

14 files changed

+179
-208
lines changed

Sources/Recommend/Models/FallbackParams.swift

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,19 @@ public struct FallbackParams: Codable, JSONEncodable {
189189
/// Maximum number of facet values to return when [searching for facet
190190
/// values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values).
191191
public var maxFacetHits: Int?
192+
/// Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For
193+
/// example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep
194+
/// their diacritics.
195+
public var keepDiacriticsOnCharacters: String?
196+
/// Attributes to use as [custom
197+
/// ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Attribute names are
198+
/// case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria
199+
/// are equal. Records with missing values for your selected custom ranking attributes are always sorted last.
200+
/// Boolean attributes are sorted based on their alphabetical order. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort
201+
/// the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the
202+
/// 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/)
203+
/// of your first attributes, or the other attributes will never be applied.
204+
public var customRanking: [String]?
192205
/// Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of
193206
/// the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included
194207
/// in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific
@@ -375,6 +388,8 @@ public struct FallbackParams: Codable, JSONEncodable {
375388
customNormalization: [String: [String: String]]? = nil,
376389
attributeForDistinct: String? = nil,
377390
maxFacetHits: Int? = nil,
391+
keepDiacriticsOnCharacters: String? = nil,
392+
customRanking: [String]? = nil,
378393
attributesToRetrieve: [String]? = nil,
379394
ranking: [String]? = nil,
380395
relevancyStrictness: Int? = nil,
@@ -461,6 +476,8 @@ public struct FallbackParams: Codable, JSONEncodable {
461476
self.customNormalization = customNormalization
462477
self.attributeForDistinct = attributeForDistinct
463478
self.maxFacetHits = maxFacetHits
479+
self.keepDiacriticsOnCharacters = keepDiacriticsOnCharacters
480+
self.customRanking = customRanking
464481
self.attributesToRetrieve = attributesToRetrieve
465482
self.ranking = ranking
466483
self.relevancyStrictness = relevancyStrictness
@@ -549,6 +566,8 @@ public struct FallbackParams: Codable, JSONEncodable {
549566
case customNormalization
550567
case attributeForDistinct
551568
case maxFacetHits
569+
case keepDiacriticsOnCharacters
570+
case customRanking
552571
case attributesToRetrieve
553572
case ranking
554573
case relevancyStrictness
@@ -640,6 +659,8 @@ public struct FallbackParams: Codable, JSONEncodable {
640659
try container.encodeIfPresent(self.customNormalization, forKey: .customNormalization)
641660
try container.encodeIfPresent(self.attributeForDistinct, forKey: .attributeForDistinct)
642661
try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits)
662+
try container.encodeIfPresent(self.keepDiacriticsOnCharacters, forKey: .keepDiacriticsOnCharacters)
663+
try container.encodeIfPresent(self.customRanking, forKey: .customRanking)
643664
try container.encodeIfPresent(self.attributesToRetrieve, forKey: .attributesToRetrieve)
644665
try container.encodeIfPresent(self.ranking, forKey: .ranking)
645666
try container.encodeIfPresent(self.relevancyStrictness, forKey: .relevancyStrictness)
@@ -736,6 +757,8 @@ extension FallbackParams: Equatable {
736757
lhs.customNormalization == rhs.customNormalization &&
737758
lhs.attributeForDistinct == rhs.attributeForDistinct &&
738759
lhs.maxFacetHits == rhs.maxFacetHits &&
760+
lhs.keepDiacriticsOnCharacters == rhs.keepDiacriticsOnCharacters &&
761+
lhs.customRanking == rhs.customRanking &&
739762
lhs.attributesToRetrieve == rhs.attributesToRetrieve &&
740763
lhs.ranking == rhs.ranking &&
741764
lhs.relevancyStrictness == rhs.relevancyStrictness &&
@@ -826,6 +849,8 @@ extension FallbackParams: Hashable {
826849
hasher.combine(self.customNormalization?.hashValue)
827850
hasher.combine(self.attributeForDistinct?.hashValue)
828851
hasher.combine(self.maxFacetHits?.hashValue)
852+
hasher.combine(self.keepDiacriticsOnCharacters?.hashValue)
853+
hasher.combine(self.customRanking?.hashValue)
829854
hasher.combine(self.attributesToRetrieve?.hashValue)
830855
hasher.combine(self.ranking?.hashValue)
831856
hasher.combine(self.relevancyStrictness?.hashValue)

Sources/Recommend/Models/RecommendBaseIndexSettings.swift

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,19 @@ public struct RecommendBaseIndexSettings: Codable, JSONEncodable {
102102
/// Maximum number of facet values to return when [searching for facet
103103
/// values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values).
104104
public var maxFacetHits: Int?
105+
/// Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For
106+
/// example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep
107+
/// their diacritics.
108+
public var keepDiacriticsOnCharacters: String?
109+
/// Attributes to use as [custom
110+
/// ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Attribute names are
111+
/// case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria
112+
/// are equal. Records with missing values for your selected custom ranking attributes are always sorted last.
113+
/// Boolean attributes are sorted based on their alphabetical order. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort
114+
/// the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the
115+
/// 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/)
116+
/// of your first attributes, or the other attributes will never be applied.
117+
public var customRanking: [String]?
105118

106119
public init(
107120
attributesForFaceting: [String]? = nil,
@@ -121,7 +134,9 @@ public struct RecommendBaseIndexSettings: Codable, JSONEncodable {
121134
userData: AnyCodable? = nil,
122135
customNormalization: [String: [String: String]]? = nil,
123136
attributeForDistinct: String? = nil,
124-
maxFacetHits: Int? = nil
137+
maxFacetHits: Int? = nil,
138+
keepDiacriticsOnCharacters: String? = nil,
139+
customRanking: [String]? = nil
125140
) {
126141
self.attributesForFaceting = attributesForFaceting
127142
self.replicas = replicas
@@ -141,6 +156,8 @@ public struct RecommendBaseIndexSettings: Codable, JSONEncodable {
141156
self.customNormalization = customNormalization
142157
self.attributeForDistinct = attributeForDistinct
143158
self.maxFacetHits = maxFacetHits
159+
self.keepDiacriticsOnCharacters = keepDiacriticsOnCharacters
160+
self.customRanking = customRanking
144161
}
145162

146163
public enum CodingKeys: String, CodingKey, CaseIterable {
@@ -162,6 +179,8 @@ public struct RecommendBaseIndexSettings: Codable, JSONEncodable {
162179
case customNormalization
163180
case attributeForDistinct
164181
case maxFacetHits
182+
case keepDiacriticsOnCharacters
183+
case customRanking
165184
}
166185

167186
// Encodable protocol methods
@@ -186,6 +205,8 @@ public struct RecommendBaseIndexSettings: Codable, JSONEncodable {
186205
try container.encodeIfPresent(self.customNormalization, forKey: .customNormalization)
187206
try container.encodeIfPresent(self.attributeForDistinct, forKey: .attributeForDistinct)
188207
try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits)
208+
try container.encodeIfPresent(self.keepDiacriticsOnCharacters, forKey: .keepDiacriticsOnCharacters)
209+
try container.encodeIfPresent(self.customRanking, forKey: .customRanking)
189210
}
190211
}
191212

@@ -208,7 +229,9 @@ extension RecommendBaseIndexSettings: Equatable {
208229
lhs.userData == rhs.userData &&
209230
lhs.customNormalization == rhs.customNormalization &&
210231
lhs.attributeForDistinct == rhs.attributeForDistinct &&
211-
lhs.maxFacetHits == rhs.maxFacetHits
232+
lhs.maxFacetHits == rhs.maxFacetHits &&
233+
lhs.keepDiacriticsOnCharacters == rhs.keepDiacriticsOnCharacters &&
234+
lhs.customRanking == rhs.customRanking
212235
}
213236
}
214237

@@ -232,5 +255,7 @@ extension RecommendBaseIndexSettings: Hashable {
232255
hasher.combine(self.customNormalization?.hashValue)
233256
hasher.combine(self.attributeForDistinct?.hashValue)
234257
hasher.combine(self.maxFacetHits?.hashValue)
258+
hasher.combine(self.keepDiacriticsOnCharacters?.hashValue)
259+
hasher.combine(self.customRanking?.hashValue)
235260
}
236261
}

Sources/Recommend/Models/RecommendIndexSettings.swift

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,19 @@ public struct RecommendIndexSettings: Codable, JSONEncodable {
103103
/// Maximum number of facet values to return when [searching for facet
104104
/// values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values).
105105
public var maxFacetHits: Int?
106+
/// Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For
107+
/// example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep
108+
/// their diacritics.
109+
public var keepDiacriticsOnCharacters: String?
110+
/// Attributes to use as [custom
111+
/// ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Attribute names are
112+
/// case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria
113+
/// are equal. Records with missing values for your selected custom ranking attributes are always sorted last.
114+
/// Boolean attributes are sorted based on their alphabetical order. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort
115+
/// the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the
116+
/// 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/)
117+
/// of your first attributes, or the other attributes will never be applied.
118+
public var customRanking: [String]?
106119
/// Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of
107120
/// the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included
108121
/// in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific
@@ -260,6 +273,8 @@ public struct RecommendIndexSettings: Codable, JSONEncodable {
260273
customNormalization: [String: [String: String]]? = nil,
261274
attributeForDistinct: String? = nil,
262275
maxFacetHits: Int? = nil,
276+
keepDiacriticsOnCharacters: String? = nil,
277+
customRanking: [String]? = nil,
263278
attributesToRetrieve: [String]? = nil,
264279
ranking: [String]? = nil,
265280
relevancyStrictness: Int? = nil,
@@ -317,6 +332,8 @@ public struct RecommendIndexSettings: Codable, JSONEncodable {
317332
self.customNormalization = customNormalization
318333
self.attributeForDistinct = attributeForDistinct
319334
self.maxFacetHits = maxFacetHits
335+
self.keepDiacriticsOnCharacters = keepDiacriticsOnCharacters
336+
self.customRanking = customRanking
320337
self.attributesToRetrieve = attributesToRetrieve
321338
self.ranking = ranking
322339
self.relevancyStrictness = relevancyStrictness
@@ -376,6 +393,8 @@ public struct RecommendIndexSettings: Codable, JSONEncodable {
376393
case customNormalization
377394
case attributeForDistinct
378395
case maxFacetHits
396+
case keepDiacriticsOnCharacters
397+
case customRanking
379398
case attributesToRetrieve
380399
case ranking
381400
case relevancyStrictness
@@ -438,6 +457,8 @@ public struct RecommendIndexSettings: Codable, JSONEncodable {
438457
try container.encodeIfPresent(self.customNormalization, forKey: .customNormalization)
439458
try container.encodeIfPresent(self.attributeForDistinct, forKey: .attributeForDistinct)
440459
try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits)
460+
try container.encodeIfPresent(self.keepDiacriticsOnCharacters, forKey: .keepDiacriticsOnCharacters)
461+
try container.encodeIfPresent(self.customRanking, forKey: .customRanking)
441462
try container.encodeIfPresent(self.attributesToRetrieve, forKey: .attributesToRetrieve)
442463
try container.encodeIfPresent(self.ranking, forKey: .ranking)
443464
try container.encodeIfPresent(self.relevancyStrictness, forKey: .relevancyStrictness)
@@ -505,6 +526,8 @@ extension RecommendIndexSettings: Equatable {
505526
lhs.customNormalization == rhs.customNormalization &&
506527
lhs.attributeForDistinct == rhs.attributeForDistinct &&
507528
lhs.maxFacetHits == rhs.maxFacetHits &&
529+
lhs.keepDiacriticsOnCharacters == rhs.keepDiacriticsOnCharacters &&
530+
lhs.customRanking == rhs.customRanking &&
508531
lhs.attributesToRetrieve == rhs.attributesToRetrieve &&
509532
lhs.ranking == rhs.ranking &&
510533
lhs.relevancyStrictness == rhs.relevancyStrictness &&
@@ -566,6 +589,8 @@ extension RecommendIndexSettings: Hashable {
566589
hasher.combine(self.customNormalization?.hashValue)
567590
hasher.combine(self.attributeForDistinct?.hashValue)
568591
hasher.combine(self.maxFacetHits?.hashValue)
592+
hasher.combine(self.keepDiacriticsOnCharacters?.hashValue)
593+
hasher.combine(self.customRanking?.hashValue)
569594
hasher.combine(self.attributesToRetrieve?.hashValue)
570595
hasher.combine(self.ranking?.hashValue)
571596
hasher.combine(self.relevancyStrictness?.hashValue)

Sources/Recommend/Models/RecommendSearchParams.swift

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,19 @@ public struct RecommendSearchParams: Codable, JSONEncodable {
190190
/// Maximum number of facet values to return when [searching for facet
191191
/// values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values).
192192
public var maxFacetHits: Int?
193+
/// Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For
194+
/// example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep
195+
/// their diacritics.
196+
public var keepDiacriticsOnCharacters: String?
197+
/// Attributes to use as [custom
198+
/// ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Attribute names are
199+
/// case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria
200+
/// are equal. Records with missing values for your selected custom ranking attributes are always sorted last.
201+
/// Boolean attributes are sorted based on their alphabetical order. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort
202+
/// the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the
203+
/// 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/)
204+
/// of your first attributes, or the other attributes will never be applied.
205+
public var customRanking: [String]?
193206
/// Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of
194207
/// the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included
195208
/// in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific
@@ -376,6 +389,8 @@ public struct RecommendSearchParams: Codable, JSONEncodable {
376389
customNormalization: [String: [String: String]]? = nil,
377390
attributeForDistinct: String? = nil,
378391
maxFacetHits: Int? = nil,
392+
keepDiacriticsOnCharacters: String? = nil,
393+
customRanking: [String]? = nil,
379394
attributesToRetrieve: [String]? = nil,
380395
ranking: [String]? = nil,
381396
relevancyStrictness: Int? = nil,
@@ -462,6 +477,8 @@ public struct RecommendSearchParams: Codable, JSONEncodable {
462477
self.customNormalization = customNormalization
463478
self.attributeForDistinct = attributeForDistinct
464479
self.maxFacetHits = maxFacetHits
480+
self.keepDiacriticsOnCharacters = keepDiacriticsOnCharacters
481+
self.customRanking = customRanking
465482
self.attributesToRetrieve = attributesToRetrieve
466483
self.ranking = ranking
467484
self.relevancyStrictness = relevancyStrictness
@@ -550,6 +567,8 @@ public struct RecommendSearchParams: Codable, JSONEncodable {
550567
case customNormalization
551568
case attributeForDistinct
552569
case maxFacetHits
570+
case keepDiacriticsOnCharacters
571+
case customRanking
553572
case attributesToRetrieve
554573
case ranking
555574
case relevancyStrictness
@@ -641,6 +660,8 @@ public struct RecommendSearchParams: Codable, JSONEncodable {
641660
try container.encodeIfPresent(self.customNormalization, forKey: .customNormalization)
642661
try container.encodeIfPresent(self.attributeForDistinct, forKey: .attributeForDistinct)
643662
try container.encodeIfPresent(self.maxFacetHits, forKey: .maxFacetHits)
663+
try container.encodeIfPresent(self.keepDiacriticsOnCharacters, forKey: .keepDiacriticsOnCharacters)
664+
try container.encodeIfPresent(self.customRanking, forKey: .customRanking)
644665
try container.encodeIfPresent(self.attributesToRetrieve, forKey: .attributesToRetrieve)
645666
try container.encodeIfPresent(self.ranking, forKey: .ranking)
646667
try container.encodeIfPresent(self.relevancyStrictness, forKey: .relevancyStrictness)
@@ -737,6 +758,8 @@ extension RecommendSearchParams: Equatable {
737758
lhs.customNormalization == rhs.customNormalization &&
738759
lhs.attributeForDistinct == rhs.attributeForDistinct &&
739760
lhs.maxFacetHits == rhs.maxFacetHits &&
761+
lhs.keepDiacriticsOnCharacters == rhs.keepDiacriticsOnCharacters &&
762+
lhs.customRanking == rhs.customRanking &&
740763
lhs.attributesToRetrieve == rhs.attributesToRetrieve &&
741764
lhs.ranking == rhs.ranking &&
742765
lhs.relevancyStrictness == rhs.relevancyStrictness &&
@@ -827,6 +850,8 @@ extension RecommendSearchParams: Hashable {
827850
hasher.combine(self.customNormalization?.hashValue)
828851
hasher.combine(self.attributeForDistinct?.hashValue)
829852
hasher.combine(self.maxFacetHits?.hashValue)
853+
hasher.combine(self.keepDiacriticsOnCharacters?.hashValue)
854+
hasher.combine(self.customRanking?.hashValue)
830855
hasher.combine(self.attributesToRetrieve?.hashValue)
831856
hasher.combine(self.ranking?.hashValue)
832857
hasher.combine(self.relevancyStrictness?.hashValue)

0 commit comments

Comments
 (0)