-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Discover] Fix Field Statistics when discover:searchFieldsFromSource …
…is enabled (#187250) - Closes #187241 ## Summary This PR excludes `_source` when processing current `columns` in UI - For Field Statistics table - For ES|QL fields callout ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Matthias Wilhelm <[email protected]>
- Loading branch information
Showing
4 changed files
with
81 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
test/functional/apps/discover/group6/_field_stats_table.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { FtrProviderContext } from '../ftr_provider_context'; | ||
|
||
export default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
const PageObjects = getPageObjects(['common', 'discover', 'timePicker', 'header']); | ||
const esArchiver = getService('esArchiver'); | ||
const testSubjects = getService('testSubjects'); | ||
const kibanaServer = getService('kibanaServer'); | ||
const security = getService('security'); | ||
const defaultSettings = { | ||
defaultIndex: 'logstash-*', | ||
}; | ||
|
||
describe('discover field statistics table', function () { | ||
before(async () => { | ||
await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader']); | ||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); | ||
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); | ||
}); | ||
|
||
after(async () => { | ||
await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); | ||
await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional'); | ||
await kibanaServer.savedObjects.cleanStandardList(); | ||
}); | ||
|
||
[true, false].forEach((shouldSearchFieldsFromSource) => { | ||
describe(`discover:searchFieldsFromSource: ${shouldSearchFieldsFromSource}`, function () { | ||
before(async function () { | ||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); | ||
await kibanaServer.uiSettings.update({ | ||
...defaultSettings, | ||
'discover:searchFieldsFromSource': shouldSearchFieldsFromSource, | ||
}); | ||
await PageObjects.common.navigateToApp('discover'); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
await PageObjects.discover.waitUntilSearchingHasFinished(); | ||
}); | ||
|
||
after(async () => { | ||
await kibanaServer.uiSettings.replace({}); | ||
}); | ||
|
||
it('should show Field Statistics data in data view mode', async () => { | ||
await testSubjects.click('dscViewModeFieldStatsButton'); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
await testSubjects.existOrFail('dataVisualizerTableContainer'); | ||
|
||
await testSubjects.click('dscViewModeDocumentButton'); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
await testSubjects.existOrFail('discoverDocTable'); | ||
}); | ||
|
||
it('should show Field Statistics data in ES|QL mode', async () => { | ||
await PageObjects.discover.selectTextBaseLang(); | ||
await PageObjects.discover.waitUntilSearchingHasFinished(); | ||
|
||
await testSubjects.click('dscViewModeFieldStatsButton'); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
await testSubjects.existOrFail('dataVisualizerTableContainer'); | ||
}); | ||
}); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters