@@ -89,6 +89,8 @@ public struct CompositionParams: Codable, JSONEncodable {
89
89
/// Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/)
90
90
/// This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard.
91
91
public var enableReRanking : Bool ?
92
+ /// A list of extenrally injected objectID groups into from an external source.
93
+ public var injectedItems : [ String : CompositionExternalInjectedItem ] ?
92
94
93
95
public init (
94
96
query: String ? = nil ,
@@ -116,7 +118,8 @@ public struct CompositionParams: Codable, JSONEncodable {
116
118
analytics: Bool ? = nil ,
117
119
analyticsTags: [ String ] ? = nil ,
118
120
enableABTest: Bool ? = nil ,
119
- enableReRanking: Bool ? = nil
121
+ enableReRanking: Bool ? = nil ,
122
+ injectedItems: [ String : CompositionExternalInjectedItem ] ? = nil
120
123
) {
121
124
self . query = query
122
125
self . filters = filters
@@ -144,6 +147,7 @@ public struct CompositionParams: Codable, JSONEncodable {
144
147
self . analyticsTags = analyticsTags
145
148
self . enableABTest = enableABTest
146
149
self . enableReRanking = enableReRanking
150
+ self . injectedItems = injectedItems
147
151
}
148
152
149
153
public enum CodingKeys : String , CodingKey , CaseIterable {
@@ -173,6 +177,7 @@ public struct CompositionParams: Codable, JSONEncodable {
173
177
case analyticsTags
174
178
case enableABTest
175
179
case enableReRanking
180
+ case injectedItems
176
181
}
177
182
178
183
// Encodable protocol methods
@@ -205,6 +210,7 @@ public struct CompositionParams: Codable, JSONEncodable {
205
210
try container. encodeIfPresent ( self . analyticsTags, forKey: . analyticsTags)
206
211
try container. encodeIfPresent ( self . enableABTest, forKey: . enableABTest)
207
212
try container. encodeIfPresent ( self . enableReRanking, forKey: . enableReRanking)
213
+ try container. encodeIfPresent ( self . injectedItems, forKey: . injectedItems)
208
214
}
209
215
}
210
216
@@ -235,7 +241,8 @@ extension CompositionParams: Equatable {
235
241
lhs. analytics == rhs. analytics &&
236
242
lhs. analyticsTags == rhs. analyticsTags &&
237
243
lhs. enableABTest == rhs. enableABTest &&
238
- lhs. enableReRanking == rhs. enableReRanking
244
+ lhs. enableReRanking == rhs. enableReRanking &&
245
+ lhs. injectedItems == rhs. injectedItems
239
246
}
240
247
}
241
248
@@ -267,5 +274,6 @@ extension CompositionParams: Hashable {
267
274
hasher. combine ( self . analyticsTags? . hashValue)
268
275
hasher. combine ( self . enableABTest? . hashValue)
269
276
hasher. combine ( self . enableReRanking? . hashValue)
277
+ hasher. combine ( self . injectedItems? . hashValue)
270
278
}
271
279
}
0 commit comments