+
- {'Error'}
+ {i18n.translate('data.query.languageService.queryResults.error', {
+ defaultMessage: `Error`,
+ })}
}
@@ -65,6 +129,7 @@ export function QueryResult(props: { queryStatus: QueryStatus }) {
closePopover={() => setPopover(false)}
panelPaddingSize="s"
anchorPosition={'downRight'}
+ data-test-subj="queryResultError"
>
ERRORS
@@ -82,7 +147,7 @@ export function QueryResult(props: { queryStatus: QueryStatus }) {
{i18n.translate('data.query.languageService.queryResults.details', {
defaultMessage: `Details:`,
})}
- {' '}
+
{props.queryStatus.body.error.details}
diff --git a/src/plugins/discover/public/application/view_components/utils/use_search.ts b/src/plugins/discover/public/application/view_components/utils/use_search.ts
index 91b896f143f1..88300cc570fa 100644
--- a/src/plugins/discover/public/application/view_components/utils/use_search.ts
+++ b/src/plugins/discover/public/application/view_components/utils/use_search.ts
@@ -60,6 +60,7 @@ export interface SearchData {
statusCode?: number;
};
elapsedMs?: number;
+ startTime?: number;
};
}
@@ -119,12 +120,14 @@ export const useSearch = (services: DiscoverViewServices) => {
);
}, [savedSearch, services.uiSettings, timefilter]);
+ const startTime = Date.now();
const data$ = useMemo(
() =>
new BehaviorSubject({
status: shouldSearchOnPageLoad() ? ResultStatus.LOADING : ResultStatus.UNINITIALIZED,
+ queryStatus: { startTime },
}),
- [shouldSearchOnPageLoad]
+ [shouldSearchOnPageLoad, startTime]
);
const refetch$ = useMemo(() => new Subject(), []);
@@ -161,7 +164,6 @@ export const useSearch = (services: DiscoverViewServices) => {
dataset = searchSource.getField('index');
let elapsedMs;
-
try {
// Only show loading indicator if we are fetching when the rows are empty
if (fetchStateRef.current.rows?.length === 0) {
@@ -267,14 +269,14 @@ export const useSearch = (services: DiscoverViewServices) => {
}
}, [
indexPattern,
- interval,
timefilter,
toastNotifications,
+ interval,
data,
services,
+ sort,
savedSearch?.searchSource,
data$,
- sort,
shouldSearchOnPageLoad,
inspectorAdapters.requests,
]);