diff --git a/src/plugins/discover/public/application/main/components/total_documents/total_documents.tsx b/src/plugins/discover/public/application/main/components/total_documents/total_documents.tsx
index f9a3f04cc1c56..5644efc8a9bbd 100644
--- a/src/plugins/discover/public/application/main/components/total_documents/total_documents.tsx
+++ b/src/plugins/discover/public/application/main/components/total_documents/total_documents.tsx
@@ -11,7 +11,19 @@ import React from 'react';
import { FormattedMessage, FormattedNumber } from '@kbn/i18n-react';
import { EuiText } from '@elastic/eui';
-export const TotalDocuments = ({ totalHitCount }: { totalHitCount: number }) => {
+export const TotalDocuments = ({
+ totalHitCount,
+ isEsqlMode,
+}: {
+ totalHitCount: number;
+ isEsqlMode?: boolean;
+}) => {
+ const totalDocuments = (
+
+
+
+ );
+
return (
style={{ paddingRight: 2 }}
data-test-subj="savedSearchTotalDocuments"
>
-
-
-
- ),
- }}
- />
+ {isEsqlMode ? (
+
+ ) : (
+
+ )}
);
};
diff --git a/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.test.tsx b/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.test.tsx
index f045e78de5ddf..7d88f9ad1fef4 100644
--- a/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.test.tsx
+++ b/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.test.tsx
@@ -94,6 +94,7 @@ describe('Document view mode toggle component', () => {
expect(findTestSubject(component, 'dscViewModeDocumentButton').exists()).toBe(true);
expect(findTestSubject(component, 'dscViewModePatternAnalysisButton').exists()).toBe(true);
expect(findTestSubject(component, 'dscViewModeFieldStatsButton').exists()).toBe(true);
+ expect(findTestSubject(component, 'dscViewModeDocumentButton').text()).toBe('Documents (10)');
});
it('should not render if SHOW_FIELD_STATISTICS is false', async () => {
@@ -114,6 +115,7 @@ describe('Document view mode toggle component', () => {
expect(findTestSubject(component, 'dscViewModeDocumentButton').exists()).toBe(true);
expect(findTestSubject(component, 'dscViewModePatternAnalysisButton').exists()).toBe(false);
expect(findTestSubject(component, 'dscViewModeFieldStatsButton').exists()).toBe(true);
+ expect(findTestSubject(component, 'dscViewModeDocumentButton').text()).toBe('Results (10)');
});
it('should set the view mode to VIEW_MODE.DOCUMENT_LEVEL when dscViewModeDocumentButton is clicked', async () => {
diff --git a/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.tsx b/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.tsx
index 10a92dc8fefa9..22c4aaa11b43a 100644
--- a/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.tsx
+++ b/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.tsx
@@ -130,7 +130,14 @@ export const DocumentViewModeToggle = ({
onClick={() => setDiscoverViewMode(VIEW_MODE.DOCUMENT_LEVEL)}
data-test-subj="dscViewModeDocumentButton"
>
-
+ {isEsqlMode ? (
+
+ ) : (
+
+ )}
diff --git a/src/plugins/discover/public/embeddable/components/saved_search_grid.tsx b/src/plugins/discover/public/embeddable/components/saved_search_grid.tsx
index e45ad009db898..f6c77dc6cddf5 100644
--- a/src/plugins/discover/public/embeddable/components/saved_search_grid.tsx
+++ b/src/plugins/discover/public/embeddable/components/saved_search_grid.tsx
@@ -85,10 +85,10 @@ export function DiscoverGridEmbeddable(props: DiscoverGridEmbeddableProps) {
getRenderCustomToolbarWithElements({
leftSide:
typeof props.totalHitCount === 'number' ? (
-
+
) : undefined,
}),
- [props.totalHitCount]
+ [props.totalHitCount, props.isPlainRecord]
);
const getCellRenderersAccessor = useProfileAccessor('getCellRenderers');
diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json
index f16447d8dd2f0..06dbe47b0e46c 100644
--- a/x-pack/plugins/translations/translations/fr-FR.json
+++ b/x-pack/plugins/translations/translations/fr-FR.json
@@ -2423,7 +2423,6 @@
"discover.docTable.tableRow.toggleRowDetailsButtonAriaLabel": "Afficher/Masquer les détails de la ligne",
"discover.docTable.tableRow.viewSingleDocumentLinkText": "Afficher un seul document",
"discover.docTable.tableRow.viewSurroundingDocumentsLinkText": "Afficher les documents alentour",
- "discover.docTable.totalDocuments": "{totalDocuments} documents",
"discover.documentsAriaLabel": "Documents",
"discover.docViews.table.scoreSortWarningTooltip": "Filtrez sur _score pour pouvoir récupérer les valeurs correspondantes.",
"discover.dropZoneTableLabel": "Abandonner la zone pour ajouter un champ en tant que colonne dans la table",
diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json
index 5c78d3e4bafd0..6bd8366f8500e 100644
--- a/x-pack/plugins/translations/translations/ja-JP.json
+++ b/x-pack/plugins/translations/translations/ja-JP.json
@@ -2422,7 +2422,6 @@
"discover.docTable.tableRow.toggleRowDetailsButtonAriaLabel": "行の詳細を切り替える",
"discover.docTable.tableRow.viewSingleDocumentLinkText": "単一のドキュメントを表示",
"discover.docTable.tableRow.viewSurroundingDocumentsLinkText": "周りのドキュメントを表示",
- "discover.docTable.totalDocuments": "{totalDocuments}ドキュメント",
"discover.documentsAriaLabel": "ドキュメント",
"discover.docViews.table.scoreSortWarningTooltip": "_scoreの値を取得するには、並べ替える必要があります。",
"discover.dropZoneTableLabel": "フィールドを列として表に追加するには、ゾーンをドロップします",
diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json
index 5e5ee8b106a5d..91893e7314ad9 100644
--- a/x-pack/plugins/translations/translations/zh-CN.json
+++ b/x-pack/plugins/translations/translations/zh-CN.json
@@ -2424,7 +2424,6 @@
"discover.docTable.tableRow.toggleRowDetailsButtonAriaLabel": "切换行详细信息",
"discover.docTable.tableRow.viewSingleDocumentLinkText": "查看单个文档",
"discover.docTable.tableRow.viewSurroundingDocumentsLinkText": "查看周围文档",
- "discover.docTable.totalDocuments": "{totalDocuments} 个文档",
"discover.documentsAriaLabel": "文档",
"discover.docViews.table.scoreSortWarningTooltip": "要检索 _score 的值,必须按其筛选。",
"discover.dropZoneTableLabel": "放置区域以将字段作为列添加到表中",