Skip to content

Commit

Permalink
Update MonitorRunner.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
Annie Lee committed Mar 18, 2022
1 parent c9b36f3 commit d20be8c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ import org.opensearch.common.settings.Settings
import org.opensearch.common.xcontent.NamedXContentRegistry
import org.opensearch.common.xcontent.ToXContent
import org.opensearch.common.xcontent.XContentBuilder
import org.opensearch.common.xcontent.XContentFactory
import org.opensearch.common.xcontent.XContentType
import org.opensearch.index.query.BoolQueryBuilder
import org.opensearch.index.query.QueryBuilders
Expand Down Expand Up @@ -836,7 +837,7 @@ object MonitorRunner : JobRunner, CoroutineScope, AbstractLifecycleComponent() {
// todo: below is all hardcoded, temp code and added only to test. replace this with proper Findings index lifecycle management.
val indexRequest = IndexRequest(".opensearch-alerting-findings")
.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE)
.source(findingStr, XContentType.JSON)
.source(finding.toXContent(XContentFactory.jsonBuilder(), ToXContent.MapParams(mapOf("with_type" to "true"))))

client.index(indexRequest).actionGet()
return finding.id
Expand Down

0 comments on commit d20be8c

Please sign in to comment.