mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[ML] Fix sort order of data recognizer module cards (#86250)
* [ML] Fix sort order of data recognizer module cards * [ML] Add sort by ID to server side recognize endpoint * [ML] Enhance docs for recognize endpoint success response.
This commit is contained in:
parent
2106419007
commit
b70cabbdcb
3 changed files with 7 additions and 1 deletions
|
@ -29,6 +29,9 @@ export class DataRecognizer extends Component {
|
|||
// once the mount is complete, call the recognize endpoint to see if the index format is known to us,
|
||||
ml.recognizeIndex({ indexPatternTitle: this.indexPattern.title })
|
||||
.then((resp) => {
|
||||
// Sort results by title prior to display
|
||||
resp.sort((res1, res2) => res1.title.localeCompare(res2.title));
|
||||
|
||||
const results = resp.map((r) => (
|
||||
<RecognizedResult
|
||||
key={r.id}
|
||||
|
|
|
@ -249,6 +249,8 @@ export class DataRecognizer {
|
|||
})
|
||||
);
|
||||
|
||||
results.sort((res1, res2) => res1.id.localeCompare(res2.id));
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
|
|
|
@ -133,10 +133,11 @@ export function dataRecognizer({ router, routeGuard }: RouteInitialization) {
|
|||
* @apiName RecognizeIndex
|
||||
* @apiDescription By supplying an index pattern, discover if any of the modules are a match for data in that index.
|
||||
* @apiSchema (params) modulesIndexPatternTitleSchema
|
||||
* @apiSuccess {object[]} modules Array of objects describing the modules which match the index pattern.
|
||||
* @apiSuccess {object[]} modules Array of objects describing the modules which match the index pattern, sorted by module ID.
|
||||
* @apiSuccessExample {json} Success-Response:
|
||||
* [{
|
||||
* "id": "nginx_ecs",
|
||||
* "title": "Nginx access logs",
|
||||
* "query": {
|
||||
* "bool": {
|
||||
* "filter": [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue