Skip to content

[Logs UI] [ML] Use ML's mlAnomalySearch for all searches on the anomaly index  #67861

@jgowdyelastic

Description

@jgowdyelastic

ML has the function mlAnomalySearch which is shared via the setup contract and can be used to search the anomaly index.

mlAnomalySearch is a simple wrapper around the standard elasticsearch search function, but also adds some additional checks.

Currently only a license check is performed, but it will soon perform a user capabilities check and once ML introduces space aware jobs, it will ensure the jobs being searched are available in the current space.

Rather than calling

callAsCurrentUser('search', { 
  index: '.ml-anomalies-*',
  body: {.......}
})

you can call

mlAnomalySearch({
   body: {......}
})

Note, index can be omitted as '.ml-anomalies-*' is hardcoded.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions