Skip to content

Commit 42cc67d

Browse files
authored
Merge f7a098e into 77f5326
2 parents 77f5326 + f7a098e commit 42cc67d

File tree

6 files changed

+845
-8
lines changed

6 files changed

+845
-8
lines changed

specs/composition-full/common/schemas/components/CompositionRule.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ compositionRule:
3434
description: Time periods when the rule is active.
3535
items:
3636
$ref: '../../../../common/schemas/Rule.yml#/timeRange'
37+
tags:
38+
type: array
39+
description: A list of tags.
40+
items:
41+
type: string
42+
example: ['conditional']
3743
required:
3844
- objectID
3945
- conditions
@@ -76,4 +82,4 @@ anchoring:
7682
- `contains`. The pattern must match anywhere in the query.
7783
7884
Empty queries are only allowed as patterns with `anchoring: is`.
79-
enum: [is, startsWith, endsWith, contains]
85+
enum: [is, startsWith, endsWith, contains]

tests/CTS/requests/composition-full/multipleBatch.json

Lines changed: 244 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,249 @@
6262
]
6363
}
6464
}
65+
},
66+
67+
{
68+
"parameters": {
69+
"requests": [
70+
{
71+
"action": "upsert",
72+
"body": {
73+
"objectID": "my-external-injection-compo",
74+
"name": "my first composition",
75+
"behavior": {
76+
"injection": {
77+
"main": {
78+
"source": {
79+
"search": {
80+
"index": "foo"
81+
}
82+
}
83+
},
84+
"injectedItems": [
85+
{
86+
"key": "injectedItem1",
87+
"source": {
88+
"external": {
89+
"index": "foo",
90+
"ordering": "userDefined",
91+
"params": {
92+
"filters": "brand:adidas"
93+
}
94+
}
95+
},
96+
"position": 2,
97+
"length": 1
98+
}
99+
]
100+
}
101+
}
102+
}
103+
}
104+
]
105+
},
106+
"request": {
107+
"path": "/1/compositions/*/batch",
108+
"method": "POST",
109+
"body": {
110+
"requests": [
111+
{
112+
"action": "upsert",
113+
"body": {
114+
"objectID": "my-external-injection-compo",
115+
"name": "my first composition",
116+
"behavior": {
117+
"injection": {
118+
"main": {
119+
"source": {
120+
"search": {
121+
"index": "foo"
122+
}
123+
}
124+
},
125+
"injectedItems": [
126+
{
127+
"key": "injectedItem1",
128+
"source": {
129+
"external": {
130+
"index": "foo",
131+
"ordering": "userDefined",
132+
"params": {
133+
"filters": "brand:adidas"
134+
}
135+
}
136+
},
137+
"position": 2,
138+
"length": 1
139+
}
140+
]
141+
}
142+
}
143+
}
144+
}
145+
]
146+
}
147+
}
148+
},
149+
150+
{
151+
"parameters": {
152+
"requests": [
153+
{
154+
"action": "upsert",
155+
"body": {
156+
"objectID": "my-metadata-compo",
157+
"name": "my composition",
158+
"behavior": {
159+
"injection": {
160+
"main": {
161+
"source": {
162+
"search": {
163+
"index": "foo",
164+
"params": { "filters": "brand:adidas" }
165+
}
166+
}
167+
},
168+
"injectedItems": [
169+
{
170+
"key": "injectedItem1",
171+
"source": {
172+
"search": {
173+
"index": "foo",
174+
"params": {
175+
"filters": "brand:adidas"
176+
}
177+
}
178+
},
179+
"position": 2,
180+
"length": 1,
181+
"metadata": {
182+
"hits": {
183+
"addItemKey": true,
184+
"extra": {
185+
"my-string": "string",
186+
"my-bool": true,
187+
"my-number": 42,
188+
"my-object": { "sub-key": "sub-value" },
189+
"my-array": [1, 2, 3],
190+
"my-empty-object": {}
191+
}
192+
}
193+
}
194+
},
195+
{
196+
"key": "externalItem",
197+
"source": {
198+
"search": {
199+
"index": "foo",
200+
"params": {
201+
"filters": "brand:puma"
202+
}
203+
}
204+
},
205+
"position": 5,
206+
"length": 5,
207+
"metadata": {
208+
"hits": {
209+
"addItemKey": true,
210+
"extra": {
211+
"my-string": "string",
212+
"my-bool": true,
213+
"my-number": 42,
214+
"my-object": { "sub-key": "sub-value" },
215+
"my-array": [1, 2, 3],
216+
"my-empty-object": {}
217+
}
218+
}
219+
}
220+
}
221+
]
222+
}
223+
}
224+
}
225+
}
226+
]
227+
},
228+
"request": {
229+
"path": "/1/compositions/*/batch",
230+
"method": "POST",
231+
"body": {
232+
"requests": [
233+
{
234+
"action": "upsert",
235+
"body": {
236+
"objectID": "my-metadata-compo",
237+
"name": "my composition",
238+
"behavior": {
239+
"injection": {
240+
"main": {
241+
"source": {
242+
"search": {
243+
"index": "foo",
244+
"params": { "filters": "brand:adidas" }
245+
}
246+
}
247+
},
248+
"injectedItems": [
249+
{
250+
"key": "injectedItem1",
251+
"source": {
252+
"search": {
253+
"index": "foo",
254+
"params": {
255+
"filters": "brand:adidas"
256+
}
257+
}
258+
},
259+
"position": 2,
260+
"length": 1,
261+
"metadata": {
262+
"hits": {
263+
"addItemKey": true,
264+
"extra": {
265+
"my-string": "string",
266+
"my-bool": true,
267+
"my-number": 42,
268+
"my-object": { "sub-key": "sub-value" },
269+
"my-array": [1, 2, 3],
270+
"my-empty-object": {}
271+
}
272+
}
273+
}
274+
},
275+
{
276+
"key": "externalItem",
277+
"source": {
278+
"search": {
279+
"index": "foo",
280+
"params": {
281+
"filters": "brand:puma"
282+
}
283+
}
284+
},
285+
"position": 5,
286+
"length": 5,
287+
"metadata": {
288+
"hits": {
289+
"addItemKey": true,
290+
"extra": {
291+
"my-string": "string",
292+
"my-bool": true,
293+
"my-number": 42,
294+
"my-object": { "sub-key": "sub-value" },
295+
"my-array": [1, 2, 3],
296+
"my-empty-object": {}
297+
}
298+
}
299+
}
300+
}
301+
]
302+
}
303+
}
304+
}
305+
}
306+
]
307+
}
308+
}
65309
}
66310
]

0 commit comments

Comments
 (0)