diff --git a/plugins-extra/query_enhancements/opensearch_dashboards.json b/plugins-extra/query_enhancements/opensearch_dashboards.json index a13261e6f45c..41c8af395edd 100644 --- a/plugins-extra/query_enhancements/opensearch_dashboards.json +++ b/plugins-extra/query_enhancements/opensearch_dashboards.json @@ -5,6 +5,6 @@ "server": true, "ui": true, "requiredPlugins": ["data"], - "optionalPlugins": ["home"], + "optionalPlugins": [], "requiredBundles": ["opensearchDashboardsUtils", "opensearchDashboardsReact"] } diff --git a/plugins-extra/query_enhancements/public/types.ts b/plugins-extra/query_enhancements/public/types.ts index 89ef8c02d2e0..67ee3f303f58 100644 --- a/plugins-extra/query_enhancements/public/types.ts +++ b/plugins-extra/query_enhancements/public/types.ts @@ -1,5 +1,4 @@ import { DataPublicPluginSetup, DataPublicPluginStart } from 'src/plugins/data/public'; -import { NavigationPublicPluginStart } from '../../../src/plugins/navigation/public'; // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface QueryEnhancementsPluginSetup {} @@ -12,6 +11,5 @@ export interface QueryEnhancementsPluginSetupDependencies { } export interface QueryEnhancementsPluginStartDependencies { - navigation: NavigationPublicPluginStart; data: DataPublicPluginStart; } diff --git a/plugins-extra/query_enhancements/server/plugin.ts b/plugins-extra/query_enhancements/server/plugin.ts index b8f8b9054813..9691f1d269cd 100644 --- a/plugins-extra/query_enhancements/server/plugin.ts +++ b/plugins-extra/query_enhancements/server/plugin.ts @@ -20,9 +20,7 @@ import { PPL_SEARCH_STRATEGY, SQL_SEARCH_STRATEGY, SQL_ASYNC_SEARCH_STRATEGY } f import { pplSearchStrategyProvider } from './search/ppl/ppl_search_strategy'; import { sqlSearchStrategyProvider } from './search/sql/sql_search_strategy'; import { sqlAsyncSearchStrategyProvider } from './search/sql/sql_async_search_strategy'; - -// import { logsPPLSpecProvider } from './sample_data/ppl'; -// const pplSampleDateSet = logsPPLSpecProvider(); +import { uiSettings } from './ui_settings'; export class QueryEnhancementsPlugin implements Plugin { @@ -33,7 +31,7 @@ export class QueryEnhancementsPlugin this.config$ = initializerContext.config.legacy.globalConfig$; } - public setup(core: CoreSetup, { data, home }: QueryEnhancementsPluginSetupDependencies) { + public setup(core: CoreSetup, { data }: QueryEnhancementsPluginSetupDependencies) { this.logger.debug('queryEnhancements: Setup'); const router = core.http.createRouter(); // Register server side APIs @@ -41,6 +39,8 @@ export class QueryEnhancementsPlugin plugins: [PPLPlugin, EnginePlugin], }); + core.uiSettings.register(uiSettings); + const pplSearchStrategy = pplSearchStrategyProvider(this.config$, this.logger, client); const sqlSearchStrategy = sqlSearchStrategyProvider(this.config$, this.logger, client); const sqlAsyncSearchStrategy = sqlAsyncSearchStrategyProvider( diff --git a/plugins-extra/query_enhancements/server/sample_data/ppl/field_mappings.ts b/plugins-extra/query_enhancements/server/sample_data/ppl/field_mappings.ts deleted file mode 100644 index 8b9994f8615a..000000000000 --- a/plugins-extra/query_enhancements/server/sample_data/ppl/field_mappings.ts +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -export const fieldMappings = { - request: { - type: 'text', - fields: { - keyword: { - type: 'keyword', - ignore_above: 256, - }, - }, - }, - geo: { - properties: { - srcdest: { - type: 'keyword', - }, - src: { - type: 'keyword', - }, - dest: { - type: 'keyword', - }, - coordinates: { - type: 'geo_point', - }, - }, - }, - url: { - type: 'text', - fields: { - keyword: { - type: 'keyword', - ignore_above: 256, - }, - }, - }, - message: { - type: 'text', - fields: { - keyword: { - type: 'keyword', - ignore_above: 256, - }, - }, - }, - host: { - type: 'text', - fields: { - keyword: { - type: 'keyword', - ignore_above: 256, - }, - }, - }, - clientip: { - type: 'ip', - }, - response: { - type: 'text', - fields: { - keyword: { - type: 'keyword', - ignore_above: 256, - }, - }, - }, - machine: { - properties: { - ram: { - type: 'long', - }, - os: { - type: 'text', - fields: { - keyword: { - type: 'keyword', - ignore_above: 256, - }, - }, - }, - }, - }, - agent: { - type: 'text', - fields: { - keyword: { - type: 'keyword', - ignore_above: 256, - }, - }, - }, - bytes: { - type: 'long', - }, - tags: { - type: 'text', - fields: { - keyword: { - type: 'keyword', - ignore_above: 256, - }, - }, - }, - referer: { - type: 'keyword', - }, - ip: { - type: 'ip', - }, - timestamp: { - type: 'date', - }, - '@timestamp': { - type: 'alias', - path: 'timestamp', - }, - phpmemory: { - type: 'long', - }, - memory: { - type: 'double', - }, - extension: { - type: 'text', - fields: { - keyword: { - type: 'keyword', - ignore_above: 256, - }, - }, - }, - event: { - properties: { - dataset: { - type: 'keyword', - }, - }, - }, -}; diff --git a/plugins-extra/query_enhancements/server/sample_data/ppl/index.ts b/plugins-extra/query_enhancements/server/sample_data/ppl/index.ts deleted file mode 100644 index b227eedd38f5..000000000000 --- a/plugins-extra/query_enhancements/server/sample_data/ppl/index.ts +++ /dev/null @@ -1,59 +0,0 @@ -// /* -// * Copyright OpenSearch Contributors -// * SPDX-License-Identifier: Apache-2.0 -// */ - -// import path from 'path'; -// import { i18n } from '@osd/i18n'; -// import { getSavedObjects } from './saved_objects'; -// import { fieldMappings } from './field_mappings'; -// import { -// SampleDatasetSchema, -// AppLinkSchema, -// } from '../../../../../src/plugins/home/server/services/sample_data/lib/sample_dataset_registry_types'; -// // import { -// // appendDataSourceId, -// // getSavedObjectsWithDataSource, -// // } from '../../../../../src/plugins/home/server/services/sample_data/data_sets'; - -// const logsPPLName = i18n.translate('home.sampleData.logsPPLSpecTitle', { -// defaultMessage: '[PPL] Sample web logs', -// }); -// const logsPPLDescription = i18n.translate('home.sampleData.logsPPLSpecDescription', { -// defaultMessage: -// 'Sample data, visualizations, and dashboards for monitoring web logs but defaults to PPL for the query language.', -// }); -// const initialAppLinks = [] as AppLinkSchema[]; - -// const DEFAULT_INDEX = 'opensearch_dashboards_sample_data_ppl'; -// const DASHBOARD_ID = '9011e5eb-7018-463f-8541-14f98a938f16'; - -// export const logsPPLSpecProvider = function (): SampleDatasetSchema { -// return { -// id: 'ppl', -// name: logsPPLName, -// description: logsPPLDescription, -// previewImagePath: '/plugins/home/assets/sample_data_resources/logs/dashboard.png', -// darkPreviewImagePath: '/plugins/home/assets/sample_data_resources/logs/dashboard_dark.png', -// hasNewThemeImages: true, -// overviewDashboard: DASHBOARD_ID, -// getDataSourceIntegratedDashboard: appendDataSourceId(DASHBOARD_ID), -// appLinks: initialAppLinks, -// defaultIndex: DEFAULT_INDEX, -// getDataSourceIntegratedDefaultIndex: appendDataSourceId(DEFAULT_INDEX), -// savedObjects: getSavedObjects(), -// getDataSourceIntegratedSavedObjects: (dataSourceId?: string, dataSourceTitle?: string) => -// getSavedObjectsWithDataSource(getSavedObjects(), dataSourceId, dataSourceTitle), -// dataIndices: [ -// { -// id: 'ppl', -// dataPath: path.join(__dirname, './logs.json.gz'), -// fields: fieldMappings, -// timeFields: ['timestamp'], -// currentTimeMarker: '2018-08-01T00:00:00', -// preserveDayOfWeekTimeOfDay: true, -// }, -// ], -// status: 'not_installed', -// }; -// }; diff --git a/plugins-extra/query_enhancements/server/sample_data/ppl/logs.json.gz b/plugins-extra/query_enhancements/server/sample_data/ppl/logs.json.gz deleted file mode 100644 index dd973bbdc815..000000000000 Binary files a/plugins-extra/query_enhancements/server/sample_data/ppl/logs.json.gz and /dev/null differ diff --git a/plugins-extra/query_enhancements/server/sample_data/ppl/saved_objects.ts b/plugins-extra/query_enhancements/server/sample_data/ppl/saved_objects.ts deleted file mode 100644 index 48d5bdbb124d..000000000000 --- a/plugins-extra/query_enhancements/server/sample_data/ppl/saved_objects.ts +++ /dev/null @@ -1,242 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -/* eslint max-len: 0 */ -import { SavedObject } from 'opensearch-dashboards/server'; - -export const getSavedObjects = (): SavedObject[] => [ - { - id: 'opensearch_dashboards_sample_data_ppl', - type: 'index-pattern', - - updated_at: '2024-04-29T16:31:23.855Z', - version: 'WzY1NSwxXQ==', - attributes: { - fieldFormatMap: '{"hour_of_day":{}}', - fields: - '[{"name":"@timestamp","type":"date","esTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"_id","type":"string","esTypes":["_id"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_index","type":"string","esTypes":["_index"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_score","type":"number","count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_source","type":"_source","esTypes":["_source"],"count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_type","type":"string","esTypes":["_type"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"agent","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"agent.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"agent"}}},{"name":"bytes","type":"number","esTypes":["long"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"clientip","type":"ip","esTypes":["ip"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"event.dataset","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"extension","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"extension.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"extension"}}},{"name":"geo.coordinates","type":"geo_point","esTypes":["geo_point"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geo.dest","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geo.src","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geo.srcdest","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"host","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"host.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"host"}}},{"name":"index","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"index.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"index"}}},{"name":"ip","type":"ip","esTypes":["ip"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"machine.os","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"machine.os.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"machine.os"}}},{"name":"machine.ram","type":"number","esTypes":["long"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"memory","type":"number","esTypes":["double"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"message","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"message.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"message"}}},{"name":"phpmemory","type":"number","esTypes":["long"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"referer","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"request","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"request.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"request"}}},{"name":"response","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"response.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"response"}}},{"name":"tags","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"tags.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"tags"}}},{"name":"timestamp","type":"date","esTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"url","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"url.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"url"}}},{"name":"utc_time","type":"date","esTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"hour_of_day","type":"number","count":0,"scripted":true,"script":"doc[\'timestamp\'].value.getHour()","lang":"painless","searchable":true,"aggregatable":true,"readFromDocValues":false}]', - timeFieldName: 'timestamp', - title: 'opensearch_dashboards_sample_data_ppl', - }, - references: [], - migrationVersion: { 'index-pattern': '7.6.0' }, - }, - { - id: '9011e5eb-7018-463f-8541-14f98a938f16', - type: 'dashboard', - namespaces: ['default'], - updated_at: '2024-04-29T16:31:23.855Z', - version: 'WzY2MiwxXQ==', - attributes: { - description: "Analyze mock web traffic log data for OpenSearch's website", - hits: 0, - kibanaSavedObjectMeta: { - searchSourceJSON: - '{"query":{"query":"source=opensearch_dashboards_sample_data_ppl | fields agent, timestamp","language":"PPL"},"highlightAll":true,"version":true,"filter":[]}', - }, - optionsJSON: '{"hidePanelTitles":false,"useMargins":true}', - panelsJSON: - '[{"embeddableConfig":{"vis":{"legendOpen":false}},"gridData":{"h":12,"i":"11","w":9,"x":30,"y":15},"panelIndex":"11","title":"","version":"3.0.0","panelRefName":"panel_0"},{"embeddableConfig":{"vis":{"legendOpen":false}},"gridData":{"h":12,"i":"17","w":11,"x":19,"y":15},"panelIndex":"17","version":"3.0.0","panelRefName":"panel_1"},{"embeddableConfig":{},"gridData":{"h":15,"i":"18","w":10,"x":0,"y":0},"panelIndex":"18","title":"","version":"3.0.0","panelRefName":"panel_2"},{"embeddableConfig":{},"gridData":{"h":15,"i":"61eb9da0-d482-434b-8be8-aef9ee62b1e3","w":38,"x":10,"y":0},"panelIndex":"61eb9da0-d482-434b-8be8-aef9ee62b1e3","version":"3.0.0","panelRefName":"panel_3"},{"embeddableConfig":{},"gridData":{"h":12,"i":"91225403-98a6-4780-baf7-99364291eba9","w":19,"x":0,"y":15},"panelIndex":"91225403-98a6-4780-baf7-99364291eba9","version":"3.0.0","panelRefName":"panel_4"},{"embeddableConfig":{"vis":null},"gridData":{"h":12,"i":"83075370-4d2c-4739-aaec-2f2b8cbf7809","w":9,"x":39,"y":15},"panelIndex":"83075370-4d2c-4739-aaec-2f2b8cbf7809","version":"3.0.0","panelRefName":"panel_5"}]', - refreshInterval: { pause: false, value: 900000 }, - timeFrom: '2024-04-01T15:55:56.275Z', - timeRestore: true, - timeTo: '2024-05-30T15:55:59.862Z', - title: '[PPL][Logs] Web Traffic', - version: 1, - }, - references: [ - { id: '02dba266-f5f3-4156-9bf7-70f105e93766', name: 'panel_0', type: 'visualization' }, - { id: '71053772-a267-4b13-be3b-38af62f2d4e1', name: 'panel_1', type: 'visualization' }, - { id: 'ec45f83a-6f93-4ad4-b73a-ffe495840966', name: 'panel_2', type: 'visualization' }, - { id: '21cfa169-0160-4da5-aec5-6d1fce61b1b9', name: 'panel_3', type: 'search' }, - { id: 'df3154e9-e31b-41a3-8b1e-90bf96aeace0', name: 'panel_4', type: 'visualization' }, - { id: 'b9a3e2b1-6a0d-490a-9d56-367aff04cef1', name: 'panel_5', type: 'visualization' }, - ], - migrationVersion: { dashboard: '7.9.3' }, - }, - { - id: 'c2684930-0641-11ef-bc97-5b4786ce056b', - type: 'visualization', - namespaces: ['default'], - updated_at: '2024-04-29T16:10:43.869Z', - version: 'WzIwNCwxXQ==', - attributes: { - title: '[PPL](Line) Traffic over time', - visState: - '{"title":"[PPL](Line) Traffic over time","type":"line","aggs":[{"id":"1","enabled":true,"type":"count","params":{},"schema":"metric"},{"id":"2","enabled":true,"type":"date_histogram","params":{"field":"timestamp","timeRange":{"from":"2024-04-01T15:55:56.275Z","to":"2024-05-30T15:55:59.862Z"},"useNormalizedOpenSearchInterval":true,"scaleMetricValues":false,"interval":"auto","drop_partials":false,"min_doc_count":1,"extended_bounds":{}},"schema":"segment"}],"params":{"type":"line","grid":{"categoryLines":false},"categoryAxes":[{"id":"CategoryAxis-1","type":"category","position":"bottom","show":true,"style":{},"scale":{"type":"linear"},"labels":{"show":true,"filter":true,"truncate":100},"title":{}}],"valueAxes":[{"id":"ValueAxis-1","name":"LeftAxis-1","type":"value","position":"left","show":true,"style":{},"scale":{"type":"linear","mode":"normal"},"labels":{"show":true,"rotate":0,"filter":false,"truncate":100},"title":{"text":"Count"}}],"seriesParams":[{"show":true,"type":"line","mode":"normal","data":{"label":"Count","id":"1"},"valueAxis":"ValueAxis-1","drawLinesBetweenPoints":true,"lineWidth":2,"interpolate":"linear","showCircles":true}],"addTooltip":true,"addLegend":true,"legendPosition":"right","times":[],"addTimeMarker":false,"labels":{},"thresholdLine":{"show":false,"value":10,"width":1,"style":"full","color":"#E7664C"}}}', - uiStateJSON: '{}', - description: '', - version: 1, - kibanaSavedObjectMeta: { - searchSourceJSON: - '{"query":{"query":"source=opensearch_dashboards_sample_data_ppl","language":"PPL"},"filter":[],"indexRefName":"kibanaSavedObjectMeta.searchSourceJSON.index"}', - }, - }, - references: [ - { - name: 'kibanaSavedObjectMeta.searchSourceJSON.index', - type: 'index-pattern', - id: 'opensearch_dashboards_sample_data_ppl', - }, - ], - migrationVersion: { visualization: '7.10.0' }, - }, - { - id: '02dba266-f5f3-4156-9bf7-70f105e93766', - type: 'visualization', - namespaces: ['default'], - updated_at: '2024-04-29T16:31:23.855Z', - version: 'WzY1NiwxXQ==', - attributes: { - description: '', - kibanaSavedObjectMeta: { - searchSourceJSON: - '{"query":{"query":"source=opensearch_dashboards_sample_data_ppl","language":"PPL"},"indexRefName":"kibanaSavedObjectMeta.searchSourceJSON.index"}', - }, - title: '[PPL][Logs] Goals', - uiStateJSON: '{}', - version: 1, - visState: - '{"title":"[PPL][Logs] Goals","type":"gauge","params":{"type":"gauge","addTooltip":true,"addLegend":false,"gauge":{"extendRange":true,"percentageMode":false,"gaugeType":"Arc","gaugeStyle":"Full","backStyle":"Full","orientation":"vertical","colorSchema":"Green to Red","gaugeColorMode":"Labels","colorsRange":[{"from":0,"to":500},{"from":500,"to":1000},{"from":1000,"to":1500}],"invertColors":true,"labels":{"show":false,"color":"black"},"scale":{"show":true,"labels":false,"color":"#333"},"type":"meter","style":{"bgWidth":0.9,"width":0.9,"mask":false,"bgMask":false,"maskBars":50,"bgFill":"#eee","bgColor":false,"subText":"visitors","fontSize":60,"labelColor":true},"alignment":"horizontal"},"isDisplayWarning":false},"aggs":[{"id":"1","enabled":true,"type":"cardinality","schema":"metric","params":{"field":"clientip","customLabel":"Unique Visitors"}}]}', - }, - references: [ - { - id: 'opensearch_dashboards_sample_data_ppl', - name: 'kibanaSavedObjectMeta.searchSourceJSON.index', - type: 'index-pattern', - }, - ], - migrationVersion: { visualization: '7.10.0' }, - }, - { - id: '71053772-a267-4b13-be3b-38af62f2d4e1', - type: 'visualization', - namespaces: ['default'], - updated_at: '2024-04-29T16:31:23.855Z', - version: 'WzY1NywxXQ==', - attributes: { - description: '', - kibanaSavedObjectMeta: { - searchSourceJSON: - '{"query":{"query":"source=opensearch_dashboards_sample_data_ppl","language":"PPL"},"indexRefName":"kibanaSavedObjectMeta.searchSourceJSON.index"}', - }, - title: '[PPL][Logs] Visitors by OS', - uiStateJSON: '{}', - version: 1, - visState: - '{"title":"[PPL][Logs] Visitors by OS","type":"pie","params":{"type":"pie","addTooltip":true,"addLegend":true,"legendPosition":"right","isDonut":true,"labels":{"show":true,"values":true,"last_level":true,"truncate":100}},"aggs":[{"id":"1","enabled":true,"type":"count","schema":"metric","params":{}},{"id":"2","enabled":true,"type":"terms","schema":"segment","params":{"field":"machine.os.keyword","otherBucket":true,"otherBucketLabel":"Other","missingBucket":false,"missingBucketLabel":"Missing","size":10,"order":"desc","orderBy":"1"}}]}', - }, - references: [ - { - id: 'opensearch_dashboards_sample_data_ppl', - name: 'kibanaSavedObjectMeta.searchSourceJSON.index', - type: 'index-pattern', - }, - ], - migrationVersion: { visualization: '7.10.0' }, - }, - { - id: 'ec45f83a-6f93-4ad4-b73a-ffe495840966', - type: 'visualization', - namespaces: ['default'], - updated_at: '2024-04-29T16:31:23.855Z', - version: 'WzY1OCwxXQ==', - attributes: { - description: '', - kibanaSavedObjectMeta: { - searchSourceJSON: - '{"query":{"query":"source=opensearch_dashboards_sample_data_ppl","language":"PPL"},"filter":[]}', - }, - title: '[PPL][Logs] Markdown Instructions', - uiStateJSON: '{}', - version: 1, - visState: - '{"title":"[PPL][Logs] Markdown Instructions","type":"markdown","aggs":[],"params":{"fontSize":12,"openLinksInNewTab":true,"markdown":"### Sample Logs Data (PPL)\\nThis dashboard contains sample data for you to play with. You can view it, search it, and interact with the visualizations. For more information about OpenSearch Dashboards, check our [docs](https://opensearch.org/docs/latest/dashboards/index/).\\n\\nQueries were saved using the language PPL. \\n\\n#### Note\\nComposite aggregations currently do not work. "}}', - }, - references: [], - migrationVersion: { visualization: '7.10.0' }, - }, - { - id: 'df3154e9-e31b-41a3-8b1e-90bf96aeace0', - type: 'visualization', - namespaces: ['default'], - updated_at: '2024-04-29T16:31:23.855Z', - version: 'WzY2MCwxXQ==', - attributes: { - description: '', - kibanaSavedObjectMeta: { - searchSourceJSON: - '{"query":{"query":"source=opensearch_dashboards_sample_data_ppl","language":"PPL"},"filter":[],"indexRefName":"kibanaSavedObjectMeta.searchSourceJSON.index"}', - }, - title: '[PPL](Line) Traffic over time', - uiStateJSON: '{}', - version: 1, - visState: - '{"title":"[PPL](Line) Traffic over time","type":"line","aggs":[{"id":"1","enabled":true,"type":"count","params":{},"schema":"metric"},{"id":"2","enabled":true,"type":"date_histogram","params":{"field":"timestamp","timeRange":{"from":"2024-04-01T15:55:56.275Z","to":"2024-05-30T15:55:59.862Z"},"useNormalizedOpenSearchInterval":true,"scaleMetricValues":false,"interval":"auto","drop_partials":false,"min_doc_count":1,"extended_bounds":{}},"schema":"segment"}],"params":{"type":"line","grid":{"categoryLines":false},"categoryAxes":[{"id":"CategoryAxis-1","type":"category","position":"bottom","show":true,"style":{},"scale":{"type":"linear"},"labels":{"show":true,"filter":true,"truncate":100},"title":{}}],"valueAxes":[{"id":"ValueAxis-1","name":"LeftAxis-1","type":"value","position":"left","show":true,"style":{},"scale":{"type":"linear","mode":"normal"},"labels":{"show":true,"rotate":0,"filter":false,"truncate":100},"title":{"text":"Count"}}],"seriesParams":[{"show":true,"type":"line","mode":"normal","data":{"label":"Count","id":"1"},"valueAxis":"ValueAxis-1","drawLinesBetweenPoints":true,"lineWidth":2,"interpolate":"linear","showCircles":true}],"addTooltip":true,"addLegend":true,"legendPosition":"right","times":[],"addTimeMarker":false,"labels":{},"thresholdLine":{"show":false,"value":10,"width":1,"style":"full","color":"#E7664C"}}}', - }, - references: [ - { - id: 'opensearch_dashboards_sample_data_ppl', - name: 'kibanaSavedObjectMeta.searchSourceJSON.index', - type: 'index-pattern', - }, - ], - migrationVersion: { visualization: '7.10.0' }, - }, - { - id: 'b9a3e2b1-6a0d-490a-9d56-367aff04cef1', - type: 'visualization', - namespaces: ['default'], - updated_at: '2024-04-29T16:31:23.855Z', - version: 'WzY2MSwxXQ==', - attributes: { - description: '', - kibanaSavedObjectMeta: { - searchSourceJSON: - '{"query":{"query":"source=opensearch_dashboards_sample_data_ppl","language":"PPL"},"indexRefName":"kibanaSavedObjectMeta.searchSourceJSON.index"}', - }, - title: '[PPL](Goal) Average machine RAM', - uiStateJSON: '{}', - version: 1, - visState: - '{"title":"[PPL](Goal) Average machine RAM","type":"goal","aggs":[{"id":"1","enabled":true,"type":"avg","params":{"field":"machine.ram"},"schema":"metric"}],"params":{"addTooltip":true,"addLegend":false,"isDisplayWarning":false,"type":"gauge","gauge":{"verticalSplit":false,"autoExtend":false,"percentageMode":true,"gaugeType":"Arc","gaugeStyle":"Full","backStyle":"Full","orientation":"vertical","useRanges":false,"colorSchema":"Green to Red","gaugeColorMode":"None","colorsRange":[{"from":0,"to":10000000000},{"from":10000000000,"to":20000000000}],"invertColors":false,"labels":{"show":true,"color":"black"},"scale":{"show":false,"labels":false,"color":"rgba(105,112,125,0.2)","width":2},"type":"meter","style":{"bgFill":"rgba(105,112,125,0.2)","bgColor":false,"labelColor":false,"subText":"","fontSize":60}}}}', - }, - references: [ - { - id: 'opensearch_dashboards_sample_data_ppl', - name: 'kibanaSavedObjectMeta.searchSourceJSON.index', - type: 'index-pattern', - }, - ], - migrationVersion: { visualization: '7.10.0' }, - }, - { - id: '21cfa169-0160-4da5-aec5-6d1fce61b1b9', - type: 'search', - namespaces: ['default'], - updated_at: '2024-04-29T16:31:23.855Z', - version: 'WzY1OSwxXQ==', - attributes: { - columns: ['_source'], - description: '', - hits: 0, - kibanaSavedObjectMeta: { - searchSourceJSON: - '{"query":{"query":"source=opensearch_dashboards_sample_data_ppl","language":"PPL"},"highlightAll":true,"version":true,"aggs":{"2":{"date_histogram":{"field":"timestamp","calendar_interval":"1d","time_zone":"America/Los_Angeles","min_doc_count":1}}},"filter":[],"indexRefName":"kibanaSavedObjectMeta.searchSourceJSON.index"}', - }, - sort: [], - title: '[PPL] Saved Search', - version: 1, - }, - references: [ - { - id: 'opensearch_dashboards_sample_data_ppl', - name: 'kibanaSavedObjectMeta.searchSourceJSON.index', - type: 'index-pattern', - }, - ], - migrationVersion: { search: '7.9.3' }, - }, -]; diff --git a/plugins-extra/query_enhancements/server/sample_data/search/ppl_search.json.gz b/plugins-extra/query_enhancements/server/sample_data/search/ppl_search.json.gz deleted file mode 100644 index eca9107ce73b..000000000000 Binary files a/plugins-extra/query_enhancements/server/sample_data/search/ppl_search.json.gz and /dev/null differ diff --git a/plugins-extra/query_enhancements/server/sample_data/search/regular_search.json.gz b/plugins-extra/query_enhancements/server/sample_data/search/regular_search.json.gz deleted file mode 100644 index fb98ff927d8b..000000000000 Binary files a/plugins-extra/query_enhancements/server/sample_data/search/regular_search.json.gz and /dev/null differ diff --git a/plugins-extra/query_enhancements/server/types.ts b/plugins-extra/query_enhancements/server/types.ts index 4279d2bd5f9e..b4f3bd12c18e 100644 --- a/plugins-extra/query_enhancements/server/types.ts +++ b/plugins-extra/query_enhancements/server/types.ts @@ -4,7 +4,6 @@ */ import { DataPluginSetup } from 'src/plugins/data/server/plugin'; -import { HomeServerPluginSetup } from 'src/plugins/home/server/plugin'; // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface QueryEnhancementsPluginSetup {} @@ -12,7 +11,6 @@ export interface QueryEnhancementsPluginSetup {} export interface QueryEnhancementsPluginStart {} export interface QueryEnhancementsPluginSetupDependencies { data: DataPluginSetup; - home?: HomeServerPluginSetup; } export interface ISchema { diff --git a/plugins-extra/query_enhancements/server/ui_settings.ts b/plugins-extra/query_enhancements/server/ui_settings.ts index 3c04888234d5..c659e5292a10 100644 --- a/plugins-extra/query_enhancements/server/ui_settings.ts +++ b/plugins-extra/query_enhancements/server/ui_settings.ts @@ -7,17 +7,17 @@ import { i18n } from '@osd/i18n'; import { schema } from '@osd/config-schema'; import { UiSettingsParams } from 'opensearch-dashboards/server'; -import { QUERY_ENABLE_ENHANCEMENTS_SETTING } from '../common'; +import { QUERY_ASSIST_DISABLED } from '../common'; export const uiSettings: Record = { - [QUERY_ENABLE_ENHANCEMENTS_SETTING]: { - name: i18n.translate('queryEnhancements.advancedSettings.enableTitle', { - defaultMessage: 'Enable experimental query enhancements', + [QUERY_ASSIST_DISABLED]: { + name: i18n.translate('queryEnhancements.advancedSettings.queryAssistDisabledTitle', { + defaultMessage: 'Disable experimental query assist in the search bar', }), - value: true, - description: i18n.translate('queryEnhancements.advancedSettings.enableText', { - defaultMessage: `Allows users to query data using enhancements where available. If disabled, - only querying and querying languages that are considered production-ready are available to the user.`, + value: false, + description: i18n.translate('queryEnhancements.advancedSettings.queryAssistDisabledText', { + defaultMessage: `If the query assist is setup and enabled, the query bar will provide suggestions and auto-completions as you type. + This is an experimental feature and may not work as expected. If you encounter issues, you can disable it here.`, }), category: ['search'], schema: schema.boolean(), diff --git a/src/plugins/data/common/constants.ts b/src/plugins/data/common/constants.ts index 817c7a3d263a..feef2097e61c 100644 --- a/src/plugins/data/common/constants.ts +++ b/src/plugins/data/common/constants.ts @@ -35,7 +35,6 @@ export const UI_SETTINGS = { DOC_HIGHLIGHT: 'doc_table:highlight', QUERY_STRING_OPTIONS: 'query:queryString:options', QUERY_ALLOW_LEADING_WILDCARDS: 'query:allowLeadingWildcards', - QUERY_DATA_SOURCE_READONLY: 'query:dataSourceReadOnly', SEARCH_QUERY_LANGUAGE: 'search:queryLanguage', SORT_OPTIONS: 'sort:options', COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX: 'courier:ignoreFilterIfFieldNotInIndex', @@ -61,7 +60,10 @@ export const UI_SETTINGS = { INDEXPATTERN_PLACEHOLDER: 'indexPattern:placeholder', FILTERS_PINNED_BY_DEFAULT: 'filters:pinnedByDefault', FILTERS_EDITOR_SUGGEST_VALUES: 'filterEditor:suggestValues', - QUERY_ENHANCEMENTS_ENABLED: 'queryEnhancements:enable', - DATAFRAME_HYDRATION_STRATEGY: 'dataframe:hydrationStrategy', - POLLING_INTERVAL: 'search:pollingInterval', + QUERY_ENHANCEMENTS_ENABLED: 'query:enhancements:enabled', + QUERY_DATAFRAME_HYDRATION_STRATEGY: 'query:dataframe:hydrationStrategy', + QUERY_POLLING_INTERVAL: 'query:async:pollingInterval', + QUERY_DATA_SOURCE_READONLY: 'query:dataSource:readOnly', + QUERY_SEARCH_BAR_EXTENSIONS_ENABLED: 'query:searchBarExtensions:enabled', + SEARCH_QUERY_LANGUAGE_BLOCKLIST: 'search:queryLanguageBlocklist', } as const; diff --git a/src/plugins/data/common/search/search_source/search_source.ts b/src/plugins/data/common/search/search_source/search_source.ts index 009deeba26c9..1ead80c2f762 100644 --- a/src/plugins/data/common/search/search_source/search_source.ts +++ b/src/plugins/data/common/search/search_source/search_source.ts @@ -134,8 +134,8 @@ export const searchSourceRequiredUiSettings = [ UI_SETTINGS.QUERY_STRING_OPTIONS, UI_SETTINGS.SEARCH_INCLUDE_FROZEN, UI_SETTINGS.SORT_OPTIONS, - UI_SETTINGS.DATAFRAME_HYDRATION_STRATEGY, - UI_SETTINGS.POLLING_INTERVAL, + UI_SETTINGS.QUERY_DATAFRAME_HYDRATION_STRATEGY, + UI_SETTINGS.QUERY_POLLING_INTERVAL, ]; export interface SearchSourceDependencies extends FetchHandlers { diff --git a/src/plugins/data/common/search/search_source/types.ts b/src/plugins/data/common/search/search_source/types.ts index 56ee8e517c81..8a1b7b2ff671 100644 --- a/src/plugins/data/common/search/search_source/types.ts +++ b/src/plugins/data/common/search/search_source/types.ts @@ -105,7 +105,7 @@ export interface SearchSourceFields { timeout?: string; terminate_after?: number; df?: IDataFrame; - dataSource: DataSource; + dataSource?: DataSource; } export interface SearchSourceOptions { diff --git a/src/plugins/data/public/ui/query_editor/language_switcher.test.tsx b/src/plugins/data/public/ui/query_editor/language_selector.test.tsx similarity index 96% rename from src/plugins/data/public/ui/query_editor/language_switcher.test.tsx rename to src/plugins/data/public/ui/query_editor/language_selector.test.tsx index dd1a3b4674cd..76134f58c19d 100644 --- a/src/plugins/data/public/ui/query_editor/language_switcher.test.tsx +++ b/src/plugins/data/public/ui/query_editor/language_selector.test.tsx @@ -29,7 +29,7 @@ */ import React from 'react'; -import { QueryLanguageSwitcher } from './language_switcher'; +import { QueryLanguageSelector } from './language_selector'; import { OpenSearchDashboardsContextProvider } from 'src/plugins/opensearch_dashboards_react/public'; import { coreMock } from '../../../../../core/public/mocks'; import { mountWithIntl } from 'test_utils/enzyme_helpers'; @@ -64,7 +64,7 @@ describe('LanguageSwitcher', () => { return ( - + ); } diff --git a/src/plugins/data/public/ui/query_editor/language_switcher.tsx b/src/plugins/data/public/ui/query_editor/language_selector.tsx similarity index 85% rename from src/plugins/data/public/ui/query_editor/language_switcher.tsx rename to src/plugins/data/public/ui/query_editor/language_selector.tsx index b8f6f9881c99..e8d65e7bd068 100644 --- a/src/plugins/data/public/ui/query_editor/language_switcher.tsx +++ b/src/plugins/data/public/ui/query_editor/language_selector.tsx @@ -13,6 +13,7 @@ interface Props { onSelectLanguage: (newLanguage: string) => void; anchorPosition?: PopoverAnchorPosition; appName?: string; + isEnhancementsEnabled?: boolean; } function mapExternalLanguageToOptions(language: string) { @@ -22,7 +23,7 @@ function mapExternalLanguageToOptions(language: string) { }; } -export const QueryLanguageSwitcher = (props: Props) => { +export const QueryLanguageSelector = (props: Props) => { const dqlLabel = i18n.translate('data.query.queryEditor.dqlLanguageName', { defaultMessage: 'DQL', }); @@ -45,12 +46,15 @@ export const QueryLanguageSwitcher = (props: Props) => { const searchService = getSearchService(); const queryEnhancements = uiService.queryEnhancements; - if (uiService.isEnhancementsEnabled) { + if (props.isEnhancementsEnabled) { queryEnhancements.forEach((enhancement) => { if ( - enhancement.supportedAppNames && - props.appName && - !enhancement.supportedAppNames.includes(props.appName) + (enhancement.supportedAppNames && + props.appName && + !enhancement.supportedAppNames.includes(props.appName)) || + uiService.Settings.getUserQueryLanguageBlocklist().includes( + enhancement.language.toLowerCase() + ) ) return; languageOptions.unshift(mapExternalLanguageToOptions(enhancement.language)); @@ -65,7 +69,7 @@ export const QueryLanguageSwitcher = (props: Props) => { }; const setSearchEnhance = (queryLanguage: string) => { - if (!uiService.isEnhancementsEnabled) return; + if (!props.isEnhancementsEnabled) return; const queryEnhancement = queryEnhancements.get(queryLanguage); searchService.__enhance({ searchInterceptor: queryEnhancement diff --git a/src/plugins/data/public/ui/query_editor/query_editor.tsx b/src/plugins/data/public/ui/query_editor/query_editor.tsx index 2970fb7084d6..8f1145d93fa4 100644 --- a/src/plugins/data/public/ui/query_editor/query_editor.tsx +++ b/src/plugins/data/public/ui/query_editor/query_editor.tsx @@ -29,7 +29,7 @@ import { fromUser, getQueryLog, matchPairs, PersistedLog, toUser } from '../../q import { SuggestionsListSize } from '../typeahead/suggestions_component'; import { DataSettings, QueryEnhancement } from '../types'; import { fetchIndexPatterns } from './fetch_index_patterns'; -import { QueryLanguageSwitcher } from './language_switcher'; +import { QueryLanguageSelector } from './language_selector'; export interface QueryEditorProps { indexPatterns: Array; @@ -504,7 +504,8 @@ export default class QueryEditorUI extends Component { ); const queryLanguageSwitcher = ( - (); const { uiSettings, storage, appName } = opensearchDashboards.services; - const isDataSourceReadOnly = uiSettings.get('query:dataSourceReadOnly'); + const isDataSourceReadOnly = uiSettings.get(UI_SETTINGS.QUERY_DATA_SOURCE_READONLY); + const isSearchBarExtensionsEnabled = uiSettings.get( + UI_SETTINGS.QUERY_SEARCH_BAR_EXTENSIONS_ENABLED + ); const queryLanguage = props.query && props.query.language; const queryUiEnhancement = @@ -304,6 +307,7 @@ export default function QueryEditorTopRow(props: QueryEditorTopRowProps) { } function shouldRenderSearchBarExtensions(): boolean { + if (!isSearchBarExtensionsEnabled) return false; return Boolean( queryLanguage && props.queryEnhancements?.get(queryLanguage)?.searchBar?.extensions?.length ); diff --git a/src/plugins/data/public/ui/query_string_input/query_bar_top_row.tsx b/src/plugins/data/public/ui/query_string_input/query_bar_top_row.tsx index 027c90a6c798..fb0bc625dd09 100644 --- a/src/plugins/data/public/ui/query_string_input/query_bar_top_row.tsx +++ b/src/plugins/data/public/ui/query_string_input/query_bar_top_row.tsx @@ -100,7 +100,6 @@ export default function QueryBarTopRow(props: QueryBarTopRowProps) { const { uiSettings, notifications, storage, appName, docLinks } = opensearchDashboards.services; const osdDQLDocs: string = docLinks!.links.opensearchDashboards.dql.base; - const isDataSourceReadOnly = uiSettings.get('query:dataSourceReadOnly'); const queryLanguage = props.query && props.query.language; const queryUiEnhancement = @@ -224,7 +223,6 @@ export default function QueryBarTopRow(props: QueryBarTopRowProps) { return ( !Array.isArray(props.indexPatterns!) || compact(props.indexPatterns!).length === 0 || - !isDataSourceReadOnly || fromUser(query!.query).includes( typeof props.indexPatterns[0] === 'string' ? props.indexPatterns[0] diff --git a/src/plugins/data/public/ui/search_bar/search_bar.tsx b/src/plugins/data/public/ui/search_bar/search_bar.tsx index b16de8b0cebd..d98679c7c1d1 100644 --- a/src/plugins/data/public/ui/search_bar/search_bar.tsx +++ b/src/plugins/data/public/ui/search_bar/search_bar.tsx @@ -406,6 +406,9 @@ class SearchBarUI extends Component { this.services.uiSettings.get(UI_SETTINGS.QUERY_ENHANCEMENTS_ENABLED); this.props.settings?.setUserQueryEnhancementsEnabled(isEnhancementsEnabledOverride); + this.props.settings?.setUserQueryLanguageBlocklist( + this.services.uiSettings.get(UI_SETTINGS.SEARCH_QUERY_LANGUAGE_BLOCKLIST) + ); const savedQueryManagement = this.state.query && this.props.onClearSavedQuery && ( language.toLowerCase()) + ); + return true; + } + getUserQueryLanguage() { return this.storage.get('opensearchDashboards.userQueryLanguage') || 'kuery'; } @@ -113,6 +127,7 @@ export class Settings { toJSON(): DataSettings { return { // userQueryDataSource: this.getUserQueryDataSource(), + userQueryLanguagesBlocklist: this.getUserQueryLanguageBlocklist(), userQueryEnhancementsEnabled: this.getUserQueryEnhancementsEnabled(), userQueryLanguage: this.getUserQueryLanguage(), userQueryString: this.getUserQueryString(), diff --git a/src/plugins/data/server/search/opensearch_search/get_default_search_params.ts b/src/plugins/data/server/search/opensearch_search/get_default_search_params.ts index 172acf9f0e2e..f280589a5690 100644 --- a/src/plugins/data/server/search/opensearch_search/get_default_search_params.ts +++ b/src/plugins/data/server/search/opensearch_search/get_default_search_params.ts @@ -46,7 +46,7 @@ export async function getDefaultSearchParams(uiSettingsClient: IUiSettingsClient UI_SETTINGS.COURIER_MAX_CONCURRENT_SHARD_REQUESTS ); const dataFrameHydrationStrategy = await uiSettingsClient.get( - UI_SETTINGS.DATAFRAME_HYDRATION_STRATEGY + UI_SETTINGS.QUERY_DATAFRAME_HYDRATION_STRATEGY ); return { maxConcurrentShardRequests: diff --git a/src/plugins/data/server/ui_settings.ts b/src/plugins/data/server/ui_settings.ts index aac92aa56083..dc4e6f383f07 100644 --- a/src/plugins/data/server/ui_settings.ts +++ b/src/plugins/data/server/ui_settings.ts @@ -706,27 +706,30 @@ export function getUiSettings(): Record> { schema: schema.boolean(), }, [UI_SETTINGS.QUERY_ENHANCEMENTS_ENABLED]: { - name: i18n.translate('data.advancedSettings.query.enableTitle', { - defaultMessage: 'Enable experimental query enhancements', + name: i18n.translate('data.advancedSettings.query.enhancements.enableTitle', { + defaultMessage: 'Enable query enhancements', }), value: true, - description: i18n.translate('data.advancedSettings.query.enableText', { - defaultMessage: `Allows users to query data using enhancements where available. If disabled, + description: i18n.translate('data.advancedSettings.query.enhancements.enableText', { + defaultMessage: ` + Experimental: + Allows users to query data using enhancements where available. If disabled, only querying and querying languages that are considered production-ready are available to the user.`, }), category: ['search'], schema: schema.boolean(), }, - [UI_SETTINGS.DATAFRAME_HYDRATION_STRATEGY]: { - name: i18n.translate('data.advancedSettings.dataFrameHydrationStrategyTitle', { + [UI_SETTINGS.QUERY_DATAFRAME_HYDRATION_STRATEGY]: { + name: i18n.translate('data.advancedSettings.query.dataFrameHydrationStrategyTitle', { defaultMessage: 'Data frame hydration strategy', }), value: 'perSource', options: ['perSource', 'perQuery'], optionLabels: dataFrameHydrationStrategyOptionLabels, type: 'select', - description: i18n.translate('data.advancedSettings.dataFrameHydrationStrategyText', { - defaultMessage: `Allows you to set how often the data frame schema is updated. + description: i18n.translate('data.advancedSettings.query.dataframe.hydrationStrategyText', { + defaultMessage: ` + Allows you to set how often the data frame schema is updated.
  • {perSource}: hydrates the schema when the data source changes. For example, any time the index pattern is change the data frame schema is hydrated.
  • @@ -736,7 +739,8 @@ export function getUiSettings(): Record> { Not Implemented.
  • {advanced}: hydrates the schema in intervals. If the schema hasn't changed the interval increases. If the schema has changed the interval resets. Not Implemented.
  • -
`, + + Experimental: Requires query enhancements enabled.`, values: { perSource: dataFrameHydrationStrategyOptionLabels.perSource, perQuery: dataFrameHydrationStrategyOptionLabels.perQuery, @@ -748,28 +752,53 @@ export function getUiSettings(): Record> { schema: schema.string(), }, [UI_SETTINGS.QUERY_DATA_SOURCE_READONLY]: { - name: i18n.translate('data.advancedSettings.query.dataSourceReadOnlyTitle', { - defaultMessage: 'Read-only data source in query bar', + name: i18n.translate('data.advancedSettings.query.dataSource.readOnlyTitle', { + defaultMessage: 'Read-only data source in query editor', }), value: true, - description: i18n.translate('data.advancedSettings.query.dataSourceReadOnlyText', { + description: i18n.translate('data.advancedSettings.query.dataSource.readOnlyText', { defaultMessage: - 'When enabled, the global search bar prevents modifying the data source in the query input. ' + - '
Experimental: Setting to false enables modifying the data source.', + 'When enabled, the search bar prevents modifying the data source in the query input. ' + + 'Experimental: Requires query enhancements enabled.', }), category: ['search'], schema: schema.boolean(), }, - [UI_SETTINGS.POLLING_INTERVAL]: { + [UI_SETTINGS.QUERY_POLLING_INTERVAL]: { name: i18n.translate('data.advancedSettings.query.pollingIntervalTitle', { - defaultMessage: 'Polling interval for queries to external datasources', + defaultMessage: 'Polling interval for async queries', }), value: 5000, description: i18n.translate('data.advancedSettings.query.pollingIntervalText', { - defaultMessage: 'Allows you to set the interval in between polls to an async query job', + defaultMessage: + 'The interval length in milliseconds in between polls to an async query job. ' + + 'Experimental: Requires query enhancements enabled.', }), category: ['search'], schema: schema.number(), }, + [UI_SETTINGS.QUERY_SEARCH_BAR_EXTENSIONS_ENABLED]: { + name: i18n.translate('data.advancedSettings.query.searchBarExtensions.enableTitle', { + defaultMessage: 'Enable search bar extensions in query editor', + }), + value: true, + description: i18n.translate('data.advancedSettings.query.searchBarExtensions.enableText', { + defaultMessage: `Allows for plugins to add features to the query editor. + Experimental: Requires query enhancements enabled.`, + }), + category: ['search'], + schema: schema.boolean(), + }, + [UI_SETTINGS.SEARCH_QUERY_LANGUAGE_BLOCKLIST]: { + name: i18n.translate('data.advancedSettings.searchQueryLanguageBlocklistTitle', { + defaultMessage: 'Additional query languages blocklist', + }), + value: ['none'], + description: i18n.translate('data.advancedSettings.searchQueryLanguageBlocklistText', { + defaultMessage: `Additional languages that are blocked from being used in the query editor. + Note: DQL and Lucene will not be blocked even if set.`, + }), + schema: schema.arrayOf(schema.string()), + }, }; }