@@ -26,6 +26,7 @@ import org.opensearch.commons.alerting.model.Workflow
26
26
import org.opensearch.commons.authuser.User
27
27
import org.opensearch.commons.utils.recreateObject
28
28
import org.opensearch.core.action.ActionListener
29
+ import org.opensearch.core.common.io.stream.NamedWriteableRegistry
29
30
import org.opensearch.index.query.BoolQueryBuilder
30
31
import org.opensearch.index.query.ExistsQueryBuilder
31
32
import org.opensearch.index.query.MatchQueryBuilder
@@ -40,8 +41,8 @@ class TransportSearchMonitorAction @Inject constructor(
40
41
val settings : Settings ,
41
42
val client : Client ,
42
43
clusterService : ClusterService ,
43
- actionFilters : ActionFilters
44
-
44
+ actionFilters : ActionFilters ,
45
+ val namedWriteableRegistry : NamedWriteableRegistry
45
46
) : HandledTransportAction<ActionRequest, SearchResponse>(
46
47
AlertingActions .SEARCH_MONITORS_ACTION_NAME , transportService, actionFilters, ::SearchMonitorRequest
47
48
),
@@ -54,7 +55,7 @@ class TransportSearchMonitorAction @Inject constructor(
54
55
55
56
override fun doExecute (task : Task , request : ActionRequest , actionListener : ActionListener <SearchResponse >) {
56
57
val transformedRequest = request as ? SearchMonitorRequest
57
- ? : recreateObject(request) {
58
+ ? : recreateObject(request, namedWriteableRegistry ) {
58
59
SearchMonitorRequest (it)
59
60
}
60
61
0 commit comments