Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ compositionRule:
description: Time periods when the rule is active.
items:
$ref: '../../../../common/schemas/Rule.yml#/timeRange'
tags:
type: array
description: A list of tags.
items:
type: string
example: ['conditional']
required:
- objectID
- conditions
Expand Down Expand Up @@ -76,4 +82,4 @@ anchoring:
- `contains`. The pattern must match anywhere in the query.

Empty queries are only allowed as patterns with `anchoring: is`.
enum: [is, startsWith, endsWith, contains]
enum: [is, startsWith, endsWith, contains]
244 changes: 244 additions & 0 deletions tests/CTS/requests/composition-full/multipleBatch.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,249 @@
]
}
}
},

{
"parameters": {
"requests": [
{
"action": "upsert",
"body": {
"objectID": "my-external-injection-compo",
"name": "my first composition",
"behavior": {
"injection": {
"main": {
"source": {
"search": {
"index": "foo"
}
}
},
"injectedItems": [
{
"key": "injectedItem1",
"source": {
"external": {
"index": "foo",
"ordering": "userDefined",
"params": {
"filters": "brand:adidas"
}
}
},
"position": 2,
"length": 1
}
]
}
}
}
}
]
},
"request": {
"path": "/1/compositions/*/batch",
"method": "POST",
"body": {
"requests": [
{
"action": "upsert",
"body": {
"objectID": "my-external-injection-compo",
"name": "my first composition",
"behavior": {
"injection": {
"main": {
"source": {
"search": {
"index": "foo"
}
}
},
"injectedItems": [
{
"key": "injectedItem1",
"source": {
"external": {
"index": "foo",
"ordering": "userDefined",
"params": {
"filters": "brand:adidas"
}
}
},
"position": 2,
"length": 1
}
]
}
}
}
}
]
}
}
},

{
"parameters": {
"requests": [
{
"action": "upsert",
"body": {
"objectID": "my-metadata-compo",
"name": "my composition",
"behavior": {
"injection": {
"main": {
"source": {
"search": {
"index": "foo",
"params": { "filters": "brand:adidas" }
}
}
},
"injectedItems": [
{
"key": "injectedItem1",
"source": {
"search": {
"index": "foo",
"params": {
"filters": "brand:adidas"
}
}
},
"position": 2,
"length": 1,
"metadata": {
"hits": {
"addItemKey": true,
"extra": {
"my-string": "string",
"my-bool": true,
"my-number": 42,
"my-object": { "sub-key": "sub-value" },
"my-array": [1, 2, 3],
"my-empty-object": {}
}
}
}
},
{
"key": "externalItem",
"source": {
"search": {
"index": "foo",
"params": {
"filters": "brand:puma"
}
}
},
"position": 5,
"length": 5,
"metadata": {
"hits": {
"addItemKey": true,
"extra": {
"my-string": "string",
"my-bool": true,
"my-number": 42,
"my-object": { "sub-key": "sub-value" },
"my-array": [1, 2, 3],
"my-empty-object": {}
}
}
}
}
]
}
}
}
}
]
},
"request": {
"path": "/1/compositions/*/batch",
"method": "POST",
"body": {
"requests": [
{
"action": "upsert",
"body": {
"objectID": "my-metadata-compo",
"name": "my composition",
"behavior": {
"injection": {
"main": {
"source": {
"search": {
"index": "foo",
"params": { "filters": "brand:adidas" }
}
}
},
"injectedItems": [
{
"key": "injectedItem1",
"source": {
"search": {
"index": "foo",
"params": {
"filters": "brand:adidas"
}
}
},
"position": 2,
"length": 1,
"metadata": {
"hits": {
"addItemKey": true,
"extra": {
"my-string": "string",
"my-bool": true,
"my-number": 42,
"my-object": { "sub-key": "sub-value" },
"my-array": [1, 2, 3],
"my-empty-object": {}
}
}
}
},
{
"key": "externalItem",
"source": {
"search": {
"index": "foo",
"params": {
"filters": "brand:puma"
}
}
},
"position": 5,
"length": 5,
"metadata": {
"hits": {
"addItemKey": true,
"extra": {
"my-string": "string",
"my-bool": true,
"my-number": 42,
"my-object": { "sub-key": "sub-value" },
"my-array": [1, 2, 3],
"my-empty-object": {}
}
}
}
}
]
}
}
}
}
]
}
}
}
]
Loading