Skip to content

Commit 2146199

Browse files
authored
add nested fields param mapping findings index for doc level queries (#1276)
Signed-off-by: Surya Sashank Nistala <[email protected]>
1 parent ca9b75c commit 2146199

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

alerting/src/main/resources/org/opensearch/alerting/alerts/finding_mapping.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"dynamic": "strict",
33
"_meta" : {
4-
"schema_version": 3
4+
"schema_version": 4
55
},
66
"properties": {
77
"schema_version": {
@@ -46,6 +46,9 @@
4646
"type" : "keyword"
4747
}
4848
}
49+
},
50+
"fields": {
51+
"type": "text"
4952
}
5053
}
5154
},

alerting/src/test/kotlin/org/opensearch/alerting/alerts/AlertIndicesIT.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class AlertIndicesIT : AlertingRestTestCase() {
7575

7676
putFindingMappings(
7777
AlertIndices.findingMapping().trimStart('{').trimEnd('}')
78-
.replace("\"schema_version\": 3", "\"schema_version\": 0")
78+
.replace("\"schema_version\": 4", "\"schema_version\": 0")
7979
)
8080
assertIndexExists(AlertIndices.FINDING_HISTORY_WRITE_INDEX)
8181
verifyIndexSchemaVersion(AlertIndices.FINDING_HISTORY_WRITE_INDEX, 0)
@@ -89,7 +89,7 @@ class AlertIndicesIT : AlertingRestTestCase() {
8989
executeMonitor(trueMonitor.id)
9090
assertIndexExists(AlertIndices.FINDING_HISTORY_WRITE_INDEX)
9191
verifyIndexSchemaVersion(ScheduledJob.SCHEDULED_JOBS_INDEX, 8)
92-
verifyIndexSchemaVersion(AlertIndices.FINDING_HISTORY_WRITE_INDEX, 3)
92+
verifyIndexSchemaVersion(AlertIndices.FINDING_HISTORY_WRITE_INDEX, 4)
9393
}
9494

9595
fun `test alert index gets recreated automatically if deleted`() {

0 commit comments

Comments
 (0)