Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finding Search API #385

Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
minor fixes
Signed-off-by: Ashish Agrawal <[email protected]>
lezzago committed Apr 7, 2022
commit 19bafcfbe7c14702346903e6df507eb9b4abdf58
Original file line number Diff line number Diff line change
@@ -17,7 +17,6 @@ import org.opensearch.rest.BaseRestHandler.RestChannelConsumer
import org.opensearch.rest.RestHandler.Route
import org.opensearch.rest.RestRequest
import org.opensearch.rest.RestRequest.Method.GET
import org.opensearch.rest.RestRequest.Method.POST
import org.opensearch.rest.action.RestActions
import org.opensearch.rest.action.RestToXContentListener
import org.opensearch.search.fetch.subphase.FetchSourceContext
Original file line number Diff line number Diff line change
@@ -188,7 +188,7 @@ class TransportGetFindingsSearchAction @Inject constructor(
// TODO: REMOVE DEBUG LOG
val key = "${it.index}|${it.id}"
val docData = if (it.isFailed) emptyMap<String, Any>() else it.response.sourceAsMap
val findingDocument = FindingDocument(it.index, it.id, !it.isFailed, docData)
val findingDocument = FindingDocument(it.index, it.id, !it.isFailed, docData)
documents[key] = findingDocument
}

Original file line number Diff line number Diff line change
@@ -580,8 +580,7 @@ abstract class AlertingRestTestCase : ODFERestTestCase() {
protected fun executeMonitor(client: RestClient, monitor: Monitor, params: Map<String, String> = mapOf()): Response =
client.makeRequest("POST", "$ALERTING_BASE_URI/_execute", params, monitor.toHttpEntityWithUser())

protected fun searchFindings(params: Map<String, String> = mutableMapOf()
): GetFindingsSearchResponse {
protected fun searchFindings(params: Map<String, String> = mutableMapOf()): GetFindingsSearchResponse {

var baseEndpoint = "${AlertingPlugin.FINDING_BASE_URI}/_search?"
for (entry in params.entries) {