@@ -89,6 +89,8 @@ public struct CompositionParams: Codable, JSONEncodable {
8989 /// Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/)
9090 /// This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard.
9191 public var enableReRanking : Bool ?
92+ /// A list of extenrally injected objectID groups into from an external source.
93+ public var injectedItems : [ String : CompositionExternalInjectedItem ] ?
9294
9395 public init (
9496 query: String ? = nil ,
@@ -116,7 +118,8 @@ public struct CompositionParams: Codable, JSONEncodable {
116118 analytics: Bool ? = nil ,
117119 analyticsTags: [ String ] ? = nil ,
118120 enableABTest: Bool ? = nil ,
119- enableReRanking: Bool ? = nil
121+ enableReRanking: Bool ? = nil ,
122+ injectedItems: [ String : CompositionExternalInjectedItem ] ? = nil
120123 ) {
121124 self . query = query
122125 self . filters = filters
@@ -144,6 +147,7 @@ public struct CompositionParams: Codable, JSONEncodable {
144147 self . analyticsTags = analyticsTags
145148 self . enableABTest = enableABTest
146149 self . enableReRanking = enableReRanking
150+ self . injectedItems = injectedItems
147151 }
148152
149153 public enum CodingKeys : String , CodingKey , CaseIterable {
@@ -173,6 +177,7 @@ public struct CompositionParams: Codable, JSONEncodable {
173177 case analyticsTags
174178 case enableABTest
175179 case enableReRanking
180+ case injectedItems
176181 }
177182
178183 // Encodable protocol methods
@@ -205,6 +210,7 @@ public struct CompositionParams: Codable, JSONEncodable {
205210 try container. encodeIfPresent ( self . analyticsTags, forKey: . analyticsTags)
206211 try container. encodeIfPresent ( self . enableABTest, forKey: . enableABTest)
207212 try container. encodeIfPresent ( self . enableReRanking, forKey: . enableReRanking)
213+ try container. encodeIfPresent ( self . injectedItems, forKey: . injectedItems)
208214 }
209215}
210216
@@ -235,7 +241,8 @@ extension CompositionParams: Equatable {
235241 lhs. analytics == rhs. analytics &&
236242 lhs. analyticsTags == rhs. analyticsTags &&
237243 lhs. enableABTest == rhs. enableABTest &&
238- lhs. enableReRanking == rhs. enableReRanking
244+ lhs. enableReRanking == rhs. enableReRanking &&
245+ lhs. injectedItems == rhs. injectedItems
239246 }
240247}
241248
@@ -267,5 +274,6 @@ extension CompositionParams: Hashable {
267274 hasher. combine ( self . analyticsTags? . hashValue)
268275 hasher. combine ( self . enableABTest? . hashValue)
269276 hasher. combine ( self . enableReRanking? . hashValue)
277+ hasher. combine ( self . injectedItems? . hashValue)
270278 }
271279}
0 commit comments