mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[ML] Fixing results service space checks (#124707)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
7c7d1cf527
commit
afb458ede7
2 changed files with 10 additions and 10 deletions
|
@ -34,7 +34,7 @@ export function topCategoriesProvider(mlClient: MlClient) {
|
|||
},
|
||||
},
|
||||
},
|
||||
[]
|
||||
[jobId]
|
||||
);
|
||||
return typeof body.hits.total === 'number' ? body.hits.total : body.hits.total!.value;
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ export function topCategoriesProvider(mlClient: MlClient) {
|
|||
},
|
||||
},
|
||||
},
|
||||
[]
|
||||
[jobId]
|
||||
);
|
||||
|
||||
const catCounts: Array<{
|
||||
|
@ -123,7 +123,7 @@ export function topCategoriesProvider(mlClient: MlClient) {
|
|||
},
|
||||
},
|
||||
},
|
||||
[]
|
||||
[jobId]
|
||||
);
|
||||
|
||||
// @ts-expect-error incorrect search response type
|
||||
|
|
|
@ -214,7 +214,7 @@ export function resultsServiceProvider(mlClient: MlClient, client?: IScopedClust
|
|||
sort: [{ record_score: { order: 'desc' } }],
|
||||
},
|
||||
},
|
||||
[]
|
||||
jobIds
|
||||
);
|
||||
|
||||
const tableData: {
|
||||
|
@ -345,7 +345,7 @@ export function resultsServiceProvider(mlClient: MlClient, client?: IScopedClust
|
|||
},
|
||||
};
|
||||
|
||||
const { body } = await mlClient.anomalySearch(query, []);
|
||||
const { body } = await mlClient.anomalySearch(query, jobIds);
|
||||
const maxScore = get(body, ['aggregations', 'max_score', 'value'], null);
|
||||
|
||||
return { maxScore };
|
||||
|
@ -409,7 +409,7 @@ export function resultsServiceProvider(mlClient: MlClient, client?: IScopedClust
|
|||
},
|
||||
},
|
||||
},
|
||||
[]
|
||||
jobIds
|
||||
);
|
||||
|
||||
const bucketsByJobId: Array<{ key: string; maxTimestamp: { value?: number } }> = get(
|
||||
|
@ -440,7 +440,7 @@ export function resultsServiceProvider(mlClient: MlClient, client?: IScopedClust
|
|||
},
|
||||
},
|
||||
},
|
||||
[]
|
||||
[jobId]
|
||||
);
|
||||
|
||||
const examplesByCategoryId: { [key: string]: any } = {};
|
||||
|
@ -477,7 +477,7 @@ export function resultsServiceProvider(mlClient: MlClient, client?: IScopedClust
|
|||
},
|
||||
},
|
||||
},
|
||||
[]
|
||||
[jobId]
|
||||
);
|
||||
|
||||
const definition = { categoryId, terms: null, regex: null, examples: [] };
|
||||
|
@ -526,7 +526,7 @@ export function resultsServiceProvider(mlClient: MlClient, client?: IScopedClust
|
|||
},
|
||||
},
|
||||
},
|
||||
[]
|
||||
[jobId]
|
||||
);
|
||||
return body ? body.hits.hits.map((r) => r._source) : [];
|
||||
}
|
||||
|
@ -617,7 +617,7 @@ export function resultsServiceProvider(mlClient: MlClient, client?: IScopedClust
|
|||
aggs,
|
||||
},
|
||||
},
|
||||
[]
|
||||
jobIds
|
||||
);
|
||||
if (fieldToBucket === JOB_ID) {
|
||||
finalResults = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue