diff --git a/packages/kbn-release-notes/src/release_notes_config.ts b/packages/kbn-release-notes/src/release_notes_config.ts index f0e7e76cb461..2dec420d8612 100644 --- a/packages/kbn-release-notes/src/release_notes_config.ts +++ b/packages/kbn-release-notes/src/release_notes_config.ts @@ -158,7 +158,7 @@ export const AREAS: Area[] = [ 'Feature:Filters', 'Feature:Timepicker', 'Feature:Highlight', - 'Feature:KQL', + 'Feature:DQL', 'Feature:Rollups', ], }, diff --git a/src/core/server/saved_objects/service/lib/filter_utils.test.ts b/src/core/server/saved_objects/service/lib/filter_utils.test.ts index d3eb30e5079c..ce7a290067c1 100644 --- a/src/core/server/saved_objects/service/lib/filter_utils.test.ts +++ b/src/core/server/saved_objects/service/lib/filter_utils.test.ts @@ -86,7 +86,7 @@ describe('Filter Utils', () => { test('Empty string filters are ignored', () => { expect(validateConvertFilterToKueryNode(['foo'], '', mockMappings)).toBeUndefined(); }); - test('Validate a simple KQL KueryNode filter', () => { + test('Validate a simple DQL KueryNode filter', () => { expect( validateConvertFilterToKueryNode( ['foo'], @@ -95,7 +95,7 @@ describe('Filter Utils', () => { ) ).toEqual(opensearchKuery.fromKueryExpression('foo.title: "best"')); }); - test('Validate a simple KQL expression filter', () => { + test('Validate a simple DQL expression filter', () => { expect( validateConvertFilterToKueryNode(['foo'], 'foo.attributes.title: "best"', mockMappings) ).toEqual(opensearchKuery.fromKueryExpression('foo.title: "best"')); diff --git a/src/core/server/saved_objects/service/lib/repository.test.js b/src/core/server/saved_objects/service/lib/repository.test.js index 1fcf9c42f623..d5bd10b0fd71 100644 --- a/src/core/server/saved_objects/service/lib/repository.test.js +++ b/src/core/server/saved_objects/service/lib/repository.test.js @@ -2673,7 +2673,7 @@ describe('SavedObjectsRepository', () => { expect(client.search).not.toHaveBeenCalled(); }); - it(`throws when KQL filter syntax is invalid`, async () => { + it(`throws when DQL filter syntax is invalid`, async () => { const findOpts = { namespaces: [namespace], search: 'foo*', @@ -2691,7 +2691,7 @@ describe('SavedObjectsRepository', () => { }; await expect(savedObjectsRepository.find(findOpts)).rejects.toMatchInlineSnapshot(` - [Error: KQLSyntaxError: Expected "(", "{", value, whitespace but "<" found. + [Error: DQLSyntaxError: Expected "(", "{", value, whitespace but "<" found. dashboard.attributes.otherField:< --------------------------------^: Bad Request] `); @@ -2820,7 +2820,7 @@ describe('SavedObjectsRepository', () => { }); }); - it(`accepts KQL expression filter and passes KueryNode to getSearchDsl`, async () => { + it(`accepts DQL expression filter and passes KueryNode to getSearchDsl`, async () => { const findOpts = { namespaces: [namespace], search: 'foo*', @@ -2861,7 +2861,7 @@ describe('SavedObjectsRepository', () => { `); }); - it(`accepts KQL KueryNode filter and passes KueryNode to getSearchDsl`, async () => { + it(`accepts DQL KueryNode filter and passes KueryNode to getSearchDsl`, async () => { const findOpts = { namespaces: [namespace], search: 'foo*', diff --git a/src/core/server/saved_objects/service/lib/repository.ts b/src/core/server/saved_objects/service/lib/repository.ts index c697495d4ce6..d5c9b997dba1 100644 --- a/src/core/server/saved_objects/service/lib/repository.ts +++ b/src/core/server/saved_objects/service/lib/repository.ts @@ -768,8 +768,8 @@ export class SavedObjectsRepository { kueryNode = validateConvertFilterToKueryNode(allowedTypes, filter, this._mappings); } } catch (e) { - if (e.name === 'KQLSyntaxError') { - throw SavedObjectsErrorHelpers.createBadRequestError('KQLSyntaxError: ' + e.message); + if (e.name === 'DQLSyntaxError') { + throw SavedObjectsErrorHelpers.createBadRequestError('DQLSyntaxError: ' + e.message); } else { throw e; } diff --git a/src/plugins/dashboard/public/application/actions/replace_panel_action.tsx b/src/plugins/dashboard/public/application/actions/replace_panel_action.tsx index 6979075d2d9b..9112d5bd0a17 100644 --- a/src/plugins/dashboard/public/application/actions/replace_panel_action.tsx +++ b/src/plugins/dashboard/public/application/actions/replace_panel_action.tsx @@ -59,7 +59,7 @@ export class ReplacePanelAction implements ActionByType { expect(result).toEqual(true); }); - test('should return false for KQL ranges', () => { + test('should return false for DQL ranges', () => { const result = doesKueryExpressionHaveLuceneSyntaxError('bar < 1'); expect(result).toEqual(false); }); @@ -387,7 +387,7 @@ describe('kuery AST API', () => { expect(result).toEqual(true); }); - test('should return false for KQL exists', () => { + test('should return false for DQL exists', () => { const result = doesKueryExpressionHaveLuceneSyntaxError('bar:*'); expect(result).toEqual(false); }); @@ -397,7 +397,7 @@ describe('kuery AST API', () => { expect(result).toEqual(true); }); - test('should return false for KQL wildcards', () => { + test('should return false for DQL wildcards', () => { const result = doesKueryExpressionHaveLuceneSyntaxError('bar: ba*'); expect(result).toEqual(false); }); @@ -442,7 +442,7 @@ describe('kuery AST API', () => { expect(result).toEqual(true); }); - test('should return true for mixed KQL/Lucene queries', () => { + test('should return true for mixed DQL/Lucene queries', () => { const result = doesKueryExpressionHaveLuceneSyntaxError('foo: bar and (baz: qux || bag)'); expect(result).toEqual(true); }); diff --git a/src/plugins/data/common/opensearch_query/kuery/ast/ast.ts b/src/plugins/data/common/opensearch_query/kuery/ast/ast.ts index c5db4798ee9c..98e65197eb9d 100644 --- a/src/plugins/data/common/opensearch_query/kuery/ast/ast.ts +++ b/src/plugins/data/common/opensearch_query/kuery/ast/ast.ts @@ -18,7 +18,7 @@ */ import { nodeTypes } from '../node_types/index'; -import { KQLSyntaxError } from '../kuery_syntax_error'; +import { DQLSyntaxError } from '../kuery_syntax_error'; import { KueryNode, DslQuery, KueryParseOptions } from '../types'; import { IIndexPattern } from '../../../index_patterns/types'; @@ -60,7 +60,7 @@ export const fromKueryExpression = ( return fromExpression(expression, parseOptions, parseKuery); } catch (error) { if (error.name === 'SyntaxError') { - throw new KQLSyntaxError(error, expression); + throw new DQLSyntaxError(error, expression); } else { throw error; } diff --git a/src/plugins/data/common/opensearch_query/kuery/functions/utils/get_full_field_name_node.test.ts b/src/plugins/data/common/opensearch_query/kuery/functions/utils/get_full_field_name_node.test.ts index abfdb2c36382..71fe818f2a0e 100644 --- a/src/plugins/data/common/opensearch_query/kuery/functions/utils/get_full_field_name_node.test.ts +++ b/src/plugins/data/common/opensearch_query/kuery/functions/utils/get_full_field_name_node.test.ts @@ -50,7 +50,7 @@ describe('getFullFieldNameNode', function () { test('should throw an error if a path is provided for a non-nested field', () => { const nameNode = nodeTypes.literal.buildNode('os'); expect(() => getFullFieldNameNode(nameNode, indexPattern, 'machine')).toThrowError( - /machine.os is not a nested field but is in nested group "machine" in the KQL expression/ + /machine.os is not a nested field but is in nested group "machine" in the DQL expression/ ); }); @@ -58,7 +58,7 @@ describe('getFullFieldNameNode', function () { const nameNode = nodeTypes.literal.buildNode('nestedField.child'); expect(() => getFullFieldNameNode(nameNode, indexPattern)).toThrowError( - /nestedField.child is a nested field, but is not in a nested group in the KQL expression./ + /nestedField.child is a nested field, but is not in a nested group in the DQL expression./ ); }); diff --git a/src/plugins/data/common/opensearch_query/kuery/functions/utils/get_full_field_name_node.ts b/src/plugins/data/common/opensearch_query/kuery/functions/utils/get_full_field_name_node.ts index 5a12c7b273a0..408246df41b9 100644 --- a/src/plugins/data/common/opensearch_query/kuery/functions/utils/get_full_field_name_node.ts +++ b/src/plugins/data/common/opensearch_query/kuery/functions/utils/get_full_field_name_node.ts @@ -45,14 +45,14 @@ export function getFullFieldNameNode( if (nestedPath && !nestedPathFromField) { return [ ...acc, - `${field.name} is not a nested field but is in nested group "${nestedPath}" in the KQL expression.`, + `${field.name} is not a nested field but is in nested group "${nestedPath}" in the DQL expression.`, ]; } if (nestedPathFromField && !nestedPath) { return [ ...acc, - `${field.name} is a nested field, but is not in a nested group in the KQL expression.`, + `${field.name} is a nested field, but is not in a nested group in the DQL expression.`, ]; } diff --git a/src/plugins/data/common/opensearch_query/kuery/index.ts b/src/plugins/data/common/opensearch_query/kuery/index.ts index 4184dea62ef2..6363c27b2b6f 100644 --- a/src/plugins/data/common/opensearch_query/kuery/index.ts +++ b/src/plugins/data/common/opensearch_query/kuery/index.ts @@ -17,7 +17,7 @@ * under the License. */ -export { KQLSyntaxError } from './kuery_syntax_error'; +export { DQLSyntaxError } from './kuery_syntax_error'; export { nodeTypes } from './node_types'; export * from './ast'; diff --git a/src/plugins/data/common/opensearch_query/kuery/kuery_syntax_error.test.ts b/src/plugins/data/common/opensearch_query/kuery/kuery_syntax_error.test.ts index cfe2f86e813c..f60eb57c39e5 100644 --- a/src/plugins/data/common/opensearch_query/kuery/kuery_syntax_error.test.ts +++ b/src/plugins/data/common/opensearch_query/kuery/kuery_syntax_error.test.ts @@ -19,7 +19,7 @@ import { fromKueryExpression } from './ast'; -describe('kql syntax errors', () => { +describe('dql syntax errors', () => { it('should throw an error for a field query missing a value', () => { expect(() => { fromKueryExpression('response:'); diff --git a/src/plugins/data/common/opensearch_query/kuery/kuery_syntax_error.ts b/src/plugins/data/common/opensearch_query/kuery/kuery_syntax_error.ts index 4d565ab7a8c0..60dada25c05b 100644 --- a/src/plugins/data/common/opensearch_query/kuery/kuery_syntax_error.ts +++ b/src/plugins/data/common/opensearch_query/kuery/kuery_syntax_error.ts @@ -20,39 +20,39 @@ import { repeat } from 'lodash'; import { i18n } from '@osd/i18n'; -const endOfInputText = i18n.translate('data.common.kql.errors.endOfInputText', { +const endOfInputText = i18n.translate('data.common.dql.errors.endOfInputText', { defaultMessage: 'end of input', }); const grammarRuleTranslations: Record = { - fieldName: i18n.translate('data.common.kql.errors.fieldNameText', { + fieldName: i18n.translate('data.common.dql.errors.fieldNameText', { defaultMessage: 'field name', }), - value: i18n.translate('data.common.kql.errors.valueText', { + value: i18n.translate('data.common.dql.errors.valueText', { defaultMessage: 'value', }), - literal: i18n.translate('data.common.kql.errors.literalText', { + literal: i18n.translate('data.common.dql.errors.literalText', { defaultMessage: 'literal', }), - whitespace: i18n.translate('data.common.kql.errors.whitespaceText', { + whitespace: i18n.translate('data.common.dql.errors.whitespaceText', { defaultMessage: 'whitespace', }), }; -interface KQLSyntaxErrorData extends Error { +interface DQLSyntaxErrorData extends Error { found: string; - expected: KQLSyntaxErrorExpected[] | null; + expected: DQLSyntaxErrorExpected[] | null; location: any; } -interface KQLSyntaxErrorExpected { +interface DQLSyntaxErrorExpected { description: string; } -export class KQLSyntaxError extends Error { +export class DQLSyntaxError extends Error { shortMessage: string; - constructor(error: KQLSyntaxErrorData, expression: any) { + constructor(error: DQLSyntaxErrorData, expression: any) { let message = error.message; if (error.expected) { const translatedExpectations = error.expected.map((expected) => { @@ -61,7 +61,7 @@ export class KQLSyntaxError extends Error { const translatedExpectationText = translatedExpectations.join(', '); - message = i18n.translate('data.common.kql.errors.syntaxError', { + message = i18n.translate('data.common.dql.errors.syntaxError', { defaultMessage: 'Expected {expectedList} but {foundInput} found.', values: { expectedList: translatedExpectationText, @@ -75,7 +75,7 @@ export class KQLSyntaxError extends Error { ); super(fullMessage); - this.name = 'KQLSyntaxError'; + this.name = 'DQLSyntaxError'; this.shortMessage = message; } } diff --git a/src/plugins/data/common/search/aggs/buckets/filters.test.ts b/src/plugins/data/common/search/aggs/buckets/filters.test.ts index f745b4537131..94b6c8b50eab 100644 --- a/src/plugins/data/common/search/aggs/buckets/filters.test.ts +++ b/src/plugins/data/common/search/aggs/buckets/filters.test.ts @@ -113,8 +113,8 @@ describe('Filters Agg', () => { }); }); - describe('using KQL', () => { - test('works with KQL filters', () => { + describe('using DQL', () => { + test('works with DQL filters', () => { const aggConfigs = getAggConfigs({ filters: [ generateFilter('a', 'kuery', 'status:200'), @@ -177,7 +177,7 @@ describe('Filters Agg', () => { `); }); - test('works with KQL wildcards', () => { + test('works with DQL wildcards', () => { const aggConfigs = getAggConfigs({ filters: [generateFilter('a', 'kuery', '*'), generateFilter('b', 'kuery', 'foo*')], }); diff --git a/src/plugins/data/public/ui/query_string_input/_query_bar.scss b/src/plugins/data/public/ui/query_string_input/_query_bar.scss index d4585f997a54..240e92be5141 100644 --- a/src/plugins/data/public/ui/query_string_input/_query_bar.scss +++ b/src/plugins/data/public/ui/query_string_input/_query_bar.scss @@ -4,7 +4,7 @@ } // Uses the append style, but no bordering -.kqlQueryBar__languageSwitcherButton { +.dqlQueryBar__languageSwitcherButton { border-right: none !important; } diff --git a/src/plugins/data/public/ui/query_string_input/language_switcher.tsx b/src/plugins/data/public/ui/query_string_input/language_switcher.tsx index 8bb79b8948f1..1addd67c54e6 100644 --- a/src/plugins/data/public/ui/query_string_input/language_switcher.tsx +++ b/src/plugins/data/public/ui/query_string_input/language_switcher.tsx @@ -46,12 +46,12 @@ export function QueryLanguageSwitcher(props: Props) { const luceneLabel = ( ); - const kqlLabel = ( - + const dqlLabel = ( + ); - const kqlFullName = ( + const dqlFullName = ( ); @@ -60,10 +60,10 @@ export function QueryLanguageSwitcher(props: Props) { setIsPopoverOpen(!isPopoverOpen)} - className="euiFormControlLayout__append kqlQueryBar__languageSwitcherButton" + className="euiFormControlLayout__append dqlQueryBar__languageSwitcherButton" data-test-subj={'switchQueryLanguageButton'} > - {props.language === 'lucene' ? luceneLabel : kqlLabel} + {props.language === 'lucene' ? luceneLabel : dqlLabel} ); @@ -90,13 +90,13 @@ export function QueryLanguageSwitcher(props: Props) {

- {kqlFullName} + {dqlFullName} ), }} @@ -107,15 +107,15 @@ export function QueryLanguageSwitcher(props: Props) { - + + ) : ( - + ) } checked={props.language === 'kuery'} diff --git a/src/plugins/data/public/ui/query_string_input/query_bar_top_row.test.tsx b/src/plugins/data/public/ui/query_string_input/query_bar_top_row.test.tsx index 21ce3d77587b..f9372453c999 100644 --- a/src/plugins/data/public/ui/query_string_input/query_bar_top_row.test.tsx +++ b/src/plugins/data/public/ui/query_string_input/query_bar_top_row.test.tsx @@ -68,7 +68,7 @@ const noop = () => { return; }; -const kqlQuery = { +const dqlQuery = { query: 'response:200', language: 'kuery', }; @@ -126,7 +126,7 @@ describe('QueryBarTopRowTopRow', () => { it('Should render query and time picker', async () => { const { getByText, getByTestId } = render( wrapQueryBarTopRowInContext({ - query: kqlQuery, + query: dqlQuery, screenTitle: 'Another Screen', isDirty: false, indexPatterns: [stubIndexPatternWithFields], @@ -134,14 +134,14 @@ describe('QueryBarTopRowTopRow', () => { }) ); - await waitFor(() => getByText(kqlQuery.query)); + await waitFor(() => getByText(dqlQuery.query)); await waitFor(() => getByTestId('superDatePickerShowDatesButton')); }); it('Should create a unique PersistedLog based on the appName and query language', () => { mount( wrapQueryBarTopRowInContext({ - query: kqlQuery, + query: dqlQuery, screenTitle: 'Another Screen', indexPatterns: [stubIndexPatternWithFields], timeHistory: mockTimeHistory, @@ -215,7 +215,7 @@ describe('QueryBarTopRowTopRow', () => { it('Should render only query input bar', () => { const component = mount( wrapQueryBarTopRowInContext({ - query: kqlQuery, + query: dqlQuery, indexPatterns: [stubIndexPatternWithFields], isDirty: false, screenTitle: 'Another Screen', @@ -233,7 +233,7 @@ describe('QueryBarTopRowTopRow', () => { it('Should NOT render query input bar if disabled', () => { const component = mount( wrapQueryBarTopRowInContext({ - query: kqlQuery, + query: dqlQuery, isDirty: false, screenTitle: 'Another Screen', indexPatterns: [stubIndexPatternWithFields], 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 e904a769f330..99394203ba74 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 @@ -328,7 +328,7 @@ export default function QueryBarTopRow(props: QueryBarTopRowProps) { diff --git a/src/plugins/data/public/ui/query_string_input/query_string_input.test.tsx b/src/plugins/data/public/ui/query_string_input/query_string_input.test.tsx index 990aefc84a85..96490d1e458c 100644 --- a/src/plugins/data/public/ui/query_string_input/query_string_input.test.tsx +++ b/src/plugins/data/public/ui/query_string_input/query_string_input.test.tsx @@ -46,7 +46,7 @@ const noop = () => { return; }; -const kqlQuery = { +const dqlQuery = { query: 'response:200', language: 'kuery', }; @@ -103,14 +103,14 @@ describe('QueryStringInput', () => { it('Should render the given query', async () => { const { getByText } = render( wrapQueryStringInputInContext({ - query: kqlQuery, + query: dqlQuery, onSubmit: noop, indexPatterns: [stubIndexPatternWithFields], }) ); - await waitFor(() => getByText(kqlQuery.query)); - await waitFor(() => getByText('KQL')); + await waitFor(() => getByText(dqlQuery.query)); + await waitFor(() => getByText('DQL')); }); it('Should pass the query language to the language switcher', () => { @@ -127,7 +127,7 @@ describe('QueryStringInput', () => { it('Should disable autoFocus on EuiTextArea when disableAutoFocus prop is true', () => { const component = mount( wrapQueryStringInputInContext({ - query: kqlQuery, + query: dqlQuery, onSubmit: noop, indexPatterns: [stubIndexPatternWithFields], disableAutoFocus: true, @@ -141,7 +141,7 @@ describe('QueryStringInput', () => { mount( wrapQueryStringInputInContext({ - query: kqlQuery, + query: dqlQuery, onSubmit: noop, indexPatterns: [stubIndexPatternWithFields], disableAutoFocus: true, @@ -157,7 +157,7 @@ describe('QueryStringInput', () => { const component = mount( wrapQueryStringInputInContext( { - query: kqlQuery, + query: dqlQuery, onSubmit: mockCallback, indexPatterns: [stubIndexPatternWithFields], disableAutoFocus: true, @@ -180,7 +180,7 @@ describe('QueryStringInput', () => { const component = mount( wrapQueryStringInputInContext({ - query: kqlQuery, + query: dqlQuery, onSubmit: mockCallback, indexPatterns: [stubIndexPatternWithFields], disableAutoFocus: true, @@ -201,7 +201,7 @@ describe('QueryStringInput', () => { const component = mount( wrapQueryStringInputInContext({ - query: kqlQuery, + query: dqlQuery, onBlur: mockCallback, indexPatterns: [stubIndexPatternWithFields], disableAutoFocus: true, @@ -220,7 +220,7 @@ describe('QueryStringInput', () => { const component = mount( wrapQueryStringInputInContext({ - query: kqlQuery, + query: dqlQuery, onChangeQueryInputFocus: mockCallback, indexPatterns: [stubIndexPatternWithFields], disableAutoFocus: true, @@ -237,7 +237,7 @@ describe('QueryStringInput', () => { it('Should use PersistedLog for recent search suggestions', async () => { const component = mount( wrapQueryStringInputInContext({ - query: kqlQuery, + query: dqlQuery, onSubmit: noop, indexPatterns: [stubIndexPatternWithFields], disableAutoFocus: true, @@ -261,7 +261,7 @@ describe('QueryStringInput', () => { mockFetchIndexPatterns.mockClear(); mount( wrapQueryStringInputInContext({ - query: kqlQuery, + query: dqlQuery, onSubmit: noop, indexPatterns: ['logstash-*'], disableAutoFocus: true, diff --git a/src/plugins/data/public/ui/query_string_input/query_string_input.tsx b/src/plugins/data/public/ui/query_string_input/query_string_input.tsx index 411418a962fa..90a29c5c2051 100644 --- a/src/plugins/data/public/ui/query_string_input/query_string_input.tsx +++ b/src/plugins/data/public/ui/query_string_input/query_string_input.tsx @@ -371,34 +371,34 @@ export default class QueryStringInputUI extends Component { 'field' in suggestion && suggestion.field.subType && suggestion.field.subType.nested && - !this.services.storage.get('opensearchDashboards.KQLNestedQuerySyntaxInfoOptOut') + !this.services.storage.get('opensearchDashboards.DQLNestedQuerySyntaxInfoOptOut') ) { const { notifications, docLinks } = this.services; - const onKQLNestedQuerySyntaxInfoOptOut = (toast: Toast) => { + const onDQLNestedQuerySyntaxInfoOptOut = (toast: Toast) => { if (!this.services.storage) return; - this.services.storage.set('opensearchDashboards.KQLNestedQuerySyntaxInfoOptOut', true); + this.services.storage.set('opensearchDashboards.DQLNestedQuerySyntaxInfoOptOut', true); notifications!.toasts.remove(toast); }; if (notifications && docLinks) { const toast = notifications.toasts.add({ - title: i18n.translate('data.query.queryBar.KQLNestedQuerySyntaxInfoTitle', { - defaultMessage: 'KQL nested query syntax', + title: i18n.translate('data.query.queryBar.DQLNestedQuerySyntaxInfoTitle', { + defaultMessage: 'DQL nested query syntax', }), text: toMountPoint(

@@ -408,9 +408,9 @@ export default class QueryStringInputUI extends Component {

- onKQLNestedQuerySyntaxInfoOptOut(toast)}> + onDQLNestedQuerySyntaxInfoOptOut(toast)}> @@ -450,7 +450,7 @@ export default class QueryStringInputUI extends Component { // Send telemetry info every time the user opts in or out of kuery // As a result it is important this function only ever gets called in the // UI component's change handler. - this.services.http.post('/api/opensearch-dashboards/kql_opt_in_stats', { + this.services.http.post('/api/opensearch-dashboards/dql_opt_in_stats', { body: JSON.stringify({ opt_in: language === 'kuery' }), }); diff --git a/src/plugins/data/public/ui/search_bar/search_bar.test.tsx b/src/plugins/data/public/ui/search_bar/search_bar.test.tsx index 0332b74e1aa1..5d7e42384f91 100644 --- a/src/plugins/data/public/ui/search_bar/search_bar.test.tsx +++ b/src/plugins/data/public/ui/search_bar/search_bar.test.tsx @@ -79,7 +79,7 @@ const mockIndexPattern = { ], } as IIndexPattern; -const kqlQuery = { +const dqlQuery = { query: 'response:200', language: 'kuery', }; @@ -184,7 +184,7 @@ describe('SearchBar', () => { indexPatterns: [mockIndexPattern], screenTitle: 'test screen', onQuerySubmit: noop, - query: kqlQuery, + query: dqlQuery, }) ); @@ -199,7 +199,7 @@ describe('SearchBar', () => { indexPatterns: [mockIndexPattern], screenTitle: 'test screen', onQuerySubmit: noop, - query: kqlQuery, + query: dqlQuery, showQueryBar: false, }) ); @@ -215,7 +215,7 @@ describe('SearchBar', () => { indexPatterns: [mockIndexPattern], screenTitle: 'test screen', onQuerySubmit: noop, - query: kqlQuery, + query: dqlQuery, filters: [], onFiltersUpdated: noop, }) diff --git a/src/plugins/data/public/ui/typeahead/suggestion_component.tsx b/src/plugins/data/public/ui/typeahead/suggestion_component.tsx index 540060062cc5..711800cbd87d 100644 --- a/src/plugins/data/public/ui/typeahead/suggestion_component.tsx +++ b/src/plugins/data/public/ui/typeahead/suggestion_component.tsx @@ -25,15 +25,15 @@ import { QuerySuggestion } from '../../autocomplete'; function getEuiIconType(type: string) { switch (type) { case 'field': - return 'kqlField'; + return 'dqlField'; case 'value': - return 'kqlValue'; + return 'dqlValue'; case 'recentSearch': return 'search'; case 'conjunction': - return 'kqlSelector'; + return 'dqlSelector'; case 'operator': - return 'kqlOperand'; + return 'dqlOperand'; default: throw new Error(`Unknown type: ${type}`); } diff --git a/src/plugins/data/server/kql_telemetry/kql_telemetry_service.ts b/src/plugins/data/server/dql_telemetry/dql_telemetry_service.ts similarity index 75% rename from src/plugins/data/server/kql_telemetry/kql_telemetry_service.ts rename to src/plugins/data/server/dql_telemetry/dql_telemetry_service.ts index f2f1381f4e6c..8c927e7d8927 100644 --- a/src/plugins/data/server/kql_telemetry/kql_telemetry_service.ts +++ b/src/plugins/data/server/dql_telemetry/dql_telemetry_service.ts @@ -19,34 +19,34 @@ import { first } from 'rxjs/operators'; import { CoreSetup, Plugin, PluginInitializerContext } from 'opensearch-dashboards/server'; -import { registerKqlTelemetryRoute } from './route'; +import { registerDqlTelemetryRoute } from './route'; import { UsageCollectionSetup } from '../../../usage_collection/server'; -import { makeKQLUsageCollector } from './usage_collector'; -import { kqlTelemetry } from '../saved_objects'; +import { makeDQLUsageCollector } from './usage_collector'; +import { dqlTelemetry } from '../saved_objects'; -export class KqlTelemetryService implements Plugin { +export class DqlTelemetryService implements Plugin { constructor(private initializerContext: PluginInitializerContext) {} public setup( { http, getStartServices, savedObjects }: CoreSetup, { usageCollection }: { usageCollection?: UsageCollectionSetup } ) { - savedObjects.registerType(kqlTelemetry); - registerKqlTelemetryRoute( + savedObjects.registerType(dqlTelemetry); + registerDqlTelemetryRoute( http.createRouter(), getStartServices, - this.initializerContext.logger.get('data', 'kql-telemetry') + this.initializerContext.logger.get('data', 'dql-telemetry') ); if (usageCollection) { this.initializerContext.config.legacy.globalConfig$ .pipe(first()) .toPromise() - .then((config) => makeKQLUsageCollector(usageCollection, config.opensearchDashboards.index)) + .then((config) => makeDQLUsageCollector(usageCollection, config.opensearchDashboards.index)) .catch((e) => { this.initializerContext.logger - .get('kql-telemetry') - .warn(`Registering KQL telemetry collector failed: ${e}`); + .get('dql-telemetry') + .warn(`Registering DQL telemetry collector failed: ${e}`); }); } } diff --git a/src/plugins/data/server/kql_telemetry/index.ts b/src/plugins/data/server/dql_telemetry/index.ts similarity index 92% rename from src/plugins/data/server/kql_telemetry/index.ts rename to src/plugins/data/server/dql_telemetry/index.ts index 0191113d9500..c6a1e10c926b 100644 --- a/src/plugins/data/server/kql_telemetry/index.ts +++ b/src/plugins/data/server/dql_telemetry/index.ts @@ -17,4 +17,4 @@ * under the License. */ -export { KqlTelemetryService } from './kql_telemetry_service'; +export { DqlTelemetryService } from './dql_telemetry_service'; diff --git a/src/plugins/data/server/kql_telemetry/route.ts b/src/plugins/data/server/dql_telemetry/route.ts similarity index 90% rename from src/plugins/data/server/kql_telemetry/route.ts rename to src/plugins/data/server/dql_telemetry/route.ts index 2c1cb69d69d0..cabc5adacc98 100644 --- a/src/plugins/data/server/kql_telemetry/route.ts +++ b/src/plugins/data/server/dql_telemetry/route.ts @@ -20,14 +20,14 @@ import { StartServicesAccessor, IRouter, Logger } from 'opensearch-dashboards/server'; import { schema } from '@osd/config-schema'; -export function registerKqlTelemetryRoute( +export function registerDqlTelemetryRoute( router: IRouter, getStartServices: StartServicesAccessor, logger: Logger ) { router.post( { - path: '/api/opensearch-dashboards/kql_opt_in_stats', + path: '/api/opensearch-dashboards/dql_opt_in_stats', validate: { body: schema.object({ opt_in: schema.boolean(), @@ -45,7 +45,7 @@ export function registerKqlTelemetryRoute( const counterName = optIn ? 'optInCount' : 'optOutCount'; try { - await internalRepository.incrementCounter('kql-telemetry', 'kql-telemetry', counterName); + await internalRepository.incrementCounter('dql-telemetry', 'dql-telemetry', counterName); } catch (error) { logger.warn(`Unable to increment counter: ${error}`); return response.customError({ diff --git a/src/plugins/data/server/kql_telemetry/usage_collector/fetch.test.ts b/src/plugins/data/server/dql_telemetry/usage_collector/fetch.test.ts similarity index 92% rename from src/plugins/data/server/kql_telemetry/usage_collector/fetch.test.ts rename to src/plugins/data/server/dql_telemetry/usage_collector/fetch.test.ts index 2eeae6958849..1dfbdef4a04e 100644 --- a/src/plugins/data/server/kql_telemetry/usage_collector/fetch.test.ts +++ b/src/plugins/data/server/dql_telemetry/usage_collector/fetch.test.ts @@ -35,21 +35,21 @@ function setupMockCallCluster( language: string | undefined | null ) { callCluster = (jest.fn((method, params) => { - if (params && 'id' in params && params.id === 'kql-telemetry:kql-telemetry') { + if (params && 'id' in params && params.id === 'dql-telemetry:dql-telemetry') { if (optCount === null) { return Promise.resolve({ _index: '.opensearch-dashboards_1', _type: 'doc', - _id: 'kql-telemetry:kql-telemetry', + _id: 'dql-telemetry:dql-telemetry', found: false, }); } else { return Promise.resolve({ _source: { - 'kql-telemetry': { + 'dql-telemetry': { ...optCount, }, - type: 'kql-telemetry', + type: 'dql-telemetry', updated_at: '2018-10-05T20:20:56.258Z', }, }); @@ -82,13 +82,13 @@ function setupMockCallCluster( }) as unknown) as LegacyAPICaller; } -describe('makeKQLUsageCollector', () => { +describe('makeDQLUsageCollector', () => { describe('fetch method', () => { beforeEach(() => { fetch = fetchProvider('.opensearch-dashboards'); }); - it('should return opt in data from the .opensearch-dashboards/kql-telemetry doc', async () => { + it('should return opt in data from the .opensearch-dashboards/dql-telemetry doc', async () => { setupMockCallCluster({ optInCount: 1 }, 'kuery'); const fetchResponse = await fetch(callCluster); expect(fetchResponse.optInCount).toBe(1); @@ -114,7 +114,7 @@ describe('makeKQLUsageCollector', () => { expect(fetchResponse.defaultQueryLanguage).toBe('default-lucene'); }); - it('should default to 0 opt in counts if the .opensearch-dashboards/kql-telemetry doc does not exist', async () => { + it('should default to 0 opt in counts if the .opensearch-dashboards/dql-telemetry doc does not exist', async () => { setupMockCallCluster(null, 'kuery'); const fetchResponse = await fetch(callCluster); expect(fetchResponse.optInCount).toBe(0); diff --git a/src/plugins/data/server/kql_telemetry/usage_collector/fetch.ts b/src/plugins/data/server/dql_telemetry/usage_collector/fetch.ts similarity index 94% rename from src/plugins/data/server/kql_telemetry/usage_collector/fetch.ts rename to src/plugins/data/server/dql_telemetry/usage_collector/fetch.ts index 2d912e1e052d..0da51a097875 100644 --- a/src/plugins/data/server/kql_telemetry/usage_collector/fetch.ts +++ b/src/plugins/data/server/dql_telemetry/usage_collector/fetch.ts @@ -34,7 +34,7 @@ export function fetchProvider(index: string) { const [response, config] = await Promise.all([ callCluster('get', { index, - id: 'kql-telemetry:kql-telemetry', + id: 'dql-telemetry:dql-telemetry', ignore: [404], }), callCluster('search', { @@ -66,14 +66,14 @@ export function fetchProvider(index: string) { defaultLanguage = queryLanguageConfigValue; } - const kqlTelemetryDoc = { + const dqlTelemetryDoc = { optInCount: 0, optOutCount: 0, - ...get(response, '_source.kql-telemetry', {}), + ...get(response, '_source.dql-telemetry', {}), }; return { - ...kqlTelemetryDoc, + ...dqlTelemetryDoc, defaultQueryLanguage: defaultLanguage, }; }; diff --git a/src/plugins/data/server/kql_telemetry/usage_collector/index.ts b/src/plugins/data/server/dql_telemetry/usage_collector/index.ts similarity index 92% rename from src/plugins/data/server/kql_telemetry/usage_collector/index.ts rename to src/plugins/data/server/dql_telemetry/usage_collector/index.ts index ea2979834be3..3744ee3c62ff 100644 --- a/src/plugins/data/server/kql_telemetry/usage_collector/index.ts +++ b/src/plugins/data/server/dql_telemetry/usage_collector/index.ts @@ -17,4 +17,4 @@ * under the License. */ -export { makeKQLUsageCollector } from './make_kql_usage_collector'; +export { makeDQLUsageCollector } from './make_dql_usage_collector'; diff --git a/src/plugins/data/server/kql_telemetry/usage_collector/make_kql_usage_collector.test.ts b/src/plugins/data/server/dql_telemetry/usage_collector/make_dql_usage_collector.test.ts similarity index 82% rename from src/plugins/data/server/kql_telemetry/usage_collector/make_kql_usage_collector.test.ts rename to src/plugins/data/server/dql_telemetry/usage_collector/make_dql_usage_collector.test.ts index 232dca9400c5..81d557b922ad 100644 --- a/src/plugins/data/server/kql_telemetry/usage_collector/make_kql_usage_collector.test.ts +++ b/src/plugins/data/server/dql_telemetry/usage_collector/make_dql_usage_collector.test.ts @@ -17,10 +17,10 @@ * under the License. */ -import { makeKQLUsageCollector } from './make_kql_usage_collector'; +import { makeDQLUsageCollector } from './make_dql_usage_collector'; import { UsageCollectionSetup } from '../../../../usage_collection/server'; -describe('makeKQLUsageCollector', () => { +describe('makeDQLUsageCollector', () => { let usageCollectionMock: jest.Mocked; beforeEach(() => { @@ -31,13 +31,13 @@ describe('makeKQLUsageCollector', () => { }); it('should call registerCollector', () => { - makeKQLUsageCollector(usageCollectionMock as UsageCollectionSetup, '.opensearch-dashboards'); + makeDQLUsageCollector(usageCollectionMock as UsageCollectionSetup, '.opensearch-dashboards'); expect(usageCollectionMock.registerCollector).toHaveBeenCalledTimes(1); }); - it('should call makeUsageCollector with type = kql', () => { - makeKQLUsageCollector(usageCollectionMock as UsageCollectionSetup, '.opensearch-dashboards'); + it('should call makeUsageCollector with type = dql', () => { + makeDQLUsageCollector(usageCollectionMock as UsageCollectionSetup, '.opensearch-dashboards'); expect(usageCollectionMock.makeUsageCollector).toHaveBeenCalledTimes(1); - expect(usageCollectionMock.makeUsageCollector.mock.calls[0][0].type).toBe('kql'); + expect(usageCollectionMock.makeUsageCollector.mock.calls[0][0].type).toBe('dql'); }); }); diff --git a/src/plugins/data/server/kql_telemetry/usage_collector/make_kql_usage_collector.ts b/src/plugins/data/server/dql_telemetry/usage_collector/make_dql_usage_collector.ts similarity index 87% rename from src/plugins/data/server/kql_telemetry/usage_collector/make_kql_usage_collector.ts rename to src/plugins/data/server/dql_telemetry/usage_collector/make_dql_usage_collector.ts index 21b3c78c2606..680fe8fc3776 100644 --- a/src/plugins/data/server/kql_telemetry/usage_collector/make_kql_usage_collector.ts +++ b/src/plugins/data/server/dql_telemetry/usage_collector/make_dql_usage_collector.ts @@ -20,12 +20,12 @@ import { fetchProvider, Usage } from './fetch'; import { UsageCollectionSetup } from '../../../../usage_collection/server'; -export async function makeKQLUsageCollector( +export async function makeDQLUsageCollector( usageCollection: UsageCollectionSetup, opensearchDashboardsIndex: string ) { - const kqlUsageCollector = usageCollection.makeUsageCollector({ - type: 'kql', + const dqlUsageCollector = usageCollection.makeUsageCollector({ + type: 'dql', fetch: fetchProvider(opensearchDashboardsIndex), isReady: () => true, schema: { @@ -35,5 +35,5 @@ export async function makeKQLUsageCollector( }, }); - usageCollection.registerCollector(kqlUsageCollector); + usageCollection.registerCollector(dqlUsageCollector); } diff --git a/src/plugins/data/server/plugin.ts b/src/plugins/data/server/plugin.ts index 88f24b7ca5a7..ed84ed4668e8 100644 --- a/src/plugins/data/server/plugin.ts +++ b/src/plugins/data/server/plugin.ts @@ -25,7 +25,7 @@ import { ISearchSetup, ISearchStart, SearchEnhancements } from './search'; import { SearchService } from './search/search_service'; import { QueryService } from './query/query_service'; import { ScriptsService } from './scripts'; -import { KqlTelemetryService } from './kql_telemetry'; +import { DqlTelemetryService } from './dql_telemetry'; import { UsageCollectionSetup } from '../../usage_collection/server'; import { AutocompleteService } from './autocomplete'; import { FieldFormatsService, FieldFormatsSetup, FieldFormatsStart } from './field_formats'; @@ -68,7 +68,7 @@ export class DataServerPlugin > { private readonly searchService: SearchService; private readonly scriptsService: ScriptsService; - private readonly kqlTelemetryService: KqlTelemetryService; + private readonly dqlTelemetryService: DqlTelemetryService; private readonly autocompleteService: AutocompleteService; private readonly indexPatterns = new IndexPatternsService(); private readonly fieldFormats = new FieldFormatsService(); @@ -79,7 +79,7 @@ export class DataServerPlugin this.logger = initializerContext.logger.get('data'); this.searchService = new SearchService(initializerContext, this.logger); this.scriptsService = new ScriptsService(); - this.kqlTelemetryService = new KqlTelemetryService(initializerContext); + this.dqlTelemetryService = new DqlTelemetryService(initializerContext); this.autocompleteService = new AutocompleteService(initializerContext); } @@ -91,7 +91,7 @@ export class DataServerPlugin this.scriptsService.setup(core); this.queryService.setup(core); this.autocompleteService.setup(core); - this.kqlTelemetryService.setup(core, { usageCollection }); + this.dqlTelemetryService.setup(core, { usageCollection }); core.uiSettings.register(getUiSettings()); diff --git a/src/plugins/data/server/saved_objects/kql_telemetry.ts b/src/plugins/data/server/saved_objects/dql_telemetry.ts similarity index 93% rename from src/plugins/data/server/saved_objects/kql_telemetry.ts rename to src/plugins/data/server/saved_objects/dql_telemetry.ts index 47c65f28d4c2..58c7555de4e7 100644 --- a/src/plugins/data/server/saved_objects/kql_telemetry.ts +++ b/src/plugins/data/server/saved_objects/dql_telemetry.ts @@ -18,8 +18,8 @@ */ import { SavedObjectsType } from 'opensearch-dashboards/server'; -export const kqlTelemetry: SavedObjectsType = { - name: 'kql-telemetry', +export const dqlTelemetry: SavedObjectsType = { + name: 'dql-telemetry', namespaceType: 'agnostic', hidden: false, mappings: { diff --git a/src/plugins/data/server/saved_objects/index.ts b/src/plugins/data/server/saved_objects/index.ts index 077f9380823d..306948d15efe 100644 --- a/src/plugins/data/server/saved_objects/index.ts +++ b/src/plugins/data/server/saved_objects/index.ts @@ -18,5 +18,5 @@ */ export { querySavedObjectType } from './query'; export { indexPatternSavedObjectType } from './index_patterns'; -export { kqlTelemetry } from './kql_telemetry'; +export { dqlTelemetry } from './dql_telemetry'; export { searchTelemetry } from './search_telemetry'; diff --git a/src/plugins/data/server/ui_settings.ts b/src/plugins/data/server/ui_settings.ts index 9027200e988e..8d01eb0eca5b 100644 --- a/src/plugins/data/server/ui_settings.ts +++ b/src/plugins/data/server/ui_settings.ts @@ -128,14 +128,14 @@ export function getUiSettings(): Record> { value: DEFAULT_QUERY_LANGUAGE, description: i18n.translate('data.advancedSettings.searchQueryLanguageText', { defaultMessage: - 'Query language used by the query bar. KQL is a new language built specifically for OpenSearch Dashboards.', + 'Query language used by the query bar. DQL is a new language built specifically for OpenSearch Dashboards.', }), type: 'select', options: ['lucene', 'kuery'], optionLabels: { lucene: luceneQueryLanguageLabel, - kuery: i18n.translate('data.advancedSettings.searchQueryLanguageKql', { - defaultMessage: 'KQL', + kuery: i18n.translate('data.advancedSettings.searchQueryLanguageDql', { + defaultMessage: 'DQL', }), }, schema: schema.string(), diff --git a/src/plugins/discover/public/application/angular/discover_state.ts b/src/plugins/discover/public/application/angular/discover_state.ts index 8c61204478b6..debe50bd5d8d 100644 --- a/src/plugins/discover/public/application/angular/discover_state.ts +++ b/src/plugins/discover/public/application/angular/discover_state.ts @@ -48,7 +48,7 @@ export interface AppState { */ interval?: string; /** - * Lucence or KQL query + * Lucence or DQL query */ query?: Query; /** diff --git a/src/plugins/home/public/assets/logos/vsphere.svg b/src/plugins/home/public/assets/logos/vsphere.svg index 2a04026e4643..999fabc613c4 100644 --- a/src/plugins/home/public/assets/logos/vsphere.svg +++ b/src/plugins/home/public/assets/logos/vsphere.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx index f41f4367f60e..fe54c7b5e15a 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx @@ -281,7 +281,7 @@ export class Table extends PureComponent { } ), type: 'icon', - icon: 'kqlSelector', + icon: 'dqlSelector', onClick: (object) => onShowRelationships(object), 'data-test-subj': 'savedObjectsTableAction-relationships', }, diff --git a/src/plugins/telemetry/schema/oss_plugins.json b/src/plugins/telemetry/schema/oss_plugins.json index 497619060b00..d215a397df8e 100644 --- a/src/plugins/telemetry/schema/oss_plugins.json +++ b/src/plugins/telemetry/schema/oss_plugins.json @@ -1,6 +1,6 @@ { "properties": { - "kql": { + "dql": { "properties": { "optInCount": { "type": "long" diff --git a/src/plugins/telemetry_collection_manager/server/encryption/telemetry_jwks.ts b/src/plugins/telemetry_collection_manager/server/encryption/telemetry_jwks.ts index 99754febaf0e..f9b2f4ef7aa2 100644 --- a/src/plugins/telemetry_collection_manager/server/encryption/telemetry_jwks.ts +++ b/src/plugins/telemetry_collection_manager/server/encryption/telemetry_jwks.ts @@ -37,7 +37,7 @@ export const telemetryJWKS: PublicJWKS = { alg: 'RSA-OAEP', e: 'AQAB', n: - 'juVHivsYFznjrDC449oL3xKVTvux_7dEgBGOgJdfzA2R2GspEAOzupT-VkBnqrJnRP_lznM8bQIvvst1f_DNQ1me_Lr9u9cwL5Vq6SWlmw_u9ur_-ewkShU4tBoJDArksOS-ciTaUJoMaxanb7jWexp0pCDlrLrQyAOCnKQL701mD1gdT4rIw7F-jkb5fLUNUVzOGaGyVy6DHAHZx7Tnyw8rswhyRVvuS73imbRp9XcdOFhBDOeSbrSuZGqrVCjoIlWw-UsiW2ueRd8brBoOIHSmTOMIrIMjpPmzMFRKyCvvhnbjrw8j3fQtFII8urhXCVAw8aIHZhiBc5t9ZuwbJw', + 'juVHivsYFznjrDC449oL3xKVTvux_7dEgBGOgJdfzA2R2GspEAOzupT-VkBnqrJnRP_lznM8bQIvvst1f_DNQ1me_Lr9u9cwL5Vq6SWlmw_u9ur_-ewkShU4tBoJDArksOS-ciTaUJoMaxanb7jWexp0pCDlrLrQyAOCnDQL701mD1gdT4rIw7F-jkb5fLUNUVzOGaGyVy6DHAHZx7Tnyw8rswhyRVvuS73imbRp9XcdOFhBDOeSbrSuZGqrVCjoIlWw-UsiW2ueRd8brBoOIHSmTOMIrIMjpPmzMFRKyCvvhnbjrw8j3fQtFII8urhXCVAw8aIHZhiBc5t9ZuwbJw', }, ], }; diff --git a/src/plugins/vis_type_timeseries/server/lib/vis_data/get_series_data.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/get_series_data.js index baacb4d6785f..35cd5cf80df2 100644 --- a/src/plugins/vis_type_timeseries/server/lib/vis_data/get_series_data.js +++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/get_series_data.js @@ -73,7 +73,7 @@ export async function getSeriesData(req, panel) { }, }; } catch (err) { - if (err.body || err.name === 'KQLSyntaxError') { + if (err.body || err.name === 'DQLSyntaxError') { err.response = err.body; return { diff --git a/src/plugins/vis_type_timeseries/server/lib/vis_data/get_table_data.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/get_table_data.js index e8feb10e6f95..5d14bbcfe833 100644 --- a/src/plugins/vis_type_timeseries/server/lib/vis_data/get_table_data.js +++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/get_table_data.js @@ -64,7 +64,7 @@ export async function getTableData(req, panel) { series: buckets.map(processBucket(panel)), }; } catch (err) { - if (err.body || err.name === 'KQLSyntaxError') { + if (err.body || err.name === 'DQLSyntaxError') { err.response = err.body; return { diff --git a/src/plugins/vis_type_timeseries/server/lib/vis_data/handle_error_response.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/handle_error_response.js index 0a842bc1c047..1bbe0576d90d 100644 --- a/src/plugins/vis_type_timeseries/server/lib/vis_data/handle_error_response.js +++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/handle_error_response.js @@ -26,13 +26,13 @@ export const handleErrorResponse = (panel) => (error) => { } catch (e) { errorResponse = error.response; } - if (!errorResponse && !(error.name === 'KQLSyntaxError')) { + if (!errorResponse && !(error.name === 'DQLSyntaxError')) { errorResponse = { message: error.message, stack: error.stack, }; } - if (error.name === 'KQLSyntaxError') { + if (error.name === 'DQLSyntaxError') { errorResponse = { message: error.shortMessage, stack: error.stack, diff --git a/src/plugins/visualizations/server/saved_objects/visualization_migrations.ts b/src/plugins/visualizations/server/saved_objects/visualization_migrations.ts index 4753c40a3c82..59d01111c164 100644 --- a/src/plugins/visualizations/server/saved_objects/visualization_migrations.ts +++ b/src/plugins/visualizations/server/saved_objects/visualization_migrations.ts @@ -322,7 +322,7 @@ const migrateGaugeVerticalSplitToAlignment: SavedObjectMigrationFn = ( }; // Migrate filters (string -> { query: string, language: lucene }) /* - Enabling KQL in TSVB causes problems with savedObject visualizations when these are saved with filters. + Enabling DQL in TSVB causes problems with savedObject visualizations when these are saved with filters. In a visualisation type of saved object, if the visState param is of type metric, the filter is saved as a string that is not interpretted correctly as a lucene query in the visualization itself. We need to transform the filter string into an object containing the original string as a query and specify the query language as lucene. For Metrics visualizations (param.type === "metric"), filters can be applied to each series object in the series array within the SavedObject.visState.params object. diff --git a/test/api_integration/apis/kql_telemetry/kql_telemetry.js b/test/api_integration/apis/dql_telemetry/dql_telemetry.js similarity index 77% rename from test/api_integration/apis/kql_telemetry/kql_telemetry.js rename to test/api_integration/apis/dql_telemetry/dql_telemetry.js index 897359a4eb5d..a1bacd7ce254 100644 --- a/test/api_integration/apis/kql_telemetry/kql_telemetry.js +++ b/test/api_integration/apis/dql_telemetry/dql_telemetry.js @@ -30,9 +30,9 @@ export default function ({ getService }) { before(() => opensearchArchiver.load('saved_objects/basic')); after(() => opensearchArchiver.unload('saved_objects/basic')); - it('should increment the opt *in* counter in the .opensearch-dashboards/kql-telemetry document', async () => { + it('should increment the opt *in* counter in the .opensearch-dashboards/dql-telemetry document', async () => { await supertest - .post('/api/opensearch-dashboards/kql_opt_in_stats') + .post('/api/opensearch-dashboards/dql_opt_in_stats') .set('content-type', 'application/json') .send({ opt_in: true }) .expect(200); @@ -40,17 +40,17 @@ export default function ({ getService }) { return opensearch .search({ index: '.opensearch-dashboards', - q: 'type:kql-telemetry', + q: 'type:dql-telemetry', }) .then((response) => { - const kqlTelemetryDoc = get(response, 'hits.hits[0]._source.kql-telemetry'); - expect(kqlTelemetryDoc.optInCount).to.be(1); + const dqlTelemetryDoc = get(response, 'hits.hits[0]._source.dql-telemetry'); + expect(dqlTelemetryDoc.optInCount).to.be(1); }); }); - it('should increment the opt *out* counter in the .opensearch-dashboards/kql-telemetry document', async () => { + it('should increment the opt *out* counter in the .opensearch-dashboards/dql-telemetry document', async () => { await supertest - .post('/api/opensearch-dashboards/kql_opt_in_stats') + .post('/api/opensearch-dashboards/dql_opt_in_stats') .set('content-type', 'application/json') .send({ opt_in: false }) .expect(200); @@ -58,17 +58,17 @@ export default function ({ getService }) { return opensearch .search({ index: '.opensearch-dashboards', - q: 'type:kql-telemetry', + q: 'type:dql-telemetry', }) .then((response) => { - const kqlTelemetryDoc = get(response, 'hits.hits[0]._source.kql-telemetry'); - expect(kqlTelemetryDoc.optOutCount).to.be(1); + const dqlTelemetryDoc = get(response, 'hits.hits[0]._source.dql-telemetry'); + expect(dqlTelemetryDoc.optOutCount).to.be(1); }); }); it('should report success when opt *in* is incremented successfully', () => { return supertest - .post('/api/opensearch-dashboards/kql_opt_in_stats') + .post('/api/opensearch-dashboards/dql_opt_in_stats') .set('content-type', 'application/json') .send({ opt_in: true }) .expect('Content-Type', /json/) @@ -80,7 +80,7 @@ export default function ({ getService }) { it('should report success when opt *out* is incremented successfully', () => { return supertest - .post('/api/opensearch-dashboards/kql_opt_in_stats') + .post('/api/opensearch-dashboards/dql_opt_in_stats') .set('content-type', 'application/json') .send({ opt_in: false }) .expect('Content-Type', /json/) @@ -93,27 +93,27 @@ export default function ({ getService }) { it('should only accept literal boolean values for the opt_in POST body param', function () { return Bluebird.all([ supertest - .post('/api/opensearch-dashboards/kql_opt_in_stats') + .post('/api/opensearch-dashboards/dql_opt_in_stats') .set('content-type', 'application/json') .send({ opt_in: 'notabool' }) .expect(400), supertest - .post('/api/opensearch-dashboards/kql_opt_in_stats') + .post('/api/opensearch-dashboards/dql_opt_in_stats') .set('content-type', 'application/json') .send({ opt_in: 0 }) .expect(400), supertest - .post('/api/opensearch-dashboards/kql_opt_in_stats') + .post('/api/opensearch-dashboards/dql_opt_in_stats') .set('content-type', 'application/json') .send({ opt_in: null }) .expect(400), supertest - .post('/api/opensearch-dashboards/kql_opt_in_stats') + .post('/api/opensearch-dashboards/dql_opt_in_stats') .set('content-type', 'application/json') .send({ opt_in: undefined }) .expect(400), supertest - .post('/api/opensearch-dashboards/kql_opt_in_stats') + .post('/api/opensearch-dashboards/dql_opt_in_stats') .set('content-type', 'application/json') .send({}) .expect(400), diff --git a/test/api_integration/apis/kql_telemetry/index.js b/test/api_integration/apis/dql_telemetry/index.js similarity index 91% rename from test/api_integration/apis/kql_telemetry/index.js rename to test/api_integration/apis/dql_telemetry/index.js index bf72fa90ac00..c470e694a87d 100644 --- a/test/api_integration/apis/kql_telemetry/index.js +++ b/test/api_integration/apis/dql_telemetry/index.js @@ -18,7 +18,7 @@ */ export default function ({ loadTestFile }) { - describe('KQL', () => { - loadTestFile(require.resolve('./kql_telemetry')); + describe('DQL', () => { + loadTestFile(require.resolve('./dql_telemetry')); }); } diff --git a/test/api_integration/apis/index.js b/test/api_integration/apis/index.js index d07c09963400..d6de75e17b34 100644 --- a/test/api_integration/apis/index.js +++ b/test/api_integration/apis/index.js @@ -23,7 +23,7 @@ export default function ({ loadTestFile }) { loadTestFile(require.resolve('./general')); loadTestFile(require.resolve('./home')); loadTestFile(require.resolve('./index_patterns')); - loadTestFile(require.resolve('./kql_telemetry')); + loadTestFile(require.resolve('./dql_telemetry')); loadTestFile(require.resolve('./saved_objects_management')); loadTestFile(require.resolve('./saved_objects')); loadTestFile(require.resolve('./scripts')); diff --git a/test/api_integration/apis/saved_objects/find.js b/test/api_integration/apis/saved_objects/find.js index 8fb753277122..7b6b6f2c06df 100644 --- a/test/api_integration/apis/saved_objects/find.js +++ b/test/api_integration/apis/saved_objects/find.js @@ -255,7 +255,7 @@ export default function ({ getService }) { }); })); - it('KQL syntax error should return 400 with Bad Request', async () => + it('DQL syntax error should return 400 with Bad Request', async () => await supertest .get( '/api/saved_objects/_find?type=dashboard&filter=dashboard.attributes.title:foo { + public async switchQueryLanguage(lang: 'dql' | 'lucene'): Promise { await testSubjects.click('switchQueryLanguageButton'); - const kqlToggle = await testSubjects.find('languageToggle'); + const dqlToggle = await testSubjects.find('languageToggle'); const currentLang = - (await kqlToggle.getAttribute('aria-checked')) === 'true' ? 'kql' : 'lucene'; + (await dqlToggle.getAttribute('aria-checked')) === 'true' ? 'dql' : 'lucene'; if (lang !== currentLang) { - await kqlToggle.click(); + await dqlToggle.click(); } await browser.pressKeys(browser.keys.ESCAPE); // close popover await this.expectQueryLanguageOrFail(lang); // make sure lang is switched } - public async expectQueryLanguageOrFail(lang: 'kql' | 'lucene'): Promise { + public async expectQueryLanguageOrFail(lang: 'dql' | 'lucene'): Promise { const queryLanguageButton = await testSubjects.find('switchQueryLanguageButton'); expect((await queryLanguageButton.getVisibleText()).toLowerCase()).to.eql(lang); } diff --git a/test/new_visualize_flow/fixtures/opensearch_archiver/opensearch-dashboards/mappings.json b/test/new_visualize_flow/fixtures/opensearch_archiver/opensearch-dashboards/mappings.json index ae98a1c1125a..46656cdebd9a 100644 --- a/test/new_visualize_flow/fixtures/opensearch_archiver/opensearch-dashboards/mappings.json +++ b/test/new_visualize_flow/fixtures/opensearch_archiver/opensearch-dashboards/mappings.json @@ -14,7 +14,7 @@ "config": "ae24d22d5986d04124cc6568f771066f", "dashboard": "d00f614b29a80360e1190193fd333bab", "index-pattern": "66eccb05066c5a89924f48a9e9736499", - "kql-telemetry": "d12a98a6f19a2d273696597547e064ee", + "dql-telemetry": "d12a98a6f19a2d273696597547e064ee", "migrationVersion": "4a1746014a75ade3a714e1db5763276f", "namespace": "2f4316de49999235636386fe51dc06c1", "namespaces": "2f4316de49999235636386fe51dc06c1", @@ -192,7 +192,7 @@ } } }, - "kql-telemetry": { + "dql-telemetry": { "properties": { "optInCount": { "type": "long"