From 6e46314d1cc3444c87e84f103559a46c37a19943 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Mon, 2 Sep 2024 13:31:17 +0200 Subject: [PATCH 01/31] Push flyout implementation --- .../index.ts | 1 + .../src/components/documentation_flyout.tsx | 70 +++++++++++++++++++ .../src/editor_footer/index.tsx | 6 +- 3 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 packages/kbn-language-documentation-popover/src/components/documentation_flyout.tsx diff --git a/packages/kbn-language-documentation-popover/index.ts b/packages/kbn-language-documentation-popover/index.ts index 2c1746383917a8..1327f9bd40f090 100644 --- a/packages/kbn-language-documentation-popover/index.ts +++ b/packages/kbn-language-documentation-popover/index.ts @@ -7,5 +7,6 @@ */ export { LanguageDocumentationPopover } from './src/components/documentation_popover'; +export { LanguageDocumentationFlyout } from './src/components/documentation_flyout'; export { LanguageDocumentationPopoverContent } from './src/components/documentation_content'; export type { LanguageDocumentationSections } from './src/components/documentation_content'; diff --git a/packages/kbn-language-documentation-popover/src/components/documentation_flyout.tsx b/packages/kbn-language-documentation-popover/src/components/documentation_flyout.tsx new file mode 100644 index 00000000000000..2f6fdcb606993d --- /dev/null +++ b/packages/kbn-language-documentation-popover/src/components/documentation_flyout.tsx @@ -0,0 +1,70 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import React, { useCallback, useEffect } from 'react'; +import { EuiFlyout, EuiFlyoutBody, EuiButtonIcon, EuiButtonIconProps } from '@elastic/eui'; +import { + type LanguageDocumentationSections, + LanguageDocumentationPopoverContent, +} from './documentation_content'; + +interface DocumentationFlyoutProps { + language: string; + isHelpMenuOpen: boolean; + onHelpMenuVisibilityChange: (status: boolean) => void; + sections?: LanguageDocumentationSections; + buttonProps?: Omit; + searchInDescription?: boolean; + linkToDocumentation?: string; +} + +function DocumentationFlyout({ + language, + sections, + buttonProps, + searchInDescription, + linkToDocumentation, + isHelpMenuOpen, + onHelpMenuVisibilityChange, +}: DocumentationFlyoutProps) { + const toggleDocumentationFlyout = useCallback(() => { + onHelpMenuVisibilityChange?.(!isHelpMenuOpen); + }, [isHelpMenuOpen, onHelpMenuVisibilityChange]); + + useEffect(() => { + onHelpMenuVisibilityChange(isHelpMenuOpen ?? false); + }, [isHelpMenuOpen, onHelpMenuVisibilityChange]); + + return ( + <> + + {isHelpMenuOpen && ( + onHelpMenuVisibilityChange(false)} + aria-labelledby="esqlInlineDocumentationFlyout" + type="push" + > + + + + + )} + + ); +} + +export const LanguageDocumentationFlyout = React.memo(DocumentationFlyout); diff --git a/packages/kbn-text-based-editor/src/editor_footer/index.tsx b/packages/kbn-text-based-editor/src/editor_footer/index.tsx index a6b36c221d3c17..027baded695f90 100644 --- a/packages/kbn-text-based-editor/src/editor_footer/index.tsx +++ b/packages/kbn-text-based-editor/src/editor_footer/index.tsx @@ -13,7 +13,7 @@ import { EuiText, EuiFlexGroup, EuiFlexItem, EuiCode } from '@elastic/eui'; import { Interpolation, Theme, css } from '@emotion/react'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { - LanguageDocumentationPopover, + LanguageDocumentationFlyout, type LanguageDocumentationSections, } from '@kbn/language-documentation-popover'; import { getLimitFromESQLQuery } from '@kbn/esql-utils'; @@ -289,7 +289,7 @@ export const EditorFooter = memo(function EditorFooter({ )} {documentationSections && !editorIsInline && ( - - Date: Wed, 4 Sep 2024 14:25:11 +0200 Subject: [PATCH 02/31] Separate flyout content --- .../src/components/documentation_content.tsx | 10 +- .../src/components/documentation_flyout.tsx | 10 +- .../documentation_flyout_content.tsx | 214 ++++++++++++++++++ .../src/components/types.ts | 16 ++ .../tsconfig.json | 1 + 5 files changed, 236 insertions(+), 15 deletions(-) create mode 100644 packages/kbn-language-documentation-popover/src/components/documentation_flyout_content.tsx create mode 100644 packages/kbn-language-documentation-popover/src/components/types.ts diff --git a/packages/kbn-language-documentation-popover/src/components/documentation_content.tsx b/packages/kbn-language-documentation-popover/src/components/documentation_content.tsx index daf52aba467270..76b5b6071db7c3 100644 --- a/packages/kbn-language-documentation-popover/src/components/documentation_content.tsx +++ b/packages/kbn-language-documentation-popover/src/components/documentation_content.tsx @@ -21,18 +21,10 @@ import { EuiLink, } from '@elastic/eui'; import { elementToString } from '../utils/element_to_string'; +import type { LanguageDocumentationSections } from './types'; import './documentation.scss'; -export interface LanguageDocumentationSections { - groups: Array<{ - label: string; - description?: string; - items: Array<{ label: string; description?: JSX.Element }>; - }>; - initialSection: JSX.Element; -} - interface DocumentationProps { language: string; sections?: LanguageDocumentationSections; diff --git a/packages/kbn-language-documentation-popover/src/components/documentation_flyout.tsx b/packages/kbn-language-documentation-popover/src/components/documentation_flyout.tsx index 2f6fdcb606993d..cfaf2c6937c6b2 100644 --- a/packages/kbn-language-documentation-popover/src/components/documentation_flyout.tsx +++ b/packages/kbn-language-documentation-popover/src/components/documentation_flyout.tsx @@ -7,10 +7,8 @@ */ import React, { useCallback, useEffect } from 'react'; import { EuiFlyout, EuiFlyoutBody, EuiButtonIcon, EuiButtonIconProps } from '@elastic/eui'; -import { - type LanguageDocumentationSections, - LanguageDocumentationPopoverContent, -} from './documentation_content'; +import { LanguageDocumentationSections } from './types'; +import { LanguageDocumentationFlyoutContent } from './documentation_flyout_content'; interface DocumentationFlyoutProps { language: string; @@ -52,10 +50,10 @@ function DocumentationFlyout({ onClose={() => onHelpMenuVisibilityChange(false)} aria-labelledby="esqlInlineDocumentationFlyout" type="push" + size="s" > - (); + const scrollTargets = useRef>({}); + + useEffect(() => { + if (selectedSection && scrollTargets.current[selectedSection]) { + scrollTargets.current[selectedSection].scrollIntoView(); + } + }, [selectedSection]); + + const [searchText, setSearchText] = useState(''); + + const normalizedSearchText = searchText.trim().toLocaleLowerCase(); + + const filteredGroups = sections?.groups + .map((group) => { + const items = group.items.filter((helpItem) => { + return ( + !normalizedSearchText || + helpItem.label.toLocaleLowerCase().includes(normalizedSearchText) || + // Converting the JSX element to a string first + (searchInDescription && + elementToString(helpItem.description) + ?.toLocaleLowerCase() + .includes(normalizedSearchText)) + ); + }); + return { ...group, items }; + }) + .filter((group) => { + if (group.items.length > 0 || !normalizedSearchText) { + return true; + } + return group.label.toLocaleLowerCase().includes(normalizedSearchText); + }); + + return ( + <> + + {linkToDocumentation && ( + + + {i18n.translate('languageDocumentationPopover.esqlDocsLabel', { + defaultMessage: 'View full ES|QL documentation', + })} + + + )} + + + {/* + + + { + setSearchText(e.target.value); + }} + data-test-subj="language-documentation-navigation-search" + placeholder={i18n.translate('languageDocumentationPopover.searchPlaceholder', { + defaultMessage: 'Search', + })} + /> + + + {filteredGroups?.map((helpGroup, index) => { + return ( + + ); + })} + + + */} + + { + setSearchText(e.target.value); + }} + data-test-subj="language-documentation-navigation-search" + placeholder={i18n.translate('languageDocumentationPopover.searchPlaceholder', { + defaultMessage: 'Search', + })} + /> + +
{ + if (el && sections?.groups?.length) { + scrollTargets.current[sections.groups[0].label] = el; + } + }} + > + {sections?.initialSection} +
+ {sections?.groups.slice(1).map((helpGroup, index) => { + return ( +
{ + if (el) { + scrollTargets.current[helpGroup.label] = el; + } + }} + > +

{helpGroup.label}

+ +

{helpGroup.description}

+ + {sections?.groups[index + 1].items.map((helpItem) => { + return ( +
{ + if (el) { + scrollTargets.current[helpItem.label] = el; + } + }} + > + {helpItem.description} +
+ ); + })} +
+ ); + })} +
+
+
+ + ); +} + +export const LanguageDocumentationFlyoutContent = React.memo(DocumentationFlyoutContent); diff --git a/packages/kbn-language-documentation-popover/src/components/types.ts b/packages/kbn-language-documentation-popover/src/components/types.ts new file mode 100644 index 00000000000000..d518d84cadf518 --- /dev/null +++ b/packages/kbn-language-documentation-popover/src/components/types.ts @@ -0,0 +1,16 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export interface LanguageDocumentationSections { + groups: Array<{ + label: string; + description?: string; + items: Array<{ label: string; description?: JSX.Element }>; + }>; + initialSection: JSX.Element; +} diff --git a/packages/kbn-language-documentation-popover/tsconfig.json b/packages/kbn-language-documentation-popover/tsconfig.json index 48da6397a6448c..f613b6cb759aa9 100644 --- a/packages/kbn-language-documentation-popover/tsconfig.json +++ b/packages/kbn-language-documentation-popover/tsconfig.json @@ -5,6 +5,7 @@ "types": [ "jest", "node", + "@emotion/react/types/css-prop", ] }, "include": [ From d8884d8b14d8a54a49ced9c75786e367476ac524 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Thu, 5 Sep 2024 08:36:31 +0200 Subject: [PATCH 03/31] Improve flyout width --- .../src/components/documentation_flyout.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/kbn-language-documentation-popover/src/components/documentation_flyout.tsx b/packages/kbn-language-documentation-popover/src/components/documentation_flyout.tsx index cfaf2c6937c6b2..29529e40a9969f 100644 --- a/packages/kbn-language-documentation-popover/src/components/documentation_flyout.tsx +++ b/packages/kbn-language-documentation-popover/src/components/documentation_flyout.tsx @@ -6,7 +6,13 @@ * Side Public License, v 1. */ import React, { useCallback, useEffect } from 'react'; -import { EuiFlyout, EuiFlyoutBody, EuiButtonIcon, EuiButtonIconProps } from '@elastic/eui'; +import { + EuiFlyout, + EuiFlyoutBody, + EuiButtonIcon, + EuiButtonIconProps, + useEuiTheme, +} from '@elastic/eui'; import { LanguageDocumentationSections } from './types'; import { LanguageDocumentationFlyoutContent } from './documentation_flyout_content'; @@ -29,6 +35,8 @@ function DocumentationFlyout({ isHelpMenuOpen, onHelpMenuVisibilityChange, }: DocumentationFlyoutProps) { + const { euiTheme } = useEuiTheme(); + const DEFAULT_WIDTH = euiTheme.base * 34; const toggleDocumentationFlyout = useCallback(() => { onHelpMenuVisibilityChange?.(!isHelpMenuOpen); }, [isHelpMenuOpen, onHelpMenuVisibilityChange]); @@ -50,7 +58,7 @@ function DocumentationFlyout({ onClose={() => onHelpMenuVisibilityChange(false)} aria-labelledby="esqlInlineDocumentationFlyout" type="push" - size="s" + size={DEFAULT_WIDTH} > Date: Thu, 5 Sep 2024 11:18:22 +0200 Subject: [PATCH 04/31] Flyout search and navigation --- .../src/components/documentation_flyout.tsx | 20 +- .../documentation_flyout_content.tsx | 227 ++++++++---------- .../src/esql_documentation_sections.tsx | 9 +- 3 files changed, 110 insertions(+), 146 deletions(-) diff --git a/packages/kbn-language-documentation-popover/src/components/documentation_flyout.tsx b/packages/kbn-language-documentation-popover/src/components/documentation_flyout.tsx index 29529e40a9969f..f4817868bc3dfa 100644 --- a/packages/kbn-language-documentation-popover/src/components/documentation_flyout.tsx +++ b/packages/kbn-language-documentation-popover/src/components/documentation_flyout.tsx @@ -6,13 +6,7 @@ * Side Public License, v 1. */ import React, { useCallback, useEffect } from 'react'; -import { - EuiFlyout, - EuiFlyoutBody, - EuiButtonIcon, - EuiButtonIconProps, - useEuiTheme, -} from '@elastic/eui'; +import { EuiFlyout, EuiButtonIcon, EuiButtonIconProps, useEuiTheme } from '@elastic/eui'; import { LanguageDocumentationSections } from './types'; import { LanguageDocumentationFlyoutContent } from './documentation_flyout_content'; @@ -60,13 +54,11 @@ function DocumentationFlyout({ type="push" size={DEFAULT_WIDTH} > - - - + )} diff --git a/packages/kbn-language-documentation-popover/src/components/documentation_flyout_content.tsx b/packages/kbn-language-documentation-popover/src/components/documentation_flyout_content.tsx index cd1ea64b63f9d6..87b3a9a855b5b4 100644 --- a/packages/kbn-language-documentation-popover/src/components/documentation_flyout_content.tsx +++ b/packages/kbn-language-documentation-popover/src/components/documentation_flyout_content.tsx @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import React, { useEffect, useRef, useState } from 'react'; +import React, { useRef, useState, useMemo, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; import { css } from '@emotion/react'; import { @@ -15,6 +15,9 @@ import { EuiFieldSearch, EuiLink, EuiFlyoutHeader, + EuiFlyoutBody, + useEuiTheme, + EuiComboBox, } from '@elastic/eui'; import { elementToString } from '../utils/element_to_string'; import { LanguageDocumentationSections } from './types'; @@ -32,52 +35,58 @@ function DocumentationFlyoutContent({ searchInDescription, linkToDocumentation, }: DocumentationFlyoutProps) { + const { euiTheme } = useEuiTheme(); const [selectedSection, setSelectedSection] = useState(); - const scrollTargets = useRef>({}); - - useEffect(() => { - if (selectedSection && scrollTargets.current[selectedSection]) { - scrollTargets.current[selectedSection].scrollIntoView(); - } - }, [selectedSection]); - const [searchText, setSearchText] = useState(''); - const normalizedSearchText = searchText.trim().toLocaleLowerCase(); + const scrollTargets = useRef>({}); + + const normalizedSearchText = useMemo(() => searchText.trim().toLocaleLowerCase(), [searchText]); - const filteredGroups = sections?.groups - .map((group) => { - const items = group.items.filter((helpItem) => { - return ( - !normalizedSearchText || - helpItem.label.toLocaleLowerCase().includes(normalizedSearchText) || - // Converting the JSX element to a string first - (searchInDescription && - elementToString(helpItem.description) - ?.toLocaleLowerCase() - .includes(normalizedSearchText)) - ); + const filteredGroups = useMemo(() => { + return sections?.groups + .slice(1) + .map((group) => { + const items = group.items.filter((helpItem) => { + return ( + !normalizedSearchText || + helpItem.label.toLocaleLowerCase().includes(normalizedSearchText) || + // Converting the JSX element to a string first + (searchInDescription && + elementToString(helpItem.description) + ?.toLocaleLowerCase() + .includes(normalizedSearchText)) + ); + }); + return { ...group, options: items }; + }) + .filter((group) => { + if (group.options.length > 0 || !normalizedSearchText) { + return true; + } + return group.label.toLocaleLowerCase().includes(normalizedSearchText); }); - return { ...group, items }; - }) - .filter((group) => { - if (group.items.length > 0 || !normalizedSearchText) { - return true; - } - return group.label.toLocaleLowerCase().includes(normalizedSearchText); - }); + }, [sections, normalizedSearchText, searchInDescription]); + + const onNavigationChange = useCallback((selectedOptions) => { + setSelectedSection(selectedOptions.length ? selectedOptions[0].label : undefined); + if (selectedOptions.length) { + const scrollToElement = scrollTargets.current[selectedOptions[0].label]; + scrollToElement.scrollIntoView(); + } + }, []); return ( <> - + {linkToDocumentation && ( - + {i18n.translate('languageDocumentationPopover.esqlDocsLabel', { defaultMessage: 'View full ES|QL documentation', @@ -85,95 +94,59 @@ function DocumentationFlyoutContent({ )} - - - {/* - + - - { - setSearchText(e.target.value); - }} - data-test-subj="language-documentation-navigation-search" - placeholder={i18n.translate('languageDocumentationPopover.searchPlaceholder', { - defaultMessage: 'Search', - })} - /> - - - {filteredGroups?.map((helpGroup, index) => { - return ( - - ); + { + setSearchText(e.target.value); + }} + data-test-subj="language-documentation-navigation-search" + placeholder={i18n.translate('languageDocumentationPopover.searchPlaceholder', { + defaultMessage: 'Search', })} - - - */} - - { - setSearchText(e.target.value); - }} - data-test-subj="language-documentation-navigation-search" - placeholder={i18n.translate('languageDocumentationPopover.searchPlaceholder', { - defaultMessage: 'Search', - })} - /> + fullWidth + compressed + /> + + + + + + + + -
{ - if (el && sections?.groups?.length) { - scrollTargets.current[sections.groups[0].label] = el; - } - }} - > - {sections?.initialSection} -
- {sections?.groups.slice(1).map((helpGroup, index) => { + {!searchText && ( +
{ + if (el && sections?.groups?.length) { + scrollTargets.current[sections.groups[0].label] = el; + } + }} + > + {sections?.initialSection} +
+ )} + {filteredGroups?.map((helpGroup, index) => { return (
{helpGroup.description}

- {sections?.groups[index + 1].items.map((helpItem) => { + {filteredGroups?.[index].options.map((helpItem) => { return (
- - + + ); } diff --git a/packages/kbn-text-based-editor/src/esql_documentation_sections.tsx b/packages/kbn-text-based-editor/src/esql_documentation_sections.tsx index 9976078804819e..d6294061de924a 100644 --- a/packages/kbn-text-based-editor/src/esql_documentation_sections.tsx +++ b/packages/kbn-text-based-editor/src/esql_documentation_sections.tsx @@ -18,8 +18,7 @@ export const initialSection = ( markdownContent={i18n.translate( 'textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.markdown', { - defaultMessage: `## ES|QL - + defaultMessage: ` An ES|QL (Elasticsearch query language) query consists of a series of commands, separated by pipe characters: \`|\`. Each query starts with a **source command**, which produces a table, typically with data from Elasticsearch. A source command can be followed by one or more **processing commands**. Processing commands can change the output table of the previous command by adding, removing, and changing rows and columns. @@ -87,7 +86,7 @@ ES|QL can access the following metadata fields: Use the \`METADATA\` directive to enable metadata fields: \`\`\` -FROM index [METADATA _index, _id] +FROM index METADATA _index, _id \`\`\` Metadata fields are only available if the source of the data is an index. Consequently, \`FROM\` is the only source commands that supports the \`METADATA\` directive. @@ -95,7 +94,7 @@ Metadata fields are only available if the source of the data is an index. Conseq Once enabled, the fields are then available to subsequent processing commands, just like the other index fields: \`\`\` -FROM ul_logs, apps [METADATA _index, _version] +FROM ul_logs, apps METADATA _index, _version | WHERE id IN (13, 14) AND _version == 1 | EVAL key = CONCAT(_index, "_", TO_STR(id)) | SORT id, _index @@ -105,7 +104,7 @@ FROM ul_logs, apps [METADATA _index, _version] Also, similar to the index fields, once an aggregation is performed, a metadata field will no longer be accessible to subsequent commands, unless used as grouping field: \`\`\` -FROM employees [METADATA _index, _id] +FROM employees METADATA _index, _id | STATS max = MAX(emp_no) BY _index \`\`\` `, From 558dc9c97dc667392af2ec3aa1c59169951cfe7b Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Thu, 5 Sep 2024 11:25:06 +0200 Subject: [PATCH 05/31] Small fixes --- packages/kbn-language-documentation-popover/index.ts | 2 +- .../src/components/documentation_content.tsx | 2 +- .../src/components/documentation_flyout.tsx | 4 +--- .../src/components/documentation_flyout_content.tsx | 4 ++-- .../src/components/documentation_popover.tsx | 6 ++---- .../src/{components => }/types.ts | 0 packages/kbn-text-based-editor/src/editor_footer/index.tsx | 2 -- 7 files changed, 7 insertions(+), 13 deletions(-) rename packages/kbn-language-documentation-popover/src/{components => }/types.ts (100%) diff --git a/packages/kbn-language-documentation-popover/index.ts b/packages/kbn-language-documentation-popover/index.ts index 1327f9bd40f090..4fedfa21c23f8f 100644 --- a/packages/kbn-language-documentation-popover/index.ts +++ b/packages/kbn-language-documentation-popover/index.ts @@ -9,4 +9,4 @@ export { LanguageDocumentationPopover } from './src/components/documentation_popover'; export { LanguageDocumentationFlyout } from './src/components/documentation_flyout'; export { LanguageDocumentationPopoverContent } from './src/components/documentation_content'; -export type { LanguageDocumentationSections } from './src/components/documentation_content'; +export type { LanguageDocumentationSections } from './src/types'; diff --git a/packages/kbn-language-documentation-popover/src/components/documentation_content.tsx b/packages/kbn-language-documentation-popover/src/components/documentation_content.tsx index 76b5b6071db7c3..30296931f80c6f 100644 --- a/packages/kbn-language-documentation-popover/src/components/documentation_content.tsx +++ b/packages/kbn-language-documentation-popover/src/components/documentation_content.tsx @@ -21,7 +21,7 @@ import { EuiLink, } from '@elastic/eui'; import { elementToString } from '../utils/element_to_string'; -import type { LanguageDocumentationSections } from './types'; +import type { LanguageDocumentationSections } from '../types'; import './documentation.scss'; diff --git a/packages/kbn-language-documentation-popover/src/components/documentation_flyout.tsx b/packages/kbn-language-documentation-popover/src/components/documentation_flyout.tsx index f4817868bc3dfa..7133099b44b1cd 100644 --- a/packages/kbn-language-documentation-popover/src/components/documentation_flyout.tsx +++ b/packages/kbn-language-documentation-popover/src/components/documentation_flyout.tsx @@ -7,11 +7,10 @@ */ import React, { useCallback, useEffect } from 'react'; import { EuiFlyout, EuiButtonIcon, EuiButtonIconProps, useEuiTheme } from '@elastic/eui'; -import { LanguageDocumentationSections } from './types'; +import { LanguageDocumentationSections } from '../types'; import { LanguageDocumentationFlyoutContent } from './documentation_flyout_content'; interface DocumentationFlyoutProps { - language: string; isHelpMenuOpen: boolean; onHelpMenuVisibilityChange: (status: boolean) => void; sections?: LanguageDocumentationSections; @@ -21,7 +20,6 @@ interface DocumentationFlyoutProps { } function DocumentationFlyout({ - language, sections, buttonProps, searchInDescription, diff --git a/packages/kbn-language-documentation-popover/src/components/documentation_flyout_content.tsx b/packages/kbn-language-documentation-popover/src/components/documentation_flyout_content.tsx index 87b3a9a855b5b4..20766efd5eae4f 100644 --- a/packages/kbn-language-documentation-popover/src/components/documentation_flyout_content.tsx +++ b/packages/kbn-language-documentation-popover/src/components/documentation_flyout_content.tsx @@ -20,7 +20,7 @@ import { EuiComboBox, } from '@elastic/eui'; import { elementToString } from '../utils/element_to_string'; -import { LanguageDocumentationSections } from './types'; +import { LanguageDocumentationSections } from '../types'; interface DocumentationFlyoutProps { sections?: LanguageDocumentationSections; @@ -84,7 +84,7 @@ function DocumentationFlyoutContent({ grow={false} css={css` align-items: flex-end; - padding-top: ${euiTheme.size.xs} + padding-top: ${euiTheme.size.xs}; `} > diff --git a/packages/kbn-language-documentation-popover/src/components/documentation_popover.tsx b/packages/kbn-language-documentation-popover/src/components/documentation_popover.tsx index b66a521b475a4e..e77a269c532538 100644 --- a/packages/kbn-language-documentation-popover/src/components/documentation_popover.tsx +++ b/packages/kbn-language-documentation-popover/src/components/documentation_popover.tsx @@ -14,10 +14,8 @@ import { EuiButtonIconProps, EuiOutsideClickDetector, } from '@elastic/eui'; -import { - type LanguageDocumentationSections, - LanguageDocumentationPopoverContent, -} from './documentation_content'; +import { LanguageDocumentationPopoverContent } from './documentation_content'; +import type { LanguageDocumentationSections } from '../types'; interface DocumentationPopoverProps { language: string; diff --git a/packages/kbn-language-documentation-popover/src/components/types.ts b/packages/kbn-language-documentation-popover/src/types.ts similarity index 100% rename from packages/kbn-language-documentation-popover/src/components/types.ts rename to packages/kbn-language-documentation-popover/src/types.ts diff --git a/packages/kbn-text-based-editor/src/editor_footer/index.tsx b/packages/kbn-text-based-editor/src/editor_footer/index.tsx index 027baded695f90..7d12ac3ea983e2 100644 --- a/packages/kbn-text-based-editor/src/editor_footer/index.tsx +++ b/packages/kbn-text-based-editor/src/editor_footer/index.tsx @@ -290,7 +290,6 @@ export const EditorFooter = memo(function EditorFooter({ {documentationSections && !editorIsInline && ( Date: Fri, 6 Sep 2024 11:39:51 +0200 Subject: [PATCH 06/31] Inline documentation component --- .../index.ts | 8 +- ...language_documentation_popover.stories.tsx | 2 +- .../src/components/as_flyout/index.tsx | 105 ++++++++++ .../src/components/as_inline/index.tsx | 74 +++++++ .../{ => as_popover}/documentation.scss | 0 .../index.tsx} | 4 +- .../popover_content.test.tsx} | 2 +- .../popover_content.tsx} | 36 +--- .../src/components/documentation_flyout.tsx | 66 ------- .../documentation_flyout_content.tsx | 187 ------------------ .../shared/documentation_content.tsx | 81 ++++++++ .../shared/documentation_navigation.tsx | 97 +++++++++ .../src/components/shared/index.ts | 10 + .../src/utils/get_filtered_groups.ts | 39 ++++ .../src/editor_footer/index.tsx | 52 ++--- packages/kbn-text-based-editor/src/helpers.ts | 8 - .../src/text_based_languages_editor.tsx | 3 - 17 files changed, 448 insertions(+), 326 deletions(-) create mode 100644 packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx create mode 100644 packages/kbn-language-documentation-popover/src/components/as_inline/index.tsx rename packages/kbn-language-documentation-popover/src/components/{ => as_popover}/documentation.scss (100%) rename packages/kbn-language-documentation-popover/src/components/{documentation_popover.tsx => as_popover/index.tsx} (94%) rename packages/kbn-language-documentation-popover/src/components/{documentation_content.test.tsx => as_popover/popover_content.test.tsx} (97%) rename packages/kbn-language-documentation-popover/src/components/{documentation_content.tsx => as_popover/popover_content.tsx} (86%) delete mode 100644 packages/kbn-language-documentation-popover/src/components/documentation_flyout.tsx delete mode 100644 packages/kbn-language-documentation-popover/src/components/documentation_flyout_content.tsx create mode 100644 packages/kbn-language-documentation-popover/src/components/shared/documentation_content.tsx create mode 100644 packages/kbn-language-documentation-popover/src/components/shared/documentation_navigation.tsx create mode 100644 packages/kbn-language-documentation-popover/src/components/shared/index.ts create mode 100644 packages/kbn-language-documentation-popover/src/utils/get_filtered_groups.ts diff --git a/packages/kbn-language-documentation-popover/index.ts b/packages/kbn-language-documentation-popover/index.ts index 4fedfa21c23f8f..2a05e81d285879 100644 --- a/packages/kbn-language-documentation-popover/index.ts +++ b/packages/kbn-language-documentation-popover/index.ts @@ -5,8 +5,8 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - -export { LanguageDocumentationPopover } from './src/components/documentation_popover'; -export { LanguageDocumentationFlyout } from './src/components/documentation_flyout'; -export { LanguageDocumentationPopoverContent } from './src/components/documentation_content'; +export { LanguageDocumentationPopover } from './src/components/as_popover'; +export { LanguageDocumentationPopoverContent } from './src/components/as_popover/popover_content'; +export { LanguageDocumentationFlyout } from './src/components/as_flyout'; +export { LanguageDocumentationInline } from './src/components/as_inline'; export type { LanguageDocumentationSections } from './src/types'; diff --git a/packages/kbn-language-documentation-popover/src/__stories__/language_documentation_popover.stories.tsx b/packages/kbn-language-documentation-popover/src/__stories__/language_documentation_popover.stories.tsx index 947a8048c30975..478767727cd818 100644 --- a/packages/kbn-language-documentation-popover/src/__stories__/language_documentation_popover.stories.tsx +++ b/packages/kbn-language-documentation-popover/src/__stories__/language_documentation_popover.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { storiesOf } from '@storybook/react'; -import { LanguageDocumentationPopover } from '../components/documentation_popover'; +import { LanguageDocumentationPopover } from '../components/as_popover'; const sections = { groups: [ diff --git a/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx b/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx new file mode 100644 index 00000000000000..04a3bee15cf66b --- /dev/null +++ b/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx @@ -0,0 +1,105 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import React, { useCallback, useEffect, useState, useRef, useMemo } from 'react'; +import { + EuiFlyout, + EuiButtonIcon, + EuiButtonIconProps, + useEuiTheme, + EuiFlyoutBody, + EuiFlyoutHeader, +} from '@elastic/eui'; +import { getFilteredGroups } from '../../utils/get_filtered_groups'; +import { DocumentationMainContent, DocumentationNavigation } from '../shared'; +import type { LanguageDocumentationSections } from '../../types'; + +interface DocumentationFlyoutProps { + isHelpMenuOpen: boolean; + onHelpMenuVisibilityChange: (status: boolean) => void; + sections?: LanguageDocumentationSections; + buttonProps?: Omit; + searchInDescription?: boolean; + linkToDocumentation?: string; +} + +function DocumentationFlyout({ + sections, + buttonProps, + searchInDescription, + linkToDocumentation, + isHelpMenuOpen, + onHelpMenuVisibilityChange, +}: DocumentationFlyoutProps) { + const { euiTheme } = useEuiTheme(); + const DEFAULT_WIDTH = euiTheme.base * 34; + + const [selectedSection, setSelectedSection] = useState(); + const [searchText, setSearchText] = useState(''); + + const scrollTargets = useRef>({}); + + const filteredGroups = useMemo(() => { + return getFilteredGroups(searchText, searchInDescription, sections); + }, [sections, searchText, searchInDescription]); + + const onNavigationChange = useCallback((selectedOptions) => { + setSelectedSection(selectedOptions.length ? selectedOptions[0].label : undefined); + if (selectedOptions.length) { + const scrollToElement = scrollTargets.current[selectedOptions[0].label]; + scrollToElement.scrollIntoView(); + } + }, []); + + const toggleDocumentationFlyout = useCallback(() => { + onHelpMenuVisibilityChange?.(!isHelpMenuOpen); + }, [isHelpMenuOpen, onHelpMenuVisibilityChange]); + + useEffect(() => { + onHelpMenuVisibilityChange(isHelpMenuOpen ?? false); + }, [isHelpMenuOpen, onHelpMenuVisibilityChange]); + + return ( + <> + + {isHelpMenuOpen && ( + onHelpMenuVisibilityChange(false)} + aria-labelledby="esqlInlineDocumentationFlyout" + type="push" + size={DEFAULT_WIDTH} + > + + + + + + + + )} + + ); +} + +export const LanguageDocumentationFlyout = React.memo(DocumentationFlyout); diff --git a/packages/kbn-language-documentation-popover/src/components/as_inline/index.tsx b/packages/kbn-language-documentation-popover/src/components/as_inline/index.tsx new file mode 100644 index 00000000000000..be8167bb58e947 --- /dev/null +++ b/packages/kbn-language-documentation-popover/src/components/as_inline/index.tsx @@ -0,0 +1,74 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import React, { useCallback, useState, useRef, useMemo } from 'react'; +import { css } from '@emotion/react'; +import { useEuiTheme, euiScrollBarStyles, EuiSpacer } from '@elastic/eui'; +import { getFilteredGroups } from '../../utils/get_filtered_groups'; +import { DocumentationMainContent, DocumentationNavigation } from '../shared'; +import type { LanguageDocumentationSections } from '../../types'; + +interface DocumentationInlineProps { + sections?: LanguageDocumentationSections; + searchInDescription?: boolean; + linkToDocumentation?: string; +} + +const MAX_HEIGHT = 250; + +function DocumentationInline({ + sections, + searchInDescription, + linkToDocumentation, +}: DocumentationInlineProps) { + const theme = useEuiTheme(); + const scrollBarStyles = euiScrollBarStyles(theme); + const [selectedSection, setSelectedSection] = useState(); + const [searchText, setSearchText] = useState(''); + + const scrollTargets = useRef>({}); + + const filteredGroups = useMemo(() => { + return getFilteredGroups(searchText, searchInDescription, sections); + }, [sections, searchText, searchInDescription]); + + const onNavigationChange = useCallback((selectedOptions) => { + setSelectedSection(selectedOptions.length ? selectedOptions[0].label : undefined); + if (selectedOptions.length) { + const scrollToElement = scrollTargets.current[selectedOptions[0].label]; + scrollToElement.scrollIntoView(); + } + }, []); + + return ( +
+ + + +
+ ); +} + +export const LanguageDocumentationInline = React.memo(DocumentationInline); diff --git a/packages/kbn-language-documentation-popover/src/components/documentation.scss b/packages/kbn-language-documentation-popover/src/components/as_popover/documentation.scss similarity index 100% rename from packages/kbn-language-documentation-popover/src/components/documentation.scss rename to packages/kbn-language-documentation-popover/src/components/as_popover/documentation.scss diff --git a/packages/kbn-language-documentation-popover/src/components/documentation_popover.tsx b/packages/kbn-language-documentation-popover/src/components/as_popover/index.tsx similarity index 94% rename from packages/kbn-language-documentation-popover/src/components/documentation_popover.tsx rename to packages/kbn-language-documentation-popover/src/components/as_popover/index.tsx index e77a269c532538..2836a02f893232 100644 --- a/packages/kbn-language-documentation-popover/src/components/documentation_popover.tsx +++ b/packages/kbn-language-documentation-popover/src/components/as_popover/index.tsx @@ -14,8 +14,8 @@ import { EuiButtonIconProps, EuiOutsideClickDetector, } from '@elastic/eui'; -import { LanguageDocumentationPopoverContent } from './documentation_content'; -import type { LanguageDocumentationSections } from '../types'; +import { LanguageDocumentationPopoverContent } from './popover_content'; +import type { LanguageDocumentationSections } from '../../types'; interface DocumentationPopoverProps { language: string; diff --git a/packages/kbn-language-documentation-popover/src/components/documentation_content.test.tsx b/packages/kbn-language-documentation-popover/src/components/as_popover/popover_content.test.tsx similarity index 97% rename from packages/kbn-language-documentation-popover/src/components/documentation_content.test.tsx rename to packages/kbn-language-documentation-popover/src/components/as_popover/popover_content.test.tsx index 17ab14272299ef..c916ec0cccd3f5 100644 --- a/packages/kbn-language-documentation-popover/src/components/documentation_content.test.tsx +++ b/packages/kbn-language-documentation-popover/src/components/as_popover/popover_content.test.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { mountWithIntl, findTestSubject } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; import { Markdown } from '@kbn/shared-ux-markdown'; -import { LanguageDocumentationPopoverContent } from './documentation_content'; +import { LanguageDocumentationPopoverContent } from './popover_content'; describe('###Documentation popover content', () => { const sections = { diff --git a/packages/kbn-language-documentation-popover/src/components/documentation_content.tsx b/packages/kbn-language-documentation-popover/src/components/as_popover/popover_content.tsx similarity index 86% rename from packages/kbn-language-documentation-popover/src/components/documentation_content.tsx rename to packages/kbn-language-documentation-popover/src/components/as_popover/popover_content.tsx index 30296931f80c6f..f7cb6ca81dae30 100644 --- a/packages/kbn-language-documentation-popover/src/components/documentation_content.tsx +++ b/packages/kbn-language-documentation-popover/src/components/as_popover/popover_content.tsx @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import React, { useEffect, useRef, useState } from 'react'; +import React, { useEffect, useRef, useState, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiFlexGroup, @@ -20,8 +20,8 @@ import { EuiSpacer, EuiLink, } from '@elastic/eui'; -import { elementToString } from '../utils/element_to_string'; -import type { LanguageDocumentationSections } from '../types'; +import { getFilteredGroups } from '../../utils/get_filtered_groups'; +import type { LanguageDocumentationSections } from '../../types'; import './documentation.scss'; @@ -51,29 +51,9 @@ function DocumentationContent({ const [searchText, setSearchText] = useState(''); - const normalizedSearchText = searchText.trim().toLocaleLowerCase(); - - const filteredGroups = sections?.groups - .map((group) => { - const items = group.items.filter((helpItem) => { - return ( - !normalizedSearchText || - helpItem.label.toLocaleLowerCase().includes(normalizedSearchText) || - // Converting the JSX element to a string first - (searchInDescription && - elementToString(helpItem.description) - ?.toLocaleLowerCase() - .includes(normalizedSearchText)) - ); - }); - return { ...group, items }; - }) - .filter((group) => { - if (group.items.length > 0 || !normalizedSearchText) { - return true; - } - return group.label.toLocaleLowerCase().includes(normalizedSearchText); - }); + const filteredGroups = useMemo(() => { + return getFilteredGroups(searchText, searchInDescription, sections); + }, [sections, searchText, searchInDescription]); return ( <> @@ -148,12 +128,12 @@ function DocumentationContent({ - {helpGroup.items.length ? ( + {helpGroup.options.length ? ( <> - {helpGroup.items.map((helpItem) => { + {helpGroup.options.map((helpItem) => { return ( void; - sections?: LanguageDocumentationSections; - buttonProps?: Omit; - searchInDescription?: boolean; - linkToDocumentation?: string; -} - -function DocumentationFlyout({ - sections, - buttonProps, - searchInDescription, - linkToDocumentation, - isHelpMenuOpen, - onHelpMenuVisibilityChange, -}: DocumentationFlyoutProps) { - const { euiTheme } = useEuiTheme(); - const DEFAULT_WIDTH = euiTheme.base * 34; - const toggleDocumentationFlyout = useCallback(() => { - onHelpMenuVisibilityChange?.(!isHelpMenuOpen); - }, [isHelpMenuOpen, onHelpMenuVisibilityChange]); - - useEffect(() => { - onHelpMenuVisibilityChange(isHelpMenuOpen ?? false); - }, [isHelpMenuOpen, onHelpMenuVisibilityChange]); - - return ( - <> - - {isHelpMenuOpen && ( - onHelpMenuVisibilityChange(false)} - aria-labelledby="esqlInlineDocumentationFlyout" - type="push" - size={DEFAULT_WIDTH} - > - - - )} - - ); -} - -export const LanguageDocumentationFlyout = React.memo(DocumentationFlyout); diff --git a/packages/kbn-language-documentation-popover/src/components/documentation_flyout_content.tsx b/packages/kbn-language-documentation-popover/src/components/documentation_flyout_content.tsx deleted file mode 100644 index 20766efd5eae4f..00000000000000 --- a/packages/kbn-language-documentation-popover/src/components/documentation_flyout_content.tsx +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ -import React, { useRef, useState, useMemo, useCallback } from 'react'; -import { i18n } from '@kbn/i18n'; -import { css } from '@emotion/react'; -import { - EuiFlexGroup, - EuiFlexItem, - EuiText, - EuiFieldSearch, - EuiLink, - EuiFlyoutHeader, - EuiFlyoutBody, - useEuiTheme, - EuiComboBox, -} from '@elastic/eui'; -import { elementToString } from '../utils/element_to_string'; -import { LanguageDocumentationSections } from '../types'; - -interface DocumentationFlyoutProps { - sections?: LanguageDocumentationSections; - // if sets to true, allows searching in the markdown description - searchInDescription?: boolean; - // if set, a link will appear on the top right corner - linkToDocumentation?: string; -} - -function DocumentationFlyoutContent({ - sections, - searchInDescription, - linkToDocumentation, -}: DocumentationFlyoutProps) { - const { euiTheme } = useEuiTheme(); - const [selectedSection, setSelectedSection] = useState(); - const [searchText, setSearchText] = useState(''); - - const scrollTargets = useRef>({}); - - const normalizedSearchText = useMemo(() => searchText.trim().toLocaleLowerCase(), [searchText]); - - const filteredGroups = useMemo(() => { - return sections?.groups - .slice(1) - .map((group) => { - const items = group.items.filter((helpItem) => { - return ( - !normalizedSearchText || - helpItem.label.toLocaleLowerCase().includes(normalizedSearchText) || - // Converting the JSX element to a string first - (searchInDescription && - elementToString(helpItem.description) - ?.toLocaleLowerCase() - .includes(normalizedSearchText)) - ); - }); - return { ...group, options: items }; - }) - .filter((group) => { - if (group.options.length > 0 || !normalizedSearchText) { - return true; - } - return group.label.toLocaleLowerCase().includes(normalizedSearchText); - }); - }, [sections, normalizedSearchText, searchInDescription]); - - const onNavigationChange = useCallback((selectedOptions) => { - setSelectedSection(selectedOptions.length ? selectedOptions[0].label : undefined); - if (selectedOptions.length) { - const scrollToElement = scrollTargets.current[selectedOptions[0].label]; - scrollToElement.scrollIntoView(); - } - }, []); - - return ( - <> - - {linkToDocumentation && ( - - - {i18n.translate('languageDocumentationPopover.esqlDocsLabel', { - defaultMessage: 'View full ES|QL documentation', - })} - - - )} - - - { - setSearchText(e.target.value); - }} - data-test-subj="language-documentation-navigation-search" - placeholder={i18n.translate('languageDocumentationPopover.searchPlaceholder', { - defaultMessage: 'Search', - })} - fullWidth - compressed - /> - - - - - - - - - - {!searchText && ( -
{ - if (el && sections?.groups?.length) { - scrollTargets.current[sections.groups[0].label] = el; - } - }} - > - {sections?.initialSection} -
- )} - {filteredGroups?.map((helpGroup, index) => { - return ( -
{ - if (el) { - scrollTargets.current[helpGroup.label] = el; - } - }} - > -

{helpGroup.label}

- -

{helpGroup.description}

- - {filteredGroups?.[index].options.map((helpItem) => { - return ( -
{ - if (el) { - scrollTargets.current[helpItem.label] = el; - } - }} - > - {helpItem.description} -
- ); - })} -
- ); - })} -
-
-
- - ); -} - -export const LanguageDocumentationFlyoutContent = React.memo(DocumentationFlyoutContent); diff --git a/packages/kbn-language-documentation-popover/src/components/shared/documentation_content.tsx b/packages/kbn-language-documentation-popover/src/components/shared/documentation_content.tsx new file mode 100644 index 00000000000000..7b4b0882e8f0ec --- /dev/null +++ b/packages/kbn-language-documentation-popover/src/components/shared/documentation_content.tsx @@ -0,0 +1,81 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import React from 'react'; +import { EuiFlexGroup, EuiText } from '@elastic/eui'; +import type { LanguageDocumentationSections } from '../../types'; + +interface DocumentationContentProps { + searchText: string; + scrollTargets: React.MutableRefObject<{ [key: string]: HTMLElement }>; + filteredGroups?: Array<{ + label: string; + description?: string; + options: Array<{ label: string; description?: JSX.Element | undefined }>; + }>; + sections?: LanguageDocumentationSections; +} + +function DocumentationContent({ + searchText, + scrollTargets, + filteredGroups, + sections, +}: DocumentationContentProps) { + return ( + <> + + + {!searchText && ( +
{ + if (el && sections?.groups?.length) { + scrollTargets.current[sections.groups[0].label] = el; + } + }} + > + {sections?.initialSection} +
+ )} + {filteredGroups?.map((helpGroup, index) => { + return ( +
{ + if (el) { + scrollTargets.current[helpGroup.label] = el; + } + }} + > +

{helpGroup.label}

+ +

{helpGroup.description}

+ + {filteredGroups?.[index].options.map((helpItem) => { + return ( +
{ + if (el) { + scrollTargets.current[helpItem.label] = el; + } + }} + > + {helpItem.description} +
+ ); + })} +
+ ); + })} +
+
+ + ); +} + +export const DocumentationMainContent = React.memo(DocumentationContent); diff --git a/packages/kbn-language-documentation-popover/src/components/shared/documentation_navigation.tsx b/packages/kbn-language-documentation-popover/src/components/shared/documentation_navigation.tsx new file mode 100644 index 00000000000000..61bc7092740fb7 --- /dev/null +++ b/packages/kbn-language-documentation-popover/src/components/shared/documentation_navigation.tsx @@ -0,0 +1,97 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import React from 'react'; +import { css } from '@emotion/react'; +import { + EuiFlexItem, + EuiFlexGroup, + EuiLink, + useEuiTheme, + EuiFieldSearch, + EuiComboBox, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; + +interface DocumentationNavProps { + searchText: string; + setSearchText: (text: string) => void; + onNavigationChange: (selectedOptions: Array<{ label: string }>) => void; + filteredGroups?: Array<{ label: string }>; + linkToDocumentation?: string; + selectedSection?: string; +} + +function DocumentationNav({ + searchText, + setSearchText, + onNavigationChange, + filteredGroups, + linkToDocumentation, + selectedSection, +}: DocumentationNavProps) { + const { euiTheme } = useEuiTheme(); + + return ( + <> + {linkToDocumentation && ( + + + {i18n.translate('languageDocumentationPopover.esqlDocsLabel', { + defaultMessage: 'View full ES|QL documentation', + })} + + + )} + + + { + setSearchText(e.target.value); + }} + data-test-subj="language-documentation-navigation-search" + placeholder={i18n.translate('languageDocumentationPopover.searchPlaceholder', { + defaultMessage: 'Search', + })} + fullWidth + compressed + /> + + + + + + + ); +} + +export const DocumentationNavigation = React.memo(DocumentationNav); diff --git a/packages/kbn-language-documentation-popover/src/components/shared/index.ts b/packages/kbn-language-documentation-popover/src/components/shared/index.ts new file mode 100644 index 00000000000000..51140392d19dc2 --- /dev/null +++ b/packages/kbn-language-documentation-popover/src/components/shared/index.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { DocumentationNavigation } from './documentation_navigation'; +export { DocumentationMainContent } from './documentation_content'; diff --git a/packages/kbn-language-documentation-popover/src/utils/get_filtered_groups.ts b/packages/kbn-language-documentation-popover/src/utils/get_filtered_groups.ts new file mode 100644 index 00000000000000..0bbf08a68493b3 --- /dev/null +++ b/packages/kbn-language-documentation-popover/src/utils/get_filtered_groups.ts @@ -0,0 +1,39 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import type { LanguageDocumentationSections } from '../types'; +import { elementToString } from './element_to_string'; + +export const getFilteredGroups = ( + searchText: string, + searchInDescription?: boolean, + sections?: LanguageDocumentationSections +) => { + const normalizedSearchText = searchText.trim().toLocaleLowerCase(); + return sections?.groups + .slice(1) + .map((group) => { + const options = group.items.filter((helpItem) => { + return ( + !normalizedSearchText || + helpItem.label.toLocaleLowerCase().includes(normalizedSearchText) || + // Converting the JSX element to a string first + (searchInDescription && + elementToString(helpItem.description) + ?.toLocaleLowerCase() + .includes(normalizedSearchText)) + ); + }); + return { ...group, options }; + }) + .filter((group) => { + if (group.options.length > 0 || !normalizedSearchText) { + return true; + } + return group.label.toLocaleLowerCase().includes(normalizedSearchText); + }); +}; diff --git a/packages/kbn-text-based-editor/src/editor_footer/index.tsx b/packages/kbn-text-based-editor/src/editor_footer/index.tsx index 7d12ac3ea983e2..d69c77658be0f8 100644 --- a/packages/kbn-text-based-editor/src/editor_footer/index.tsx +++ b/packages/kbn-text-based-editor/src/editor_footer/index.tsx @@ -9,11 +9,12 @@ import React, { memo, useState, useCallback, useEffect, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { EuiText, EuiFlexGroup, EuiFlexItem, EuiCode } from '@elastic/eui'; +import { EuiText, EuiFlexGroup, EuiFlexItem, EuiCode, EuiButtonIcon } from '@elastic/eui'; import { Interpolation, Theme, css } from '@emotion/react'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { LanguageDocumentationFlyout, + LanguageDocumentationInline, type LanguageDocumentationSections, } from '@kbn/language-documentation-popover'; import { getLimitFromESQLQuery } from '@kbn/esql-utils'; @@ -42,8 +43,6 @@ interface EditorFooterProps { updateQuery: (qs: string) => void; isHistoryOpen: boolean; setIsHistoryOpen: (status: boolean) => void; - isHelpMenuOpen: boolean; - setIsHelpMenuOpen: (status: boolean) => void; measuredContainerWidth: number; hideRunQueryText?: boolean; editorIsInline?: boolean; @@ -74,13 +73,12 @@ export const EditorFooter = memo(function EditorFooter({ isInCompactMode, measuredContainerWidth, code, - isHelpMenuOpen, - setIsHelpMenuOpen, }: EditorFooterProps) { const kibana = useKibana(); const { docLinks } = kibana.services; const [isErrorPopoverOpen, setIsErrorPopoverOpen] = useState(false); + const [isLanguageComponentOpen, setIsLanguageComponentOpen] = useState(false); const [isWarningPopoverOpen, setIsWarningPopoverOpen] = useState(false); const [documentationSections, setDocumentationSections] = useState(); @@ -99,6 +97,16 @@ export const EditorFooter = memo(function EditorFooter({ [runQuery, updateQuery] ); + const toggleHistoryComponent = useCallback(() => { + setIsHistoryOpen(!isHistoryOpen); + setIsLanguageComponentOpen(false); + }, [isHistoryOpen, setIsHistoryOpen]); + + const toggleLanguageComponent = useCallback(() => { + setIsLanguageComponentOpen(!isLanguageComponentOpen); + setIsHistoryOpen(false); + }, [isLanguageComponentOpen, setIsHistoryOpen]); + const limit = useMemo(() => getLimitFromESQLQuery(code), [code]); useEffect(() => { @@ -304,8 +312,8 @@ export const EditorFooter = memo(function EditorFooter({ } ), }} - isHelpMenuOpen={isHelpMenuOpen} - onHelpMenuVisibilityChange={setIsHelpMenuOpen} + isHelpMenuOpen={isLanguageComponentOpen} + onHelpMenuVisibilityChange={setIsLanguageComponentOpen} />
)} @@ -318,31 +326,14 @@ export const EditorFooter = memo(function EditorFooter({ {!hideQueryHistory && ( setIsHistoryOpen(!isHistoryOpen)} + toggleHistory={toggleHistoryComponent} isHistoryOpen={isHistoryOpen} isSpaceReduced={true} /> )} {documentationSections && ( - + )} @@ -362,6 +353,15 @@ export const EditorFooter = memo(function EditorFooter({ /> )} + {isLanguageComponentOpen && editorIsInline && ( + + + + )} ); }); diff --git a/packages/kbn-text-based-editor/src/helpers.ts b/packages/kbn-text-based-editor/src/helpers.ts index 9e3bea6ee0abf7..e3471082c51b44 100644 --- a/packages/kbn-text-based-editor/src/helpers.ts +++ b/packages/kbn-text-based-editor/src/helpers.ts @@ -195,14 +195,6 @@ export const getDocumentationSections = async (language: string) => { } }; -export const getWrappedInPipesCode = (code: string, isWrapped: boolean): string => { - const pipes = code?.split('|'); - const codeNoLines = pipes?.map((pipe) => { - return pipe.replaceAll('\n', '').trim(); - }); - return codeNoLines.join(isWrapped ? ' | ' : '\n| '); -}; - export const getIndicesList = async (dataViews: DataViewsPublicPluginStart) => { const indices = await dataViews.getIndices({ showAllIndices: false, diff --git a/packages/kbn-text-based-editor/src/text_based_languages_editor.tsx b/packages/kbn-text-based-editor/src/text_based_languages_editor.tsx index 4fd0f994520d6c..fdc67c8f6ac4ef 100644 --- a/packages/kbn-text-based-editor/src/text_based_languages_editor.tsx +++ b/packages/kbn-text-based-editor/src/text_based_languages_editor.tsx @@ -100,7 +100,6 @@ export const TextBasedLanguagesEditor = memo(function TextBasedLanguagesEditor({ const [isHistoryOpen, setIsHistoryOpen] = useState(false); const [isCodeEditorExpandedFocused, setIsCodeEditorExpandedFocused] = useState(false); - const [isLanguagePopoverOpen, setIsLanguagePopoverOpen] = useState(false); const [isQueryLoading, setIsQueryLoading] = useState(true); const [abortController, setAbortController] = useState(new AbortController()); // contains both client side validation and server messages @@ -721,8 +720,6 @@ export const TextBasedLanguagesEditor = memo(function TextBasedLanguagesEditor({ measuredContainerWidth={measuredEditorWidth} hideQueryHistory={hideHistoryComponent} refetchHistoryItems={refetchHistoryItems} - isHelpMenuOpen={isLanguagePopoverOpen} - setIsHelpMenuOpen={setIsLanguagePopoverOpen} /> Date: Mon, 9 Sep 2024 12:09:39 +0200 Subject: [PATCH 07/31] Add flyout to the help menu --- .../src/components/as_flyout/index.tsx | 20 +--- packages/kbn-text-based-editor/index.ts | 1 + .../src/editor_footer/index.tsx | 24 ++--- .../query_string_input/esql_menu_popover.tsx | 94 ++++++++++++++----- 4 files changed, 83 insertions(+), 56 deletions(-) diff --git a/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx b/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx index a2562ffb631cc4..d92cdabbc6da91 100644 --- a/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx +++ b/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx @@ -7,14 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ import React, { useCallback, useEffect, useState, useRef, useMemo } from 'react'; -import { - EuiFlyout, - EuiButtonIcon, - EuiButtonIconProps, - useEuiTheme, - EuiFlyoutBody, - EuiFlyoutHeader, -} from '@elastic/eui'; +import { EuiFlyout, useEuiTheme, EuiFlyoutBody, EuiFlyoutHeader } from '@elastic/eui'; import { getFilteredGroups } from '../../utils/get_filtered_groups'; import { DocumentationMainContent, DocumentationNavigation } from '../shared'; import type { LanguageDocumentationSections } from '../../types'; @@ -23,14 +16,12 @@ interface DocumentationFlyoutProps { isHelpMenuOpen: boolean; onHelpMenuVisibilityChange: (status: boolean) => void; sections?: LanguageDocumentationSections; - buttonProps?: Omit; searchInDescription?: boolean; linkToDocumentation?: string; } function DocumentationFlyout({ sections, - buttonProps, searchInDescription, linkToDocumentation, isHelpMenuOpen, @@ -56,21 +47,12 @@ function DocumentationFlyout({ } }, []); - const toggleDocumentationFlyout = useCallback(() => { - onHelpMenuVisibilityChange?.(!isHelpMenuOpen); - }, [isHelpMenuOpen, onHelpMenuVisibilityChange]); - useEffect(() => { onHelpMenuVisibilityChange(isHelpMenuOpen ?? false); }, [isHelpMenuOpen, onHelpMenuVisibilityChange]); return ( <> - {isHelpMenuOpen && ( + setIsLanguageComponentOpen(!isLanguageComponentOpen)} + color="text" + size="xs" + data-test-subj="TextBasedLangEditor-documentation" + aria-label={i18n.translate( + 'textBasedEditor.query.textBasedLanguagesEditor.documentationLabel', + { + defaultMessage: 'Documentation', + } + )} + /> diff --git a/src/plugins/unified_search/public/query_string_input/esql_menu_popover.tsx b/src/plugins/unified_search/public/query_string_input/esql_menu_popover.tsx index 003827344c307b..a7ae34e99629b8 100644 --- a/src/plugins/unified_search/public/query_string_input/esql_menu_popover.tsx +++ b/src/plugins/unified_search/public/query_string_input/esql_menu_popover.tsx @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import React, { useMemo, useState } from 'react'; +import React, { useMemo, useState, useEffect } from 'react'; import { EuiPopover, EuiButton, @@ -18,7 +18,12 @@ import { } from '@elastic/eui'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { i18n } from '@kbn/i18n'; +import { getDocumentationSections } from '@kbn/text-based-editor'; import { FEEDBACK_LINK } from '@kbn/esql-utils'; +import { + LanguageDocumentationFlyout, + type LanguageDocumentationSections, +} from '@kbn/language-documentation-popover'; import type { IUnifiedSearchPluginServices } from '../types'; export const ESQLMenuPopover = () => { @@ -26,9 +31,33 @@ export const ESQLMenuPopover = () => { const { docLinks } = kibana.services; const [isESQLMenuPopoverOpen, setIsESQLMenuPopoverOpen] = useState(false); + const [isLanguageComponentOpen, setIsLanguageComponentOpen] = useState(false); + const [documentationSections, setDocumentationSections] = + useState(); + + useEffect(() => { + async function getDocumentation() { + const sections = await getDocumentationSections('esql'); + setDocumentationSections(sections); + } + if (!documentationSections) { + getDocumentation(); + } + }, [documentationSections]); + const esqlPanelItems = useMemo(() => { const panelItems: EuiContextMenuPanelProps['items'] = []; panelItems.push( + setIsLanguageComponentOpen(!isLanguageComponentOpen)} + > + {i18n.translate('unifiedSearch.query.queryBar.esqlMenu.quickReference', { + defaultMessage: 'Quick Reference', + })} + , { ); return panelItems; - }, [docLinks.links.query.queryESQL, docLinks.links.query.queryESQLExamples]); + }, [ + docLinks.links.query.queryESQL, + docLinks.links.query.queryESQLExamples, + isLanguageComponentOpen, + ]); return ( - setIsESQLMenuPopoverOpen(!isESQLMenuPopoverOpen)} - data-test-subj="esql-menu-button" - size="s" - > - {i18n.translate('unifiedSearch.query.queryBar.esqlMenu.label', { - defaultMessage: 'ES|QL help', - })} - - } - panelProps={{ - ['data-test-subj']: 'esql-menu-popover', - css: { width: 240 }, - }} - isOpen={isESQLMenuPopoverOpen} - closePopover={() => setIsESQLMenuPopoverOpen(false)} - panelPaddingSize="s" - display="block" - > - - + <> + setIsESQLMenuPopoverOpen(!isESQLMenuPopoverOpen)} + data-test-subj="esql-menu-button" + size="s" + > + {i18n.translate('unifiedSearch.query.queryBar.esqlMenu.label', { + defaultMessage: 'ES|QL help', + })} + + } + panelProps={{ + ['data-test-subj']: 'esql-menu-popover', + css: { width: 240 }, + }} + isOpen={isESQLMenuPopoverOpen} + closePopover={() => setIsESQLMenuPopoverOpen(false)} + panelPaddingSize="s" + display="block" + > + + + + ); }; From 612d5f405f1ee1be45c1936edce473a581c33c54 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Mon, 9 Sep 2024 12:16:39 +0200 Subject: [PATCH 08/31] Fix wrong function removal --- packages/kbn-text-based-editor/src/helpers.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/kbn-text-based-editor/src/helpers.ts b/packages/kbn-text-based-editor/src/helpers.ts index 5e7e9fb0914004..f972649d967a76 100644 --- a/packages/kbn-text-based-editor/src/helpers.ts +++ b/packages/kbn-text-based-editor/src/helpers.ts @@ -196,6 +196,14 @@ export const getDocumentationSections = async (language: string) => { } }; +export const getWrappedInPipesCode = (code: string, isWrapped: boolean): string => { + const pipes = code?.split('|'); + const codeNoLines = pipes?.map((pipe) => { + return pipe.replaceAll('\n', '').trim(); + }); + return codeNoLines.join(isWrapped ? ' | ' : '\n| '); +}; + export const getIndicesList = async (dataViews: DataViewsPublicPluginStart) => { const indices = await dataViews.getIndices({ showAllIndices: false, From 12524d54bf0cf4c77cc96a31cce6be8f46daade5 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Mon, 9 Sep 2024 14:43:53 +0200 Subject: [PATCH 09/31] Adds unit tests --- .../setup_tests.ts | 11 +++ .../src/components/as_flyout/index.test.tsx | 94 +++++++++++++++++++ .../src/components/as_flyout/index.tsx | 2 +- .../src/components/as_inline/index.test.tsx | 88 +++++++++++++++++ .../src/components/as_inline/index.tsx | 9 +- .../shared/documentation_navigation.tsx | 8 +- .../src/utils/get_filtered_groups.test.tsx | 85 +++++++++++++++++ .../src/utils/get_filtered_groups.ts | 5 +- .../src/editor_footer/index.tsx | 6 +- .../esql_menu_popover.test.tsx | 2 +- 10 files changed, 293 insertions(+), 17 deletions(-) create mode 100644 packages/kbn-language-documentation-popover/setup_tests.ts create mode 100644 packages/kbn-language-documentation-popover/src/components/as_flyout/index.test.tsx create mode 100644 packages/kbn-language-documentation-popover/src/components/as_inline/index.test.tsx create mode 100644 packages/kbn-language-documentation-popover/src/utils/get_filtered_groups.test.tsx diff --git a/packages/kbn-language-documentation-popover/setup_tests.ts b/packages/kbn-language-documentation-popover/setup_tests.ts new file mode 100644 index 00000000000000..5ebc6d3dac1ca4 --- /dev/null +++ b/packages/kbn-language-documentation-popover/setup_tests.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +// eslint-disable-next-line import/no-extraneous-dependencies +import '@testing-library/jest-dom'; diff --git a/packages/kbn-language-documentation-popover/src/components/as_flyout/index.test.tsx b/packages/kbn-language-documentation-popover/src/components/as_flyout/index.test.tsx new file mode 100644 index 00000000000000..d28ffe8fa7a175 --- /dev/null +++ b/packages/kbn-language-documentation-popover/src/components/as_flyout/index.test.tsx @@ -0,0 +1,94 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import React from 'react'; +import { screen, render, fireEvent } from '@testing-library/react'; +import { Markdown } from '@kbn/shared-ux-markdown'; +import { LanguageDocumentationFlyout } from '.'; + +describe('###Documentation flyout component', () => { + const sections = { + groups: [ + { + label: 'Section one', + description: 'Section 1 description', + items: [], + }, + { + label: 'Section two', + items: [ + { + label: 'Section two item 1', + description: ( + + ), + }, + { + label: 'Section two item 2', + description: ( + + ), + }, + ], + }, + { + label: 'Section three', + items: [ + { + label: 'Section three item 1', + description: ( + + ), + }, + { + label: 'Section three item 2', + description: ( + + ), + }, + ], + }, + ], + initialSection: Here is the initial section, + }; + const renderFlyout = (linkToDocumentation?: string) => { + return render( + + ); + }; + it('has a header element for navigation through the sections', () => { + renderFlyout(); + expect(screen.getByTestId('language-documentation-navigation-search')).toBeInTheDocument(); + expect(screen.getByTestId('language-documentation-navigation-dropdown')).toBeInTheDocument(); + expect(screen.queryByTestId('language-documentation-navigation-link')).not.toBeInTheDocument(); + }); + + it('has a link if linkToDocumentation prop is given', () => { + renderFlyout('meow'); + expect(screen.getByTestId('language-documentation-navigation-link')).toBeInTheDocument(); + }); + + it('contains the two last sections', () => { + renderFlyout(); + expect(screen.getByText('Section two')).toBeInTheDocument(); + expect(screen.getByText('Section three')).toBeInTheDocument(); + }); + + it('contains the correct section if user updates the search input', () => { + renderFlyout(); + const input = screen.getByTestId('language-documentation-navigation-search'); + fireEvent.change(input, { target: { value: 'two' } }); + expect(screen.getByText('Section two')).toBeInTheDocument(); + }); +}); diff --git a/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx b/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx index d92cdabbc6da91..c25a205356d906 100644 --- a/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx +++ b/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx @@ -36,7 +36,7 @@ function DocumentationFlyout({ const scrollTargets = useRef>({}); const filteredGroups = useMemo(() => { - return getFilteredGroups(searchText, searchInDescription, sections); + return getFilteredGroups(searchText, searchInDescription, sections, 1); }, [sections, searchText, searchInDescription]); const onNavigationChange = useCallback((selectedOptions) => { diff --git a/packages/kbn-language-documentation-popover/src/components/as_inline/index.test.tsx b/packages/kbn-language-documentation-popover/src/components/as_inline/index.test.tsx new file mode 100644 index 00000000000000..acd16391eb15c5 --- /dev/null +++ b/packages/kbn-language-documentation-popover/src/components/as_inline/index.test.tsx @@ -0,0 +1,88 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import React from 'react'; +import { screen, render, fireEvent } from '@testing-library/react'; +import { Markdown } from '@kbn/shared-ux-markdown'; +import { LanguageDocumentationInline } from '.'; + +describe('###Documentation flyout component', () => { + const sections = { + groups: [ + { + label: 'Section one', + description: 'Section 1 description', + items: [], + }, + { + label: 'Section two', + items: [ + { + label: 'Section two item 1', + description: ( + + ), + }, + { + label: 'Section two item 2', + description: ( + + ), + }, + ], + }, + { + label: 'Section three', + items: [ + { + label: 'Section three item 1', + description: , + }, + { + label: 'Section three item 2', + description: ( + + ), + }, + ], + }, + ], + initialSection: Here is the initial section, + }; + const renderInlineComponent = (searchInDescription = false) => { + return render( + + ); + }; + it('has a header element for navigation through the sections', () => { + renderInlineComponent(); + expect(screen.getByTestId('language-documentation-navigation-search')).toBeInTheDocument(); + expect(screen.getByTestId('language-documentation-navigation-dropdown')).toBeInTheDocument(); + }); + + it('contains the two last sections', () => { + renderInlineComponent(); + expect(screen.getByText('Section two')).toBeInTheDocument(); + expect(screen.getByText('Section three')).toBeInTheDocument(); + }); + + it('contains the correct section if user updates the search input', () => { + renderInlineComponent(); + const input = screen.getByTestId('language-documentation-navigation-search'); + fireEvent.change(input, { target: { value: 'two' } }); + expect(screen.getByText('Section two')).toBeInTheDocument(); + }); + + it('contains the correct section if user updates the search input with a text that exist in the description', () => { + renderInlineComponent(true); + const input = screen.getByTestId('language-documentation-navigation-search'); + fireEvent.change(input, { target: { value: 'blah' } }); + expect(screen.getByText('Section three')).toBeInTheDocument(); + }); +}); diff --git a/packages/kbn-language-documentation-popover/src/components/as_inline/index.tsx b/packages/kbn-language-documentation-popover/src/components/as_inline/index.tsx index 5a362bf803042e..2781864922a2cd 100644 --- a/packages/kbn-language-documentation-popover/src/components/as_inline/index.tsx +++ b/packages/kbn-language-documentation-popover/src/components/as_inline/index.tsx @@ -16,16 +16,11 @@ import type { LanguageDocumentationSections } from '../../types'; interface DocumentationInlineProps { sections?: LanguageDocumentationSections; searchInDescription?: boolean; - linkToDocumentation?: string; } const MAX_HEIGHT = 250; -function DocumentationInline({ - sections, - searchInDescription, - linkToDocumentation, -}: DocumentationInlineProps) { +function DocumentationInline({ sections, searchInDescription }: DocumentationInlineProps) { const theme = useEuiTheme(); const scrollBarStyles = euiScrollBarStyles(theme); const [selectedSection, setSelectedSection] = useState(); @@ -34,7 +29,7 @@ function DocumentationInline({ const scrollTargets = useRef>({}); const filteredGroups = useMemo(() => { - return getFilteredGroups(searchText, searchInDescription, sections); + return getFilteredGroups(searchText, searchInDescription, sections, 1); }, [sections, searchText, searchInDescription]); const onNavigationChange = useCallback((selectedOptions) => { diff --git a/packages/kbn-language-documentation-popover/src/components/shared/documentation_navigation.tsx b/packages/kbn-language-documentation-popover/src/components/shared/documentation_navigation.tsx index 1af72b6f91f6ef..02be36fb191cf4 100644 --- a/packages/kbn-language-documentation-popover/src/components/shared/documentation_navigation.tsx +++ b/packages/kbn-language-documentation-popover/src/components/shared/documentation_navigation.tsx @@ -47,7 +47,12 @@ function DocumentationNav({ padding-top: ${euiTheme.size.xs}; `} > - + {i18n.translate('languageDocumentationPopover.esqlDocsLabel', { defaultMessage: 'View full ES|QL documentation', })} @@ -82,6 +87,7 @@ function DocumentationNav({ placeholder={i18n.translate('languageDocumentationPopover.navigationPlaceholder', { defaultMessage: 'Commands and functions', })} + data-test-subj="language-documentation-navigation-dropdown" options={filteredGroups} selectedOptions={selectedSection ? [{ label: selectedSection }] : []} singleSelection={{ asPlainText: true }} diff --git a/packages/kbn-language-documentation-popover/src/utils/get_filtered_groups.test.tsx b/packages/kbn-language-documentation-popover/src/utils/get_filtered_groups.test.tsx new file mode 100644 index 00000000000000..9dfe443f10b0b3 --- /dev/null +++ b/packages/kbn-language-documentation-popover/src/utils/get_filtered_groups.test.tsx @@ -0,0 +1,85 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ +import React from 'react'; +import { Markdown } from '@kbn/shared-ux-markdown'; +import { getFilteredGroups } from './get_filtered_groups'; + +describe('getFilteredGroups', () => { + const sections = { + groups: [ + { + label: 'Section one', + description: 'Section 1 description', + items: [], + }, + { + label: 'Section two', + items: [ + { + label: 'Section two item 1 blah blah', + description: ( + + ), + }, + { + label: 'Section two item 2', + description: ( + + ), + }, + ], + }, + { + label: 'Section three ', + items: [ + { + label: 'Section three item 1', + description: ( + + ), + }, + { + label: 'Section three item 2', + description: ( + + ), + }, + ], + }, + ], + initialSection: Here is the initial section, + }; + test('Should return the sections as it gets them if the search string is empty', () => { + const filteredSections = getFilteredGroups('', false, sections); + expect(filteredSections).toStrictEqual([ + ...sections.groups.map((group) => ({ ...group, options: group.items })), + ]); + }); + + test('Should return the 2 last sections as it gets them if the search string is empty and the numOfGroupsToOmit is set to 1', () => { + const filteredSections = getFilteredGroups('', false, sections, 1); + expect(filteredSections).toStrictEqual([ + ...sections.groups.slice(1).map((group) => ({ ...group, options: group.items })), + ]); + }); + + test('Should return the section two as it gets it if the search string is asking for this', () => { + const filteredSections = getFilteredGroups('tWo', false, sections); + expect(filteredSections).toStrictEqual([ + { ...sections.groups[1], options: sections.groups[1].items }, + ]); + }); + + test('Should return the section two filtered on the search string if it is allowed to search in description', () => { + const filteredSections = getFilteredGroups('Section two item 1 blah blah', true, sections); + expect(filteredSections).toStrictEqual([ + { ...sections.groups[1], options: [sections.groups[1].items[0]] }, + ]); + }); +}); diff --git a/packages/kbn-language-documentation-popover/src/utils/get_filtered_groups.ts b/packages/kbn-language-documentation-popover/src/utils/get_filtered_groups.ts index b6d7235bf2eed1..2ac252bdad775f 100644 --- a/packages/kbn-language-documentation-popover/src/utils/get_filtered_groups.ts +++ b/packages/kbn-language-documentation-popover/src/utils/get_filtered_groups.ts @@ -12,11 +12,12 @@ import { elementToString } from './element_to_string'; export const getFilteredGroups = ( searchText: string, searchInDescription?: boolean, - sections?: LanguageDocumentationSections + sections?: LanguageDocumentationSections, + numOfGroupsToOmit?: number ) => { const normalizedSearchText = searchText.trim().toLocaleLowerCase(); return sections?.groups - .slice(1) + .slice(numOfGroupsToOmit ?? 0) .map((group) => { const options = group.items.filter((helpItem) => { return ( diff --git a/packages/kbn-text-based-editor/src/editor_footer/index.tsx b/packages/kbn-text-based-editor/src/editor_footer/index.tsx index bf9db4ffa4c172..23e7482979c955 100644 --- a/packages/kbn-text-based-editor/src/editor_footer/index.tsx +++ b/packages/kbn-text-based-editor/src/editor_footer/index.tsx @@ -358,11 +358,7 @@ export const EditorFooter = memo(function EditorFooter({ )} {isLanguageComponentOpen && editorIsInline && ( - + )} diff --git a/src/plugins/unified_search/public/query_string_input/esql_menu_popover.test.tsx b/src/plugins/unified_search/public/query_string_input/esql_menu_popover.test.tsx index c788d3c4e7d785..e9ade6cdbabd35 100644 --- a/src/plugins/unified_search/public/query_string_input/esql_menu_popover.test.tsx +++ b/src/plugins/unified_search/public/query_string_input/esql_menu_popover.test.tsx @@ -36,7 +36,7 @@ describe('ESQLMenuPopover', () => { renderESQLPopover(); expect(screen.getByTestId('esql-menu-button')).toBeInTheDocument(); userEvent.click(screen.getByRole('button')); - + expect(screen.getByTestId('esql-quick-reference')).toBeInTheDocument(); expect(screen.getByTestId('esql-examples')).toBeInTheDocument(); expect(screen.getByTestId('esql-about')).toBeInTheDocument(); expect(screen.getByTestId('esql-feedback')).toBeInTheDocument(); From 31c560f995c8bcc2a724b83e339823ee7afef5b2 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Mon, 9 Sep 2024 12:55:31 +0000 Subject: [PATCH 10/31] [CI] Auto-commit changed files from 'node scripts/notice' --- src/plugins/unified_search/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/unified_search/tsconfig.json b/src/plugins/unified_search/tsconfig.json index 909c0031b5a318..e836f3c6daa67a 100644 --- a/src/plugins/unified_search/tsconfig.json +++ b/src/plugins/unified_search/tsconfig.json @@ -46,7 +46,8 @@ "@kbn/data-view-utils", "@kbn/esql-utils", "@kbn/react-kibana-mount", - "@kbn/field-utils" + "@kbn/field-utils", + "@kbn/language-documentation-popover" ], "exclude": [ "target/**/*", From aeb74f44d0d505e4db639de1b207a1e1795bef49 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Tue, 10 Sep 2024 09:13:46 +0200 Subject: [PATCH 11/31] Cleanup --- .../kbn-text-based-editor/src/text_based_languages_editor.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/kbn-text-based-editor/src/text_based_languages_editor.tsx b/packages/kbn-text-based-editor/src/text_based_languages_editor.tsx index a0ba6215d7c78d..616ec727497e0f 100644 --- a/packages/kbn-text-based-editor/src/text_based_languages_editor.tsx +++ b/packages/kbn-text-based-editor/src/text_based_languages_editor.tsx @@ -731,8 +731,6 @@ export const TextBasedLanguagesEditor = memo(function TextBasedLanguagesEditor({ setIsHistoryOpen={toggleHistory} measuredContainerWidth={measuredEditorWidth} hideQueryHistory={hideHistoryComponent} - isHelpMenuOpen={isLanguagePopoverOpen} - setIsHelpMenuOpen={setIsLanguagePopoverOpen} /> Date: Tue, 10 Sep 2024 10:57:47 +0200 Subject: [PATCH 12/31] Remove docs from editor when in not inline --- packages/kbn-text-based-editor/README.md | 1 - .../src/editor_footer/index.tsx | 58 ++++--------------- .../query_string_input/esql_menu_popover.tsx | 18 +++--- 3 files changed, 18 insertions(+), 59 deletions(-) diff --git a/packages/kbn-text-based-editor/README.md b/packages/kbn-text-based-editor/README.md index 2bb9ae5887f245..ae7846a58d2071 100644 --- a/packages/kbn-text-based-editor/README.md +++ b/packages/kbn-text-based-editor/README.md @@ -14,7 +14,6 @@ In order to enable text based languages on your unified search bar add `textBase ## Languages supported -- SQL: based on the Elasticsearch sql api - ESQL: based on the Elastisearch esql api diff --git a/packages/kbn-text-based-editor/src/editor_footer/index.tsx b/packages/kbn-text-based-editor/src/editor_footer/index.tsx index 4aa6b4e9213fa9..ae19d82dce423a 100644 --- a/packages/kbn-text-based-editor/src/editor_footer/index.tsx +++ b/packages/kbn-text-based-editor/src/editor_footer/index.tsx @@ -7,14 +7,12 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import React, { memo, useState, useCallback, useEffect, useMemo } from 'react'; +import React, { memo, useState, useCallback, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiText, EuiFlexGroup, EuiFlexItem, EuiCode, EuiButtonIcon } from '@elastic/eui'; import { Interpolation, Theme, css } from '@emotion/react'; -import { useKibana } from '@kbn/kibana-react-plugin/public'; import { - LanguageDocumentationFlyout, LanguageDocumentationInline, type LanguageDocumentationSections, } from '@kbn/language-documentation-popover'; @@ -24,7 +22,6 @@ import { ErrorsWarningsFooterPopover } from './errors_warnings_popover'; import { QueryHistoryAction, QueryHistory } from './query_history'; import { SubmitFeedbackComponent } from './feedback_component'; import { QueryWrapComponent } from './query_wrap_component'; -import type { TextBasedEditorDeps } from '../types'; const isMac = navigator.platform.toLowerCase().indexOf('mac') >= 0; const COMMAND_KEY = isMac ? '⌘' : '^'; @@ -73,9 +70,6 @@ export const EditorFooter = memo(function EditorFooter({ measuredContainerWidth, code, }: EditorFooterProps) { - const kibana = useKibana(); - const { docLinks } = kibana.services; - const [isErrorPopoverOpen, setIsErrorPopoverOpen] = useState(false); const [isLanguageComponentOpen, setIsLanguageComponentOpen] = useState(false); const [isWarningPopoverOpen, setIsWarningPopoverOpen] = useState(false); @@ -101,23 +95,17 @@ export const EditorFooter = memo(function EditorFooter({ setIsLanguageComponentOpen(false); }, [isHistoryOpen, setIsHistoryOpen]); - const toggleLanguageComponent = useCallback(() => { + const toggleLanguageComponent = useCallback(async () => { + if (!documentationSections) { + const sections = await getDocumentationSections('esql'); + setDocumentationSections(sections); + } setIsLanguageComponentOpen(!isLanguageComponentOpen); setIsHistoryOpen(false); - }, [isLanguageComponentOpen, setIsHistoryOpen]); + }, [documentationSections, isLanguageComponentOpen, setIsHistoryOpen]); const limit = useMemo(() => getLimitFromESQLQuery(code), [code]); - useEffect(() => { - async function getDocumentation() { - const sections = await getDocumentationSections('esql'); - setDocumentationSections(sections); - } - if (!documentationSections) { - getDocumentation(); - } - }, [documentationSections]); - return ( )} - {documentationSections && !editorIsInline && ( - - setIsLanguageComponentOpen(!isLanguageComponentOpen)} - color="text" - size="xs" - data-test-subj="TextBasedLangEditor-documentation" - aria-label={i18n.translate( - 'textBasedEditor.query.textBasedLanguagesEditor.documentationLabel', - { - defaultMessage: 'Documentation', - } - )} - /> - - - )} {Boolean(editorIsInline) && ( @@ -332,11 +296,9 @@ export const EditorFooter = memo(function EditorFooter({ isSpaceReduced={true} /> )} - {documentationSections && ( - - - - )} + + + diff --git a/src/plugins/unified_search/public/query_string_input/esql_menu_popover.tsx b/src/plugins/unified_search/public/query_string_input/esql_menu_popover.tsx index a7ae34e99629b8..4255a05744de11 100644 --- a/src/plugins/unified_search/public/query_string_input/esql_menu_popover.tsx +++ b/src/plugins/unified_search/public/query_string_input/esql_menu_popover.tsx @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import React, { useMemo, useState, useEffect } from 'react'; +import React, { useMemo, useState, useCallback } from 'react'; import { EuiPopover, EuiButton, @@ -18,7 +18,6 @@ import { } from '@elastic/eui'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { i18n } from '@kbn/i18n'; -import { getDocumentationSections } from '@kbn/text-based-editor'; import { FEEDBACK_LINK } from '@kbn/esql-utils'; import { LanguageDocumentationFlyout, @@ -35,15 +34,14 @@ export const ESQLMenuPopover = () => { const [documentationSections, setDocumentationSections] = useState(); - useEffect(() => { - async function getDocumentation() { + const toggleLanguageComponent = useCallback(async () => { + if (!documentationSections) { + const { getDocumentationSections } = await import('@kbn/text-based-editor'); const sections = await getDocumentationSections('esql'); setDocumentationSections(sections); } - if (!documentationSections) { - getDocumentation(); - } - }, [documentationSections]); + setIsLanguageComponentOpen(!isLanguageComponentOpen); + }, [documentationSections, isLanguageComponentOpen]); const esqlPanelItems = useMemo(() => { const panelItems: EuiContextMenuPanelProps['items'] = []; @@ -52,7 +50,7 @@ export const ESQLMenuPopover = () => { key="quickReference" icon="documentation" data-test-subj="esql-quick-reference" - onClick={() => setIsLanguageComponentOpen(!isLanguageComponentOpen)} + onClick={() => toggleLanguageComponent()} > {i18n.translate('unifiedSearch.query.queryBar.esqlMenu.quickReference', { defaultMessage: 'Quick Reference', @@ -97,7 +95,7 @@ export const ESQLMenuPopover = () => { }, [ docLinks.links.query.queryESQL, docLinks.links.query.queryESQLExamples, - isLanguageComponentOpen, + toggleLanguageComponent, ]); return ( From 317049f93a87054ab2c8bc44cdbf611e98db08fc Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Tue, 10 Sep 2024 11:00:04 +0200 Subject: [PATCH 13/31] Cloeanup --- .../src/text_based_languages_editor.test.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/kbn-text-based-editor/src/text_based_languages_editor.test.tsx b/packages/kbn-text-based-editor/src/text_based_languages_editor.test.tsx index d8fe9512691a14..9228edd47b0de0 100644 --- a/packages/kbn-text-based-editor/src/text_based_languages_editor.test.tsx +++ b/packages/kbn-text-based-editor/src/text_based_languages_editor.test.tsx @@ -133,9 +133,6 @@ describe('TextBasedLanguagesEditor', () => { expect( component!.find('[data-test-subj="TextBasedLangEditor-toggleWordWrap"]').length ).not.toBe(0); - expect(component!.find('[data-test-subj="TextBasedLangEditor-documentation"]').length).not.toBe( - 0 - ); }); it('should render the resize for the expanded code editor mode', async () => { From 6a605ea8d2b92cce719749df1e49b2a0c40defb2 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Tue, 10 Sep 2024 11:47:37 +0200 Subject: [PATCH 14/31] Move ESQL docs to the documentation package --- .../package.json | 7 +- .../src/components/as_flyout/index.test.tsx | 105 ++++++++-------- .../src/components/as_flyout/index.tsx | 26 ++-- .../src/components/as_inline/index.test.tsx | 115 ++++++++++-------- .../src/components/as_inline/index.tsx | 24 +++- .../src}/scripts/generate_esql_docs.ts | 2 +- .../sections}/esql_documentation_sections.tsx | 0 .../src/sections/index.ts | 44 +++++++ packages/kbn-text-based-editor/index.ts | 1 - packages/kbn-text-based-editor/package.json | 7 +- .../src/editor_footer/index.tsx | 17 +-- packages/kbn-text-based-editor/src/helpers.ts | 37 ------ .../src/text_based_languages_editor.test.tsx | 15 --- .../query_string_input/esql_menu_popover.tsx | 15 +-- .../translations/translations/fr-FR.json | 1 - .../translations/translations/ja-JP.json | 1 - .../translations/translations/zh-CN.json | 1 - 17 files changed, 210 insertions(+), 208 deletions(-) rename packages/{kbn-text-based-editor => kbn-language-documentation-popover/src}/scripts/generate_esql_docs.ts (98%) rename packages/{kbn-text-based-editor/src => kbn-language-documentation-popover/src/sections}/esql_documentation_sections.tsx (100%) create mode 100644 packages/kbn-language-documentation-popover/src/sections/index.ts diff --git a/packages/kbn-language-documentation-popover/package.json b/packages/kbn-language-documentation-popover/package.json index a756b25061b644..6ec4c7df4fafb7 100644 --- a/packages/kbn-language-documentation-popover/package.json +++ b/packages/kbn-language-documentation-popover/package.json @@ -5,5 +5,10 @@ "private": true, "sideEffects": [ "*.scss" - ] + ], + "scripts": { + "make:docs": "ts-node --transpileOnly scripts/generate_esql_docs.ts", + "postmake:docs": "yarn run lint:fix", + "lint:fix": "cd ../.. && node ./scripts/eslint --fix ./packages/kbn-text-based-editor/src/esql_documentation_sections.tsx" + } } \ No newline at end of file diff --git a/packages/kbn-language-documentation-popover/src/components/as_flyout/index.test.tsx b/packages/kbn-language-documentation-popover/src/components/as_flyout/index.test.tsx index d28ffe8fa7a175..5dd66386c41884 100644 --- a/packages/kbn-language-documentation-popover/src/components/as_flyout/index.test.tsx +++ b/packages/kbn-language-documentation-popover/src/components/as_flyout/index.test.tsx @@ -8,61 +8,58 @@ */ import React from 'react'; -import { screen, render, fireEvent } from '@testing-library/react'; -import { Markdown } from '@kbn/shared-ux-markdown'; +import { screen, render, fireEvent, waitFor } from '@testing-library/react'; import { LanguageDocumentationFlyout } from '.'; -describe('###Documentation flyout component', () => { - const sections = { - groups: [ - { - label: 'Section one', - description: 'Section 1 description', - items: [], - }, - { - label: 'Section two', - items: [ - { - label: 'Section two item 1', - description: ( - - ), - }, - { - label: 'Section two item 2', - description: ( - - ), - }, - ], - }, - { - label: 'Section three', - items: [ - { - label: 'Section three item 1', - description: ( - - ), - }, - { - label: 'Section three item 2', - description: ( - - ), - }, - ], - }, - ], - initialSection: Here is the initial section, +jest.mock('../../sections', () => { + const module = jest.requireActual('../../sections'); + return { + ...module, + getESQLDocsSections: () => ({ + groups: [ + { + label: 'Section one', + description: 'Section 1 description', + items: [], + }, + { + label: 'Section two', + items: [ + { + label: 'Section two item 1', + description: 'Section two item 1 description', + }, + { + label: 'Section two item 2', + description: 'Section two item 2 description', + }, + ], + }, + { + label: 'Section three', + items: [ + { + label: 'Section three item 1', + description: 'Section three item 1 description', + }, + { + label: 'Section three item 2', + description: 'Section three item 2 description', + }, + ], + }, + ], + initialSection: Here is the initial section, + }), }; +}); + +describe('###Documentation flyout component', () => { const renderFlyout = (linkToDocumentation?: string) => { return render( ); @@ -79,16 +76,20 @@ describe('###Documentation flyout component', () => { expect(screen.getByTestId('language-documentation-navigation-link')).toBeInTheDocument(); }); - it('contains the two last sections', () => { + it('contains the two last sections', async () => { renderFlyout(); - expect(screen.getByText('Section two')).toBeInTheDocument(); - expect(screen.getByText('Section three')).toBeInTheDocument(); + await waitFor(() => { + expect(screen.getByText('Section two')).toBeInTheDocument(); + expect(screen.getByText('Section three')).toBeInTheDocument(); + }); }); - it('contains the correct section if user updates the search input', () => { + it('contains the correct section if user updates the search input', async () => { renderFlyout(); const input = screen.getByTestId('language-documentation-navigation-search'); fireEvent.change(input, { target: { value: 'two' } }); - expect(screen.getByText('Section two')).toBeInTheDocument(); + await waitFor(() => { + expect(screen.getByText('Section two')).toBeInTheDocument(); + }); }); }); diff --git a/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx b/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx index c25a205356d906..238960301cd296 100644 --- a/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx +++ b/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx @@ -10,23 +10,25 @@ import React, { useCallback, useEffect, useState, useRef, useMemo } from 'react' import { EuiFlyout, useEuiTheme, EuiFlyoutBody, EuiFlyoutHeader } from '@elastic/eui'; import { getFilteredGroups } from '../../utils/get_filtered_groups'; import { DocumentationMainContent, DocumentationNavigation } from '../shared'; +import { getESQLDocsSections } from '../../sections'; import type { LanguageDocumentationSections } from '../../types'; interface DocumentationFlyoutProps { isHelpMenuOpen: boolean; onHelpMenuVisibilityChange: (status: boolean) => void; - sections?: LanguageDocumentationSections; searchInDescription?: boolean; linkToDocumentation?: string; } function DocumentationFlyout({ - sections, searchInDescription, linkToDocumentation, isHelpMenuOpen, onHelpMenuVisibilityChange, }: DocumentationFlyoutProps) { + const [documentationSections, setDocumentationSections] = + useState(); + const { euiTheme } = useEuiTheme(); const DEFAULT_WIDTH = euiTheme.base * 34; @@ -35,10 +37,6 @@ function DocumentationFlyout({ const scrollTargets = useRef>({}); - const filteredGroups = useMemo(() => { - return getFilteredGroups(searchText, searchInDescription, sections, 1); - }, [sections, searchText, searchInDescription]); - const onNavigationChange = useCallback((selectedOptions) => { setSelectedSection(selectedOptions.length ? selectedOptions[0].label : undefined); if (selectedOptions.length) { @@ -51,6 +49,20 @@ function DocumentationFlyout({ onHelpMenuVisibilityChange(isHelpMenuOpen ?? false); }, [isHelpMenuOpen, onHelpMenuVisibilityChange]); + useEffect(() => { + async function getDocumentation() { + const sections = await getESQLDocsSections(); + setDocumentationSections(sections); + } + if (!documentationSections) { + getDocumentation(); + } + }, [documentationSections]); + + const filteredGroups = useMemo(() => { + return getFilteredGroups(searchText, searchInDescription, documentationSections, 1); + }, [documentationSections, searchText, searchInDescription]); + return ( <> {isHelpMenuOpen && ( @@ -76,7 +88,7 @@ function DocumentationFlyout({ searchText={searchText} scrollTargets={scrollTargets} filteredGroups={filteredGroups} - sections={sections} + sections={documentationSections} /> diff --git a/packages/kbn-language-documentation-popover/src/components/as_inline/index.test.tsx b/packages/kbn-language-documentation-popover/src/components/as_inline/index.test.tsx index acd16391eb15c5..4ba873614f9b24 100644 --- a/packages/kbn-language-documentation-popover/src/components/as_inline/index.test.tsx +++ b/packages/kbn-language-documentation-popover/src/components/as_inline/index.test.tsx @@ -8,57 +8,60 @@ */ import React from 'react'; -import { screen, render, fireEvent } from '@testing-library/react'; +import { screen, render, fireEvent, waitFor } from '@testing-library/react'; import { Markdown } from '@kbn/shared-ux-markdown'; import { LanguageDocumentationInline } from '.'; -describe('###Documentation flyout component', () => { - const sections = { - groups: [ - { - label: 'Section one', - description: 'Section 1 description', - items: [], - }, - { - label: 'Section two', - items: [ - { - label: 'Section two item 1', - description: ( - - ), - }, - { - label: 'Section two item 2', - description: ( - - ), - }, - ], - }, - { - label: 'Section three', - items: [ - { - label: 'Section three item 1', - description: , - }, - { - label: 'Section three item 2', - description: ( - - ), - }, - ], - }, - ], - initialSection: Here is the initial section, +const mockMarkDownDescription = () => ( + +); + +jest.mock('../../sections', () => { + const module = jest.requireActual('../../sections'); + return { + ...module, + getESQLDocsSections: () => ({ + groups: [ + { + label: 'Section one', + description: 'Section 1 description', + items: [], + }, + { + label: 'Section two', + items: [ + { + label: 'Section two item 1', + description: 'Section two item 1 description', + }, + { + label: 'Section two item 2', + description: 'Section two item 2 description', + }, + ], + }, + { + label: 'Section three', + items: [ + { + label: 'Section three item 1', + description: mockMarkDownDescription(), + }, + { + label: 'Section three item 2', + description: 'Section three item 2 description', + }, + ], + }, + ], + initialSection: Here is the initial section, + }), }; +}); + +describe('###Documentation flyout component', () => { const renderInlineComponent = (searchInDescription = false) => { - return render( - - ); + return render(); }; it('has a header element for navigation through the sections', () => { renderInlineComponent(); @@ -66,23 +69,29 @@ describe('###Documentation flyout component', () => { expect(screen.getByTestId('language-documentation-navigation-dropdown')).toBeInTheDocument(); }); - it('contains the two last sections', () => { + it('contains the two last sections', async () => { renderInlineComponent(); - expect(screen.getByText('Section two')).toBeInTheDocument(); - expect(screen.getByText('Section three')).toBeInTheDocument(); + await waitFor(() => { + expect(screen.getByText('Section two')).toBeInTheDocument(); + expect(screen.getByText('Section three')).toBeInTheDocument(); + }); }); - it('contains the correct section if user updates the search input', () => { + it('contains the correct section if user updates the search input', async () => { renderInlineComponent(); const input = screen.getByTestId('language-documentation-navigation-search'); fireEvent.change(input, { target: { value: 'two' } }); - expect(screen.getByText('Section two')).toBeInTheDocument(); + await waitFor(() => { + expect(screen.getByText('Section two')).toBeInTheDocument(); + }); }); - it('contains the correct section if user updates the search input with a text that exist in the description', () => { + it('contains the correct section if user updates the search input with a text that exist in the description', async () => { renderInlineComponent(true); const input = screen.getByTestId('language-documentation-navigation-search'); fireEvent.change(input, { target: { value: 'blah' } }); - expect(screen.getByText('Section three')).toBeInTheDocument(); + await waitFor(() => { + expect(screen.getByText('Section three')).toBeInTheDocument(); + }); }); }); diff --git a/packages/kbn-language-documentation-popover/src/components/as_inline/index.tsx b/packages/kbn-language-documentation-popover/src/components/as_inline/index.tsx index 2781864922a2cd..dcc860aa70db2a 100644 --- a/packages/kbn-language-documentation-popover/src/components/as_inline/index.tsx +++ b/packages/kbn-language-documentation-popover/src/components/as_inline/index.tsx @@ -6,31 +6,43 @@ * your election, the "Elastic License 2.0", the "GNU Affero General Public * License v3.0 only", or the "Server Side Public License, v 1". */ -import React, { useCallback, useState, useRef, useMemo } from 'react'; +import React, { useCallback, useState, useRef, useMemo, useEffect } from 'react'; import { css } from '@emotion/react'; import { useEuiTheme, euiScrollBarStyles, EuiSpacer } from '@elastic/eui'; import { getFilteredGroups } from '../../utils/get_filtered_groups'; import { DocumentationMainContent, DocumentationNavigation } from '../shared'; import type { LanguageDocumentationSections } from '../../types'; +import { getESQLDocsSections } from '../../sections'; interface DocumentationInlineProps { - sections?: LanguageDocumentationSections; searchInDescription?: boolean; } const MAX_HEIGHT = 250; -function DocumentationInline({ sections, searchInDescription }: DocumentationInlineProps) { +function DocumentationInline({ searchInDescription }: DocumentationInlineProps) { const theme = useEuiTheme(); + const [documentationSections, setDocumentationSections] = + useState(); const scrollBarStyles = euiScrollBarStyles(theme); const [selectedSection, setSelectedSection] = useState(); const [searchText, setSearchText] = useState(''); const scrollTargets = useRef>({}); + useEffect(() => { + async function getDocumentation() { + const sections = await getESQLDocsSections(); + setDocumentationSections(sections); + } + if (!documentationSections) { + getDocumentation(); + } + }, [documentationSections]); + const filteredGroups = useMemo(() => { - return getFilteredGroups(searchText, searchInDescription, sections, 1); - }, [sections, searchText, searchInDescription]); + return getFilteredGroups(searchText, searchInDescription, documentationSections, 1); + }, [documentationSections, searchText, searchInDescription]); const onNavigationChange = useCallback((selectedOptions) => { setSelectedSection(selectedOptions.length ? selectedOptions[0].label : undefined); @@ -61,7 +73,7 @@ function DocumentationInline({ sections, searchInDescription }: DocumentationInl searchText={searchText} scrollTargets={scrollTargets} filteredGroups={filteredGroups} - sections={sections} + sections={documentationSections} /> ); diff --git a/packages/kbn-text-based-editor/scripts/generate_esql_docs.ts b/packages/kbn-language-documentation-popover/src/scripts/generate_esql_docs.ts similarity index 98% rename from packages/kbn-text-based-editor/scripts/generate_esql_docs.ts rename to packages/kbn-language-documentation-popover/src/scripts/generate_esql_docs.ts index 13e21ab4ffea3e..90965cf9cd625c 100644 --- a/packages/kbn-text-based-editor/scripts/generate_esql_docs.ts +++ b/packages/kbn-language-documentation-popover/src/scripts/generate_esql_docs.ts @@ -11,7 +11,7 @@ import * as recast from 'recast'; const n = recast.types.namedTypes; import fs from 'fs'; import path from 'path'; -import { functions } from '../src/esql_documentation_sections'; +import { functions } from '../sections/esql_documentation_sections'; (function () { const pathToElasticsearch = process.argv[2]; diff --git a/packages/kbn-text-based-editor/src/esql_documentation_sections.tsx b/packages/kbn-language-documentation-popover/src/sections/esql_documentation_sections.tsx similarity index 100% rename from packages/kbn-text-based-editor/src/esql_documentation_sections.tsx rename to packages/kbn-language-documentation-popover/src/sections/esql_documentation_sections.tsx diff --git a/packages/kbn-language-documentation-popover/src/sections/index.ts b/packages/kbn-language-documentation-popover/src/sections/index.ts new file mode 100644 index 00000000000000..cccea3a1891d1e --- /dev/null +++ b/packages/kbn-language-documentation-popover/src/sections/index.ts @@ -0,0 +1,44 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ +import { i18n } from '@kbn/i18n'; + +export const getESQLDocsSections = async () => { + const groups: Array<{ + label: string; + description?: string; + items: Array<{ label: string; description?: JSX.Element }>; + }> = []; + const { + sourceCommands, + processingCommands, + initialSection, + functions, + aggregationFunctions, + groupingFunctions, + operators, + } = await import('./esql_documentation_sections'); + groups.push({ + label: i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.esql', { + defaultMessage: 'ES|QL', + }), + items: [], + }); + groups.push( + sourceCommands, + processingCommands, + functions, + aggregationFunctions, + groupingFunctions, + operators + ); + return { + groups, + initialSection, + }; +}; diff --git a/packages/kbn-text-based-editor/index.ts b/packages/kbn-text-based-editor/index.ts index 142cd00596cd0f..6366240e5fda3e 100644 --- a/packages/kbn-text-based-editor/index.ts +++ b/packages/kbn-text-based-editor/index.ts @@ -9,7 +9,6 @@ export type { TextBasedLanguagesEditorProps } from './src/types'; export { fetchFieldsFromESQL } from './src/fetch_fields_from_esql'; -export { getDocumentationSections } from './src/helpers'; import { TextBasedLanguagesEditor } from './src/text_based_languages_editor'; // React.lazy support diff --git a/packages/kbn-text-based-editor/package.json b/packages/kbn-text-based-editor/package.json index 3bdc8c0ee6e65d..47d3d426b21f2b 100644 --- a/packages/kbn-text-based-editor/package.json +++ b/packages/kbn-text-based-editor/package.json @@ -5,10 +5,5 @@ "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0", "sideEffects": [ "*.scss" - ], - "scripts": { - "make:docs": "ts-node --transpileOnly scripts/generate_esql_docs.ts", - "postmake:docs": "yarn run lint:fix", - "lint:fix": "cd ../.. && node ./scripts/eslint --fix ./packages/kbn-text-based-editor/src/esql_documentation_sections.tsx" - } + ] } diff --git a/packages/kbn-text-based-editor/src/editor_footer/index.tsx b/packages/kbn-text-based-editor/src/editor_footer/index.tsx index ae19d82dce423a..c1bf5aa14b8768 100644 --- a/packages/kbn-text-based-editor/src/editor_footer/index.tsx +++ b/packages/kbn-text-based-editor/src/editor_footer/index.tsx @@ -12,12 +12,9 @@ import React, { memo, useState, useCallback, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiText, EuiFlexGroup, EuiFlexItem, EuiCode, EuiButtonIcon } from '@elastic/eui'; import { Interpolation, Theme, css } from '@emotion/react'; -import { - LanguageDocumentationInline, - type LanguageDocumentationSections, -} from '@kbn/language-documentation-popover'; +import { LanguageDocumentationInline } from '@kbn/language-documentation-popover'; import { getLimitFromESQLQuery } from '@kbn/esql-utils'; -import { type MonacoMessage, getDocumentationSections } from '../helpers'; +import { type MonacoMessage } from '../helpers'; import { ErrorsWarningsFooterPopover } from './errors_warnings_popover'; import { QueryHistoryAction, QueryHistory } from './query_history'; import { SubmitFeedbackComponent } from './feedback_component'; @@ -73,8 +70,6 @@ export const EditorFooter = memo(function EditorFooter({ const [isErrorPopoverOpen, setIsErrorPopoverOpen] = useState(false); const [isLanguageComponentOpen, setIsLanguageComponentOpen] = useState(false); const [isWarningPopoverOpen, setIsWarningPopoverOpen] = useState(false); - const [documentationSections, setDocumentationSections] = - useState(); const onUpdateAndSubmit = useCallback( (qs: string) => { @@ -96,13 +91,9 @@ export const EditorFooter = memo(function EditorFooter({ }, [isHistoryOpen, setIsHistoryOpen]); const toggleLanguageComponent = useCallback(async () => { - if (!documentationSections) { - const sections = await getDocumentationSections('esql'); - setDocumentationSections(sections); - } setIsLanguageComponentOpen(!isLanguageComponentOpen); setIsHistoryOpen(false); - }, [documentationSections, isLanguageComponentOpen, setIsHistoryOpen]); + }, [isLanguageComponentOpen, setIsHistoryOpen]); const limit = useMemo(() => getLimitFromESQLQuery(code), [code]); @@ -317,7 +308,7 @@ export const EditorFooter = memo(function EditorFooter({ )} {isLanguageComponentOpen && editorIsInline && ( - + )} diff --git a/packages/kbn-text-based-editor/src/helpers.ts b/packages/kbn-text-based-editor/src/helpers.ts index f972649d967a76..cb625911c65e8c 100644 --- a/packages/kbn-text-based-editor/src/helpers.ts +++ b/packages/kbn-text-based-editor/src/helpers.ts @@ -159,43 +159,6 @@ export const parseErrors = (errors: Error[], code: string): MonacoMessage[] => { }); }; -export const getDocumentationSections = async (language: string) => { - const groups: Array<{ - label: string; - description?: string; - items: Array<{ label: string; description?: JSX.Element }>; - }> = []; - if (language === 'esql') { - const { - sourceCommands, - processingCommands, - initialSection, - functions, - aggregationFunctions, - groupingFunctions, - operators, - } = await import('./esql_documentation_sections'); - groups.push({ - label: i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.esql', { - defaultMessage: 'ES|QL', - }), - items: [], - }); - groups.push( - sourceCommands, - processingCommands, - functions, - aggregationFunctions, - groupingFunctions, - operators - ); - return { - groups, - initialSection, - }; - } -}; - export const getWrappedInPipesCode = (code: string, isWrapped: boolean): string => { const pipes = code?.split('|'); const codeNoLines = pipes?.map((pipe) => { diff --git a/packages/kbn-text-based-editor/src/text_based_languages_editor.test.tsx b/packages/kbn-text-based-editor/src/text_based_languages_editor.test.tsx index 9228edd47b0de0..ff8253646980c3 100644 --- a/packages/kbn-text-based-editor/src/text_based_languages_editor.test.tsx +++ b/packages/kbn-text-based-editor/src/text_based_languages_editor.test.tsx @@ -16,21 +16,6 @@ import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { TextBasedLanguagesEditor } from './text_based_languages_editor'; import type { TextBasedLanguagesEditorProps } from './types'; import { ReactWrapper } from 'enzyme'; - -jest.mock('./helpers', () => { - const module = jest.requireActual('./helpers'); - return { - ...module, - getDocumentationSections: () => ({ - groups: [ - { - label: 'How it works', - items: [], - }, - ], - }), - }; -}); import { of } from 'rxjs'; describe('TextBasedLanguagesEditor', () => { diff --git a/src/plugins/unified_search/public/query_string_input/esql_menu_popover.tsx b/src/plugins/unified_search/public/query_string_input/esql_menu_popover.tsx index 4255a05744de11..1c04bbd84c7fa1 100644 --- a/src/plugins/unified_search/public/query_string_input/esql_menu_popover.tsx +++ b/src/plugins/unified_search/public/query_string_input/esql_menu_popover.tsx @@ -19,10 +19,7 @@ import { import { useKibana } from '@kbn/kibana-react-plugin/public'; import { i18n } from '@kbn/i18n'; import { FEEDBACK_LINK } from '@kbn/esql-utils'; -import { - LanguageDocumentationFlyout, - type LanguageDocumentationSections, -} from '@kbn/language-documentation-popover'; +import { LanguageDocumentationFlyout } from '@kbn/language-documentation-popover'; import type { IUnifiedSearchPluginServices } from '../types'; export const ESQLMenuPopover = () => { @@ -31,17 +28,10 @@ export const ESQLMenuPopover = () => { const { docLinks } = kibana.services; const [isESQLMenuPopoverOpen, setIsESQLMenuPopoverOpen] = useState(false); const [isLanguageComponentOpen, setIsLanguageComponentOpen] = useState(false); - const [documentationSections, setDocumentationSections] = - useState(); const toggleLanguageComponent = useCallback(async () => { - if (!documentationSections) { - const { getDocumentationSections } = await import('@kbn/text-based-editor'); - const sections = await getDocumentationSections('esql'); - setDocumentationSections(sections); - } setIsLanguageComponentOpen(!isLanguageComponentOpen); - }, [documentationSections, isLanguageComponentOpen]); + }, [isLanguageComponentOpen]); const esqlPanelItems = useMemo(() => { const panelItems: EuiContextMenuPanelProps['items'] = []; @@ -125,7 +115,6 @@ export const ESQLMenuPopover = () => { _**AVERTISSEMENT :** Ceci peut utiliser une quantité importante de mémoire et ES|QL ne développe pas encore les agrégations au-delà de la mémoire. Cette agrégation fonctionnera donc jusqu'à ce qu'elle soit utilisée pour collecter plus de valeurs que la mémoire ne peut en contenir. Lorsque le nombre de valeurs collectées est trop élevé, la requête échoue avec un message d'erreur de type [Circuit Breaker Error](https://www.elastic.co/guide/en/elasticsearch/reference/current/circuit-breaker-errors.html)._\n\n ", "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.where": "WHERE", "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.where.markdown": "### WHERE\nUtilisez `WHERE` afin d'obtenir un tableau qui comprend toutes les lignes du tableau d'entrée pour lesquelles la condition fournie est évaluée à `true` :\n \n````\nFROM employees\n| KEEP first_name, last_name, still_hired\n| WHERE still_hired == true\n````\n\n#### Opérateurs\n\nPour obtenir un aperçu des opérateurs pris en charge, consultez la section **Opérateurs**.\n\n#### Fonctions\n`WHERE` prend en charge diverses fonctions de calcul des valeurs. Pour en savoir plus, consultez la section **Fonctions**.\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationLabel": "Documentation", "textBasedEditor.query.textBasedLanguagesEditor.EnableWordWrapLabel": "Ajouter des sauts de ligne aux barres verticales", "textBasedEditor.query.textBasedLanguagesEditor.errorCount": "{count} {count, plural, one {erreur} other {erreurs}}", "textBasedEditor.query.textBasedLanguagesEditor.errorsTitle": "Erreurs", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 43dd8f770ac1ed..ddbcf30c5727a5 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -7444,7 +7444,6 @@ "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.valuesFunction.markdown": "### 値\n\n**警告:本番環境ではVALUESを使用しないでください。この機能はテクニカルプレビュー中であり、将来のリリースでは変更されたり削除されたりする場合があります。Elasticはすべての問題の修正に努めますが、テクニカルプレビュー中の機能には正式なGA機能のサポートSLAが適用されません。**\n\nグループのすべての値を複数値フィールドとして返します。返された値の順序は保証されません。返された値を並べ替える必要がある場合はMV_SORTを使用します。\n\ngeo_point、cartesian_point、geo_shape、またはcartesian_shapeを除く任意のタイプの式を使用できます。\n\n\n例:\n\n```\n FROM employees\n| EVAL first_letter = SUBSTRING(first_name, 0, 1)\n| STATS first_name=MV_SORT(VALUES(first_name)) BY first_letter\n| SORT first_letter\n```\n\n> _**警告:** これはメモリの使用量が非常に大きくなるため、ES|QLはメモリを超えると、集約を拡大しません。このため、この集約は、収集する値がメモリに収まらなくなるまでは機能します。収集する値が多くなりすぎると、[回路ブレーカーエラー](https://www.elastic.co/guide/en/elasticsearch/reference/current/circuit-breaker-errors.html)でクエリが失敗します。_\n\n ", "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.where": "WHERE", "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.where.markdown": "### WHERE\nWHEREを使用すると、入力テーブルから、指定した条件がtrueと評価されるすべての行を含むテーブルを作成します。\n \n```\nFROM employees\n| KEEP first_name, last_name, still_hired\n| WHERE still_hired == true\n```\n\n#### 演算子\n\nサポートされている演算子の概要については、**演算子**を参照してください。\n\n#### 関数\nWHEREは値を計算するためのさまざまな関数をサポートしています。**関数**をクリックすると詳細が表示されます。\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationLabel": "ドキュメント", "textBasedEditor.query.textBasedLanguagesEditor.EnableWordWrapLabel": "パイプの改行を追加", "textBasedEditor.query.textBasedLanguagesEditor.errorCount": "{count} {count, plural, other {# 件のエラー}}", "textBasedEditor.query.textBasedLanguagesEditor.errorsTitle": "エラー", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 02aa5c9d475c1b..f7a9f3797f9b58 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -7457,7 +7457,6 @@ "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.valuesFunction.markdown": "### VALUES\n\n**警告:请勿在生产环境中使用 `VALUES`。此功能处于技术预览状态,在未来版本中可能会更改或移除。Elastic 将努力修复任何问题,但处于技术预览状态的功能不受正式 GA 功能支持 SLA 的约束。**\n\n以多值字段的形式返回组中的所有值。无法保证返回值的顺序。如果需要按顺序返回值,请使用 `MV_SORT`。\n\n接受任何类型的表达式,但 `geo_point`、`cartesian_point`、`geo_shape` 或 `cartesian_shape` 除外。\n\n\n例如:\n\n```\n FROM employees\n| EVAL first_letter = SUBSTRING(first_name, 0, 1)\n| STATS first_name=MV_SORT(VALUES(first_name)) BY first_letter\n| SORT first_letter\n```\n\n> _**警告:**这可能会占用大量内存,但除内存以外,ES|QL 尚不会增长聚合。因此,此聚合会正常工作,直到将其用于收集的值超出内存装载量。一旦收集的值过多,查询将会失败,并出现[断路器错误](https://www.elastic.co/guide/en/elasticsearch/reference/current/circuit-breaker-errors.html)。_\n\n ", "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.where": "WHERE", "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.where.markdown": "### WHERE\n使用 `WHERE` 可生成一个表,其中包含输入表中所提供的条件评估为 `true` 的所有行:\n \n```\nFROM employees\n| KEEP first_name, last_name, still_hired\n| WHERE still_hired == true\n```\n\n#### 运算符\n\n请参阅**运算符**了解所支持的运算符的概览。\n\n#### 函数\n`WHERE` 支持各种用于计算值的函数。请参阅**函数**了解更多信息。\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationLabel": "文档", "textBasedEditor.query.textBasedLanguagesEditor.EnableWordWrapLabel": "在管道符上添加换行符", "textBasedEditor.query.textBasedLanguagesEditor.errorCount": "{count} 个{count, plural, other {错误}}", "textBasedEditor.query.textBasedLanguagesEditor.errorsTitle": "错误", From 3cf6fb4027006678670158a1cfd378859a5c61ab Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Tue, 10 Sep 2024 11:52:02 +0200 Subject: [PATCH 15/31] i18n fix --- .../kbn-language-documentation-popover/src/sections/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kbn-language-documentation-popover/src/sections/index.ts b/packages/kbn-language-documentation-popover/src/sections/index.ts index cccea3a1891d1e..d7804e6ea89adc 100644 --- a/packages/kbn-language-documentation-popover/src/sections/index.ts +++ b/packages/kbn-language-documentation-popover/src/sections/index.ts @@ -24,7 +24,7 @@ export const getESQLDocsSections = async () => { operators, } = await import('./esql_documentation_sections'); groups.push({ - label: i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.esql', { + label: i18n.translate('languageDocumentationPopover.esqlSections.initialSectionLabel', { defaultMessage: 'ES|QL', }), items: [], From 5e98010ef0dc6db1cb46d4cabb239e25b34a557b Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 10 Sep 2024 10:13:08 +0000 Subject: [PATCH 16/31] [CI] Auto-commit changed files from 'node scripts/notice' --- packages/kbn-text-based-editor/tsconfig.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/kbn-text-based-editor/tsconfig.json b/packages/kbn-text-based-editor/tsconfig.json index b5ebfb8526df0a..808fb6e48d836f 100644 --- a/packages/kbn-text-based-editor/tsconfig.json +++ b/packages/kbn-text-based-editor/tsconfig.json @@ -25,7 +25,6 @@ "@kbn/data-views-plugin", "@kbn/index-management", "@kbn/code-editor", - "@kbn/shared-ux-markdown", "@kbn/fields-metadata-plugin", "@kbn/esql-validation-autocomplete", "@kbn/esql-utils", From d9ed85336a2a356f8a81568741a79b7b057cb56d Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Tue, 10 Sep 2024 12:37:50 +0200 Subject: [PATCH 17/31] Fix paths --- packages/kbn-language-documentation-popover/package.json | 2 +- .../src/scripts/generate_esql_docs.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/kbn-language-documentation-popover/package.json b/packages/kbn-language-documentation-popover/package.json index 6ec4c7df4fafb7..d89dff6d96958b 100644 --- a/packages/kbn-language-documentation-popover/package.json +++ b/packages/kbn-language-documentation-popover/package.json @@ -9,6 +9,6 @@ "scripts": { "make:docs": "ts-node --transpileOnly scripts/generate_esql_docs.ts", "postmake:docs": "yarn run lint:fix", - "lint:fix": "cd ../.. && node ./scripts/eslint --fix ./packages/kbn-text-based-editor/src/esql_documentation_sections.tsx" + "lint:fix": "cd ../.. && node ./scripts/eslint --fix ./packages/kbn-language-documentation-popover/src/sections/esql_documentation_sections.tsx" } } \ No newline at end of file diff --git a/packages/kbn-language-documentation-popover/src/scripts/generate_esql_docs.ts b/packages/kbn-language-documentation-popover/src/scripts/generate_esql_docs.ts index 90965cf9cd625c..f1846b5bba126b 100644 --- a/packages/kbn-language-documentation-popover/src/scripts/generate_esql_docs.ts +++ b/packages/kbn-language-documentation-popover/src/scripts/generate_esql_docs.ts @@ -95,7 +95,7 @@ function writeFunctionDocs(functionDocs: Map) { };`; }); - const pathToDocsFile = path.join(__dirname, '../src/esql_documentation_sections.tsx'); + const pathToDocsFile = path.join(__dirname, '../sections/esql_documentation_sections.tsx'); const ast = recast.parse(fs.readFileSync(pathToDocsFile, 'utf-8'), { parser: require('recast/parsers/babel'), From 93f4e4dec5169205f708d4ac66771a7bed1a6c90 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Tue, 10 Sep 2024 12:39:16 +0200 Subject: [PATCH 18/31] Cleanup --- packages/kbn-text-based-editor/src/helpers.ts | 37 ------------------- 1 file changed, 37 deletions(-) diff --git a/packages/kbn-text-based-editor/src/helpers.ts b/packages/kbn-text-based-editor/src/helpers.ts index 5e7e9fb0914004..8916d2c48f655e 100644 --- a/packages/kbn-text-based-editor/src/helpers.ts +++ b/packages/kbn-text-based-editor/src/helpers.ts @@ -159,43 +159,6 @@ export const parseErrors = (errors: Error[], code: string): MonacoMessage[] => { }); }; -export const getDocumentationSections = async (language: string) => { - const groups: Array<{ - label: string; - description?: string; - items: Array<{ label: string; description?: JSX.Element }>; - }> = []; - if (language === 'esql') { - const { - sourceCommands, - processingCommands, - initialSection, - functions, - aggregationFunctions, - groupingFunctions, - operators, - } = await import('./esql_documentation_sections'); - groups.push({ - label: i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.esql', { - defaultMessage: 'ES|QL', - }), - items: [], - }); - groups.push( - sourceCommands, - processingCommands, - functions, - aggregationFunctions, - groupingFunctions, - operators - ); - return { - groups, - initialSection, - }; - } -}; - export const getIndicesList = async (dataViews: DataViewsPublicPluginStart) => { const indices = await dataViews.getIndices({ showAllIndices: false, From 6f7bb8abe016fa74a2cb058a5f46cf5b2410c35d Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Tue, 10 Sep 2024 13:02:27 +0200 Subject: [PATCH 19/31] Fix i18n check --- .../src/scripts/generate_esql_docs.ts | 4 +- .../sections/esql_documentation_sections.tsx | 1360 ++++++----------- .../translations/translations/fr-FR.json | 494 +++--- .../translations/translations/ja-JP.json | 494 +++--- .../translations/translations/zh-CN.json | 494 +++--- 5 files changed, 1240 insertions(+), 1606 deletions(-) diff --git a/packages/kbn-language-documentation-popover/src/scripts/generate_esql_docs.ts b/packages/kbn-language-documentation-popover/src/scripts/generate_esql_docs.ts index f1846b5bba126b..c31c21eb13bc7f 100644 --- a/packages/kbn-language-documentation-popover/src/scripts/generate_esql_docs.ts +++ b/packages/kbn-language-documentation-popover/src/scripts/generate_esql_docs.ts @@ -74,7 +74,7 @@ function writeFunctionDocs(functionDocs: Map) { // Do not edit manually... automatically generated by scripts/generate_esql_docs.ts { label: i18n.translate( - 'textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.${name}', + 'languageDocumentationPopover.documentationESQL.${name}', { defaultMessage: '${name.toUpperCase()}', } @@ -82,7 +82,7 @@ function writeFunctionDocs(functionDocs: Map) { description: ( [0]) => ( export const initialSection = ( ); @@ -50,17 +47,14 @@ export const sourceCommands = { ), items: [ { - label: i18n.translate( - 'textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.from', - { - defaultMessage: 'FROM', - } - ), + label: i18n.translate('languageDocumentationPopover.documentationESQL.from', { + defaultMessage: 'FROM', + }), description: ( \` source command returns information about the deployment and its capabilities: @@ -196,17 +184,14 @@ export const processingCommands = { ), items: [ { - label: i18n.translate( - 'textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.dissect', - { - defaultMessage: 'DISSECT', - } - ), + label: i18n.translate('languageDocumentationPopover.documentationESQL.dissect', { + defaultMessage: 'DISSECT', + }), description: ( \` type conversion functions. @@ -4556,16 +4199,13 @@ ROW ver = CONCAT(("0"::INT + 1)::STRING, ".2.3")::VERSION ), }, { - label: i18n.translate( - 'textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.inOperator', - { - defaultMessage: 'IN', - } - ), + label: i18n.translate('languageDocumentationPopover.documentationESQL.inOperator', { + defaultMessage: 'IN', + }), description: ( \n\n ### ABS\n Renvoie la valeur absolue.\n\n ````\n Numéro ROW = -1.0 \n | EVAL abs_number = ABS(number)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.acos": "ACOS", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.acos.markdown": "\n\n ### ACOS\n Renvoie l'arc cosinus de `n` sous forme d'angle, exprimé en radians.\n\n ````\n ROW a=.9\n | EVAL acos=ACOS(a)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.asin": "ASIN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.asin.markdown": "\n\n ### ASIN\n Renvoie l'arc sinus de l'entrée\n expression numérique sous forme d'angle, exprimée en radians.\n\n ````\n ROW a=.9\n | EVAL asin=ASIN(a)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.atan": "ATAN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.atan.markdown": "\n\n ### ATAN\n Renvoie l'arc tangente de l'entrée\n expression numérique sous forme d'angle, exprimée en radians.\n\n ````\n ROW a=.12.9\n | EVAL atan=ATAN(a)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.atan2": "ATAN2", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.atan2.markdown": "\n\n ### ATAN2\n L'angle entre l'axe positif des x et le rayon allant de\n l'origine au point (x , y) dans le plan cartésien, exprimée en radians.\n\n ````\n ROW y=12.9, x=.6\n | EVAL atan2=ATAN2(y, x)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.autoBucketFunction": "COMPARTIMENT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.autoBucketFunction.markdown": "### COMPARTIMENT\nCréer des groupes de valeurs, des compartiments (\"buckets\"), à partir d'une entrée d'un numéro ou d'un horodatage. La taille des compartiments peut être fournie directement ou choisie selon une plage de valeurs et de décompte recommandée.\n\n`BUCKET` a deux modes de fonctionnement : \n\n1. Dans lequel la taille du compartiment est calculée selon la recommandation de décompte d'un compartiment (quatre paramètres) et une plage.\n2. Dans lequel la taille du compartiment est fournie directement (deux paramètres).\n\nAvec un nombre cible de compartiments, le début d'une plage et la fin d'une plage, `BUCKET` choisit une taille de compartiment appropriée afin de générer le nombre cible de compartiments ou moins.\n\nPar exemple, demander jusqu'à 20 compartiments pour une année organisera les données en intervalles mensuels :\n\n````\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT hire_date\n````\n\n**REMARQUE** : Le but n'est pas de fournir le nombre précis de compartiments, mais plutôt de sélectionner une plage qui fournit, tout au plus, le nombre cible de compartiments.\n\nVous pouvez combiner `BUCKET` avec une agrégation pour créer un histogramme :\n\n````\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_month = COUNT(*) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT month\n````\n\n**REMARQUE** : `BUCKET` ne crée pas de compartiments qui ne correspondent à aucun document. C'est pourquoi, dans l'exemple précédent, il manque 1985-03-01 ainsi que d'autres dates.\n\nDemander d'autres compartiments peut résulter en une plage réduite. Par exemple, demander jusqu'à 100 compartiments en un an résulte en des compartiments hebdomadaires :\n\n````\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 100, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT week\n````\n\n**REMARQUE** : `AUTO_BUCKET` ne filtre aucune ligne. Il n'utilise que la plage fournie pour choisir une taille de compartiment appropriée. Pour les lignes dont la valeur se situe en dehors de la plage, il renvoie une valeur de compartiment qui correspond à un compartiment situé en dehors de la plage. Associez `BUCKET` à `WHERE` pour filtrer les lignes.\n\nSi la taille de compartiment désirée est connue à l'avance, fournissez-la comme second argument, en ignorant la plage :\n\n````\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 1 week)\n| SORT week\n````\n\n**REMARQUE** : Lorsque vous fournissez la taille du compartiment comme second argument, ce dernier doit être une période temporelle ou une durée.\n\n`BUCKET` peut également être utilisé pour des champs numériques. Par exemple, pour créer un histogramme de salaire :\n\n````\nFROM employees\n| STATS COUNT(*) by bs = BUCKET(salary, 20, 25324, 74999)\n| SORT bs\n````\n\nContrairement à l'exemple précédent qui filtre intentionnellement sur une plage temporelle, vous n'avez pas souvent besoin de filtrer sur une plage numérique. Vous devez trouver les valeurs min et max séparément. ES|QL n'a pas encore de façon aisée d'effectuer cette opération automatiquement.\n\nLa plage peut être ignorée si la taille désirée de compartiment est connue à l'avance. Fournissez-la simplement comme second argument :\n\n````\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS c = COUNT(1) BY b = BUCKET(salary, 5000.)\n| SORT b\n````\n\n**REMARQUE** : Lorsque vous fournissez la taille du compartiment comme second argument, elle doit être de type à **virgule flottante**.\n\nVoici un exemple sur comment créer des compartiments horaires pour les dernières 24 heures, et calculer le nombre d'événements par heure :\n\n````\nFROM sample_data\n| WHERE @timestamp >= NOW() - 1 day and @timestamp < NOW()\n| STATS COUNT(*) BY bucket = BUCKET(@timestamp, 25, NOW() - 1 day, NOW())\n````\n\nVoici un exemple permettant de créer des compartiments mensuels pour l'année 1985, et calculer le salaire moyen par mois d'embauche :\n\n````\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS AVG(salary) BY bucket = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT bucket\n````\n\n`BUCKET` peut être utilisé pour les parties de groupage et d'agrégation de la commande `STATS …​ BY ...`, tant que la partie d'agrégation de la fonction est **référencée par un alias défini dans la partie de groupage**, ou que celle-ci est invoquée avec exactement la même expression.\n\nPar exemple :\n\n````\nFROM employees\n| STATS s1 = b1 + 1, s2 = BUCKET(salary / 1000 + 999, 50.) + 2 BY b1 = BUCKET(salary / 100 + 99, 50.), b2 = BUCKET(salary / 1000 + 999, 50.)\n| SORT b1, b2\n| KEEP s1, b1, s2, b2\n````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.avgFunction": "AVG", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.avgFunction.markdown": "### AVG\nRenvoie la moyenne d'un champ numérique.\n\n````\nFROM employees\n| STATS AVG(height)\n````\n\nCette expression peut utiliser des fonctions alignées. Par exemple, pour calculer la moyenne sur une colonne multivaluée, il faut d'abord utiliser`MV_AVG` pour faire la moyenne des multiples valeurs par ligne et utiliser le résultat avec la fonction `AVG` :\n\n````\nFROM employees\n| STATS avg_salary_change = AVG(MV_AVG(salary_change))\n````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.binaryOperators": "Opérateurs binaires", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.binaryOperators.markdown": "### Opérateurs binaires\nLes opérateurs de comparaison binaire suivants sont pris en charge :\n\n* égalité : `==`\n* inégalité : `!=`\n* inférieur à : `<`\n* inférieur ou égal à : `<=`\n* supérieur à : `>`\n* supérieur ou égal à : `>=`\n* ajouter : `+`\n* soustraire : `-`\n* multiplier par : `*`\n* diviser par : `/`\n* module : `%`\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.booleanOperators": "Opérateurs booléens", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.booleanOperators.markdown": "### Opérateurs booléens\nLes opérateurs booléens suivants sont pris en charge :\n\n* `AND`\n* `OR`\n* `NOT`\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.bucket": "COMPARTIMENT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.bucket.markdown": "\n\n ### COMPARTIMENT\n Créer des groupes de valeurs, des compartiments (\"buckets\"), à partir d'une entrée d'un numéro ou d'un horodatage.\n La taille des compartiments peut être fournie directement ou choisie selon une plage de valeurs et de décompte recommandée.\n\n ````\n FROM employees\n | WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n | STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n | SORT hire_date\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.case": "CASE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.case.markdown": "\n\n ### CAS\n Accepte les paires de conditions et de valeurs. La fonction renvoie la valeur qui\n appartient à la première condition étant évaluée comme `true`.\n\n Si le nombre d'arguments est impair, le dernier argument est la valeur par défaut qui est\n renvoyée si aucune condition ne correspond. Si le nombre d'arguments est pair, et\n qu'aucune condition ne correspond, la fonction renvoie `null`.\n\n ````\n FROM employees\n | EVAL type = CASE(\n languages <= 1, \"monolingual\",\n languages <= 2, \"bilingual\",\n \"polyglot\")\n | KEEP emp_no, languages, type\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.castOperator": "Cast (::)", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.castOperator.markdown": "### CAST (`::`)\nL'opérateur `::` fournit une syntaxe alternative pratique au type de converstion de fonction `TO_`.\n\nExemple :\n````\nROW ver = CONCAT((\"0\"::INT + 1)::STRING, \".2.3\")::VERSION\n````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cbrt": "CBRT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cbrt.markdown": "\n\n ### CBRT\n Renvoie la racine cubique d'un nombre. La valeur de renvoi est toujours un double, quelle que soit la valeur numérique de l'entrée.\n La racine cubique de l’infini est nulle.\n\n ````\n ROW d = 1000.0\n | EVAL c = cbrt(d)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ceil": "CEIL", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ceil.markdown": "\n\n ### CEIL\n Arrondir un nombre à l'entier supérieur.\n\n ```\n ROW a=1.8\n | EVAL a=CEIL(a)\n ```\n Remarque : Il s'agit d'un noop pour `long` (y compris non signé) et `integer`. Pour `double`, la fonction choisit la valeur `double` la plus proche de l'entier, de manière similaire à la méthode Math.ceil.\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cidr_match": "CIDR_MATCH", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cidr_match.markdown": "\n\n ### CIDR_MATCH\n Renvoie `true` si l'IP fournie est contenue dans l'un des blocs CIDR fournis.\n\n ````\n FROM hosts \n | WHERE CIDR_MATCH(ip1, \"127.0.0.2/32\", \"127.0.0.3/32\") \n | KEEP card, host, ip0, ip1\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.coalesce": "COALESCE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.coalesce.markdown": "\n\n ### COALESCE\n Renvoie le premier de ses arguments qui n'est pas nul. Si tous les arguments sont nuls, `null` est renvoyé.\n\n ````\n ROW a=null, b=\"b\"\n | EVAL COALESCE(a, b)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.concat": "CONCAT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.concat.markdown": "\n\n ### CONCAT\n Concatène deux ou plusieurs chaînes.\n\n ```\n FROM employees\n | KEEP first_name, last_name\n | EVAL fullname = CONCAT(first_name, \" \", last_name)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cos": "COS", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cos.markdown": "\n\n ### COS\n Renvoie le cosinus d'un angle.\n\n ````\n ROW a=1.8 \n | EVAL cos=COS(a)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cosh": "COSH", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cosh.markdown": "\n\n ### COSH\n Renvoie le cosinus hyperbolique d'un angle.\n\n ````\n ROW a=1.8 \n | EVAL cosh=COSH(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.countDistinctFunction": "COUNT_DISTINCT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.countDistinctFunction.markdown": "### COUNT_DISTINCT\nDécompte le nombre approximatif de valeurs distinctes.\n\n````\nFROM hosts\n| STATS COUNT_DISTINCT(ip0), COUNT_DISTINCT(ip1)\n```\n\nLa fonction `COUNT_DISTINCT` est approximative, basée sur l'algorithme HyperLogLog++. Pour en savoir plus, consultez la [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-cardinality-aggregation.html#_counts_are_approximate). La précision est configurable à l'aide d'un deuxième paramètre facultatif. La valeur maximale compatible est 40000. Les seuils supérieurs à ce nombre auront le même effet qu'un seuil de 40000. La valeur par défaut est 3000.\n\n````\nFROM hosts\n| STATS COUNT_DISTINCT(ip0, 80000), COUNT_DISTINCT(ip1, 5)\n````\n\nCette expression peut utiliser des fonctions alignées. Cet exemple divise une chaîne en plusieurs valeurs à l'aide de la fonction `SPLIT` et compte les valeurs uniques :\n\n````\nROW words=\"foo;bar;baz;qux;quux;foo\"\n| STATS distinct_word_count = COUNT_DISTINCT(SPLIT(words, \";\"))\n````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.countFunction": "COUNT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.countFunction.markdown": "### COUNT\nRenvoie le nombre total de valeurs en entrée.\n\n````\nFROM employees\n| STATS COUNT(height)\n````\n\nPeut prendre n'importe quel type de champ en entrée.\n\nPour compter le nombre de lignes, utiliser `COUNT()` ou `COUNT(*)` :\n\n````\nFROM employees\n| STATS count = COUNT(*) BY languages\n| SORT languages DESC\n````\n\nCette expression peut utiliser des fonctions alignées. Cet exemple divise une chaîne en plusieurs valeurs à l'aide de la fonction `SPLIT` et compte les valeurs :\n\n````\nROW words=\"foo;bar;baz;qux;quux;foo\"\n| STATS word_count = COUNT(SPLIT(words, \";\"))\n````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_diff": "DATE_DIFF", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_diff.markdown": "\n\n ### DATE_DIFF\n Soustrait le `startTimestamp` du `endTimestamp` et renvoie la différence en multiples `d'unité`.\n Si `startTimestamp` est postérieur à `endTimestamp`, des valeurs négatives sont renvoyées.\n\n ````\n ROW date1 = TO_DATETIME(\"2023-12-02T11:00:00.000Z\"), date2 = TO_DATETIME(\"2023-12-02T11:00:00.001Z\")\n | EVAL dd_ms = DATE_DIFF(\"microseconds\", date1, date2)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_extract": "DATE_EXTRACT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_extract.markdown": "\n\n ### DATE_EXTRACT\n Extrait des parties d'une date, telles que l'année, le mois, le jour, l'heure.\n\n ````\n ROW date = DATE_PARSE(\"yyyy-MM-dd\", \"2022-05-06\")\n | EVAL year = DATE_EXTRACT(\"year\", date)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_format": "DATE_FORMAT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_format.markdown": "\n\n ### DATE_FORMAT\n Renvoie une représentation sous forme de chaîne d'une date dans le format fourni.\n\n ````\n FROM employees\n | KEEP first_name, last_name, hire_date\n | EVAL hired = DATE_FORMAT(\"YYYY-MM-dd\", hire_date)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_parse": "DATE_PARSE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_parse.markdown": "\n\n ### DATE_PARSE\n Renvoie une date en analysant le deuxième argument selon le format spécifié dans le premier argument.\n\n ````\n ROW date_string = \"2022-05-06\"\n | EVAL date = DATE_PARSE(\"yyyy-MM-dd\", date_string)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_trunc": "DATE_TRUNC", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_trunc.markdown": "\n\n ### DATE_TRUNC\n Arrondit une date à l'intervalle le plus proche.\n\n ```\n FROM employees\n | KEEP first_name, last_name, hire_date\n | EVAL year_hired = DATE_TRUNC(1 year, hire_date)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.dissect": "DISSECT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.dissect.markdown": "### DISSECT\n`DISSECT` vous permet d'extraire des données structurées d'une chaîne. `DISSECT` compare la chaîne à un modèle basé sur les délimiteurs, et extrait les clés indiquées en tant que colonnes.\n\nPour obtenir la syntaxe des modèles \"dissect\", consultez [la documentation relative au processeur \"dissect\"](https://www.elastic.co/guide/en/elasticsearch/reference/current/dissect-processor.html).\n\n```\nROW a = \"1953-01-23T12:15:00Z - some text - 127.0.0.1\"\n| DISSECT a \"%'{Y}-%{M}-%{D}T%{h}:%{m}:%{s}Z - %{msg} - %{ip}'\"\n```` ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.drop": "DROP", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.drop.markdown": "### DROP\nAfin de supprimer certaines colonnes d'un tableau, utilisez `DROP` :\n \n```\nFROM employees\n| DROP height\n```\n\nPlutôt que de spécifier chaque colonne par son nom, vous pouvez utiliser des caractères génériques pour supprimer toutes les colonnes dont le nom correspond à un modèle :\n\n```\nFROM employees\n| DROP height*\n````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.e": "E", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.e.markdown": "\n\n ### E\n Retourne le nombre d'Euler.\n\n ````\n ROW E()\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ends_with": "ENDS_WITH", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ends_with.markdown": "\n\n ### ENDS_WITH\n Renvoie une valeur booléenne qui indique si une chaîne de mots-clés se termine par une autre chaîne.\n\n ````\n FROM employees\n | KEEP last_name\n | EVAL ln_E = ENDS_WITH(last_name, \"d\")\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.enrich": "ENRICH", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.enrich.markdown": "### ENRICH\nVous pouvez utiliser `ENRICH` pour ajouter les données de vos index existants aux enregistrements entrants. Une fonction similaire à l'[enrichissement par ingestion](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html), mais qui fonctionne au moment de la requête.\n\n```\nROW language_code = \"1\"\n| ENRICH languages_policy\n```\n\n`ENRICH` requiert l'exécution d'une [politique d'enrichissement](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html#enrich-policy). La politique d'enrichissement définit un champ de correspondance (un champ clé) et un ensemble de champs d'enrichissement.\n\n`ENRICH` recherche les enregistrements dans l'[index d'enrichissement](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html#enrich-index) en se basant sur la valeur du champ de correspondance. La clé de correspondance dans l'ensemble de données d'entrée peut être définie en utilisant `ON `. Si elle n'est pas spécifiée, la correspondance sera effectuée sur un champ portant le même nom que le champ de correspondance défini dans la politique d'enrichissement.\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a\n```\n\nVous pouvez indiquer quels attributs (parmi ceux définis comme champs d'enrichissement dans la politique) doivent être ajoutés au résultat, en utilisant la syntaxe `WITH , ...`.\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a WITH language_name\n```\n\nLes attributs peuvent également être renommés à l'aide de la syntaxe `WITH new_name=`\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a WITH name = language_name\n````\n\nPar défaut (si aucun `WITH` n'est défini), `ENRICH` ajoute au résultat tous les champs d'enrichissement définis dans la politique d'enrichissement.\n\nEn cas de collision de noms, les champs nouvellement créés remplacent les champs existants.\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.eval": "EVAL", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.eval.markdown": "### EVAL\n`EVAL` permet d'ajouter des colonnes :\n\n````\nFROM employees\n| KEEP first_name, last_name, height\n| EVAL height_feet = height * 3.281, height_cm = height * 100\n````\n\nSi la colonne indiquée existe déjà, la colonne existante sera supprimée et la nouvelle colonne sera ajoutée au tableau :\n\n````\nFROM employees\n| KEEP first_name, last_name, height\n| EVAL height = height * 3.281\n````\n\n#### Fonctions\n`EVAL` prend en charge diverses fonctions de calcul des valeurs. Pour en savoir plus, consultez les fonctions.\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.floor": "FLOOR", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.floor.markdown": "\n\n ### FLOOR\n Arrondir un nombre à l'entier inférieur.\n\n ````\n ROW a=1.8\n | EVAL a=FLOOR(a)\n ````\n Remarque : Il s'agit d'un noop pour `long` (y compris non signé) et `integer`.\n Pour `double`, la fonction choisit la valeur `double` la plus proche de l'entier,\n de manière similaire à Math.floor.\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.from": "FROM", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.from_base64": "FROM_BASE64", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.from_base64.markdown": "\n\n ### FROM_BASE64\n Décodez une chaîne base64.\n\n ````\n row a = \"ZWxhc3RpYw==\" \n | eval d = from_base64(a)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.from.markdown": "### FROM\nLa commande source `FROM` renvoie un tableau contenant jusqu'à 10 000 documents issus d'un flux de données, d'un index ou d'un alias. Chaque ligne du tableau obtenu correspond à un document. Chaque colonne correspond à un champ et est accessible par le nom de ce champ.\n\n````\nFROM employees\n````\n\nVous pouvez utiliser des [calculs impliquant des dates](https://www.elastic.co/guide/en/elasticsearch/reference/current/api-conventions.html#api-date-math-index-names) pour désigner les indices, les alias et les flux de données. Cela peut s'avérer utile pour les données temporelles.\n\nUtilisez des listes séparées par des virgules ou des caractères génériques pour rechercher plusieurs flux de données, indices ou alias :\n\n````\nFROM employees-00001,employees-*\n````\n\n#### Métadonnées\n\nES|QL peut accéder aux champs de métadonnées suivants :\n\n* `_index` : l'index auquel appartient le document. Le champ est du type `keyword`.\n* `_id` : l'identifiant du document source. Le champ est du type `keyword`.\n* `_id` : la version du document source. Le champ est du type `long`.\n\nUtilisez la directive `METADATA` pour activer les champs de métadonnées :\n\n````\nFROM index [METADATA _index, _id]\n````\n\nLes champs de métadonnées ne sont disponibles que si la source des données est un index. Par conséquent, `FROM` est la seule commande source qui prend en charge la directive `METADATA`.\n\nUne fois activés, les champs sont disponibles pour les commandes de traitement suivantes, tout comme les autres champs de l'index :\n\n````\nFROM ul_logs, apps [METADATA _index, _version]\n| WHERE id IN (13, 14) AND _version == 1\n| EVAL key = CONCAT(_index, \"_\", TO_STR(id))\n| SORT id, _index\n| KEEP id, _index, _version, key\n````\n\nDe même, comme pour les champs d'index, une fois l'agrégation effectuée, un champ de métadonnées ne sera plus accessible aux commandes suivantes, sauf s'il est utilisé comme champ de regroupement :\n\n````\nFROM employees [METADATA _index, _id]\n| STATS max = MAX(emp_no) BY _index\n````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.greatest": "GREATEST", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.greatest.markdown": "\n\n ### GREATEST\n Renvoie la valeur maximale de plusieurs colonnes. Similaire à `MV_MAX`\n sauf que ceci est destiné à une exécution sur plusieurs colonnes à la fois.\n\n ````\n ROW a = 10, b = 20\n | EVAL g = GREATEST(a, b)\n ````\n Remarque : Lorsque cette fonction est exécutée sur les champs `keyword` ou `text`, elle renvoie la dernière chaîne dans l'ordre alphabétique. Lorsqu'elle est exécutée sur des colonnes `boolean`, elle renvoie `true` si l'une des valeurs l'est.\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.grok": "GROK", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.grok.markdown": "### GROK\n`GROK` vous permet d'extraire des données structurées d'une chaîne. `GROK` compare la chaîne à des modèles, sur la base d’expressions régulières, et extrait les modèles indiqués en tant que colonnes.\n\nPour obtenir la syntaxe des modèles \"grok\", consultez [la documentation relative au processeur \"grok\"](https://www.elastic.co/guide/en/elasticsearch/reference/current/grok-processor.html).\n\n````\nROW a = \"12 15.5 15.6 true\"\n| GROK a \"%'{NUMBER:b:int}' %'{NUMBER:c:float}' %'{NUMBER:d:double}' %'{WORD:e:boolean}'\"\n````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.inOperator": "IN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.inOperator.markdown": "### IN\nL'opérateur `IN` permet de tester si un champ ou une expression est égal à un élément d'une liste de littéraux, de champs ou d'expressions :\n\n````\nROW a = 1, b = 4, c = 3\n| WHERE c-a IN (3, b / 2, a)\n````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ip_prefix": "IP_PREFIX", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ip_prefix.markdown": "\n\n ### IP_PREFIX\n Tronque une adresse IP à une longueur de préfixe donnée.\n\n ````\n row ip4 = to_ip(\"1.2.3.4\"), ip6 = to_ip(\"fe80::cae2:65ff:fece:feb9\")\n | eval ip4_prefix = ip_prefix(ip4, 24, 0), ip6_prefix = ip_prefix(ip6, 0, 112);\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.keep": "KEEP", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.keep.markdown": "### KEEP\nLa commande `KEEP` permet de définir les colonnes qui seront renvoyées et l'ordre dans lequel elles le seront.\n\nPour limiter les colonnes retournées, utilisez une liste de noms de colonnes séparés par des virgules. Les colonnes sont renvoyées dans l'ordre indiqué :\n \n````\nFROM employees\n| KEEP first_name, last_name, height\n````\n\nPlutôt que de spécifier chaque colonne par son nom, vous pouvez utiliser des caractères génériques pour renvoyer toutes les colonnes dont le nom correspond à un modèle :\n\n````\nFROM employees\n| KEEP h*\n````\n\nLe caractère générique de l'astérisque (\"*\") placé de manière isolée transpose l'ensemble des colonnes qui ne correspondent pas aux autres arguments. La requête suivante renverra en premier lieu toutes les colonnes dont le nom commence par un h, puis toutes les autres colonnes :\n\n````\nFROM employees\n| KEEP h*, *\n````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.least": "LEAST", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.least.markdown": "\n\n ### LEAST\n Renvoie la valeur minimale de plusieurs colonnes. Cette fonction est similaire à `MV_MIN`. Toutefois, elle est destinée à être exécutée sur plusieurs colonnes à la fois.\n\n ````\n ROW a = 10, b = 20\n | EVAL l = LEAST(a, b)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.left": "LEFT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.left.markdown": "\n\n ### LEFT\n Renvoie la sous-chaîne qui extrait la \"longueur\" des caractères de la \"chaîne\" en partant de la gauche.\n\n ````\n FROM employees\n | KEEP last_name\n | EVAL left = LEFT(last_name, 3)\n | SORT last_name ASC\n | LIMIT 5\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.length": "LENGHT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.length.markdown": "\n\n ### LENGTH\n Renvoie la longueur des caractères d'une chaîne.\n\n ````\n FROM employees\n | KEEP first_name, last_name\n | EVAL fn_length = LENGTH(first_name)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.limit": "LIMIT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.limit.markdown": "### LIMIT\nLa commande de traitement `LIMIT` permet de restreindre le nombre de lignes :\n \n````\nFROM employees\n| LIMIT 5\n````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.locate": "LOCATE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.locate.markdown": "\n\n ### LOCATE\n Renvoie un entier qui indique la position d'une sous-chaîne de mots-clés dans une autre chaîne\n\n ````\n row a = \"hello\"\n | eval a_ll = locate(a, \"ll\")\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.log": "LOG", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.log.markdown": "\n\n ### LOG\n Renvoie le logarithme d'une valeur dans une base. La valeur de renvoi est toujours un double, quelle que soit la valeur numérique de l'entrée.\n\n Les journaux de zéros, de nombres négatifs et de base 1 renvoient `null` ainsi qu'un avertissement.\n\n ````\n ROW base = 2.0, value = 8.0\n | EVAL s = LOG(base, value)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.log10": "LOG10", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.log10.markdown": "\n\n ### LOG10\n Renvoie le logarithme d'une valeur en base 10. La valeur de renvoi est toujours un double, quelle que soit la valeur numérique de l'entrée.\n\n Les logs de 0 et de nombres négatifs renvoient `null` ainsi qu'un avertissement.\n\n ````\n ROW d = 1000.0 \n | EVAL s = LOG10(d)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ltrim": "LTRIM", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ltrim.markdown": "\n\n ### LTRIM\n Retire les espaces au début des chaînes.\n\n ````\n ROW message = \" some text \", color = \" red \"\n | EVAL message = LTRIM(message)\n | EVAL color = LTRIM(color)\n | EVAL message = CONCAT(\"'\", message, \"'\")\n | EVAL color = CONCAT(\"'\", color, \"'\")\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.markdown": "## ES|QL\n\nUne requête ES|QL (langage de requête Elasticsearch) se compose d'une série de commandes, séparées par une barre verticale : `|`. Chaque requête commence par une **commande source**, qui produit un tableau, habituellement avec des données issues d'Elasticsearch. \n\nUne commande source peut être suivie d'une ou plusieurs **commandes de traitement**. Les commandes de traitement peuvent modifier le tableau de sortie de la commande précédente en ajoutant, supprimant ou modifiant les lignes et les colonnes.\n\n````\nsource-command\n| processing-command1\n| processing-command2\n````\n\nLe résultat d'une requête est le tableau produit par la dernière commande de traitement. \n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.maxFunction": "MAX", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.maxFunction.markdown": "### MAX\nRenvoie la valeur maximale d'une expression numérique.\n\n````\nFROM employees\n| STATS MAX(languages)\n````\n\nCette expression peut utiliser des fonctions alignées. Par exemple, pour calculer le maximum sur une moyenne d'une colonne multivaluée, il faut utiliser `MV_AVG` pour faire la moyenne des multiples valeurs par ligne et utiliser le résultat avec la fonction `MAX` :\n\n````\nFROM employees\n| STATS max_avg_salary_change = MAX(MV_AVG(salary_change))\n````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.medianAbsoluteDeviationFunction": "MEDIAN_ABSOLUTE_DEVIATION", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.medianAbsoluteDeviationFunction.markdown": "### MEDIAN_ABSOLUTE_DEVIATION\nRenvoie l'écart absolu médian, une mesure de la variabilité. Il s'agit d'un indicateur robuste, ce qui signifie qu'il est utile pour décrire des données qui peuvent présenter des valeurs aberrantes ou ne pas être normalement distribuées. Pour de telles données, il peut être plus descriptif que l'écart-type.\n\nIl est calculé comme la médiane de chaque écart de point de données par rapport à la médiane de l'ensemble de l'échantillon. Autrement dit, pour une variable aléatoire X, l'écart absolu médian est `median(|median(X) - X|)`.\n\n````\nFROM employees\n| STATS MEDIAN(salary), MEDIAN_ABSOLUTE_DEVIATION(salary)\n````\n\nREMARQUE : Comme la fonction `PERCENTILE`, la fonction `MEDIAN_ABSOLUTE_DEVIATION` est généralement approximative, et basée sur l'algorithme TDigest. Elle est également non déterministe. Cela signifie que vous pouvez obtenir des résultats légèrement différents en utilisant les mêmes données.\n\nCette expression peut utiliser des fonctions alignées. Par exemple, pour calculer l'écart absolu médian des valeurs maximales d'une colonne multivaluée, il faut d'abord utiliser `MV_MAX` pour obtenir la valeur maximale par ligne, et utiliser le résultat avec la fonction `MEDIAN_ABSOLUTE_DEVIATION` :\n\n````\nFROM employees\n| STATS m_a_d_max_salary_change = MEDIAN_ABSOLUTE_DEVIATION(MV_MAX(salary_change))\n````\n\n", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.medianFunction": "MEDIAN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.medianFunction.markdown": "### MEDIAN\nRenvoie la valeur qui est supérieure à la moitié de toutes les valeurs et inférieure à la moitié de toutes les valeurs, également connue sous le nom de `PERCENTILE` 50 %.\n\n**REMARQUE :** Comme la fonction `PERCENTILE`, la fonction `MEDIAN` est généralement approximative et basée sur l'algorithme TDigest.\n\n**AVERTISSEMENT :** `MEDIAN` est également [non déterministe](https://en.wikipedia.org/wiki/Nondeterministic_algorithm). Cela signifie que vous pouvez obtenir des résultats légèrement différents en utilisant les mêmes données.\n\nExemple :\n\n````\nFROM employees\n| STATS MEDIAN(salary), PERCENTILE(salary, 50)\n````\n\nCette expression peut utiliser des fonctions alignées. Par exemple, pour calculer le médian des valeurs maximales d'une colonne multivaluée, il faut d'abord utiliser `MV_MAX` pour obtenir la valeur maximale par ligne et utiliser le résultat avec la fonction `MEDIAN` :\n\n````\nFROM employees\n| STATS median_max_salary_change = MEDIAN(MV_MAX(salary_change))\n````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.minFunction": "MIN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.minFunction.markdown": "### MIN\nRenvoie la valeur minimale d'un champ numérique.\n\n````\nFROM employees\n| STATS MIN(languages)\n````\n\nCette expression peut utiliser des fonctions alignées. Par exemple, pour calculer le minimum sur une moyenne d'une colonne multivaluée, il faut utiliser `MV_AVG` pour faire la moyenne des valeurs multiples par ligne et utiliser le résultat avec la fonction `MIN` :\n\n````\nFROM employees\n| STATS min_avg_salary_change = MIN(MV_AVG(salary_change))\n````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_append": "MV_APPEND", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_append.markdown": "\n\n ### MV_APPEND\n Concatène les valeurs de deux champs à valeurs multiples.\n\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_avg": "MV_AVG", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_avg.markdown": "\n\n ### MV_AVG\n Convertit un champ multivalué en un champ à valeur unique comprenant la moyenne de toutes les valeurs.\n\n ````\n ROW a=[3, 5, 1, 6]\n | EVAL avg_a = MV_AVG(a)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_concat": "MV_CONCAT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_concat.markdown": "\n\n ### MV_CONCAT\n Convertit une expression de type chaîne multivalué en une colonne à valeur unique comprenant la concaténation de toutes les valeurs, séparées par un délimiteur.\n\n ````\n ROW a=[\"foo\", \"zoo\", \"bar\"]\n | EVAL j = MV_CONCAT(a, \", \")\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_count": "MV_COUNT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_count.markdown": "\n\n ### MV_COUNT\n Convertit une expression multivaluée en une colonne à valeur unique comprenant le total du nombre de valeurs.\n\n ````\n ROW a=[\"foo\", \"zoo\", \"bar\"]\n | EVAL count_a = MV_COUNT(a)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_dedupe": "MV_DEDUPE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_dedupe.markdown": "\n\n ### MV_DEDUPE\n Supprime les valeurs en doublon d'un champ multivalué.\n\n ````\n ROW a=[\"foo\", \"foo\", \"bar\", \"foo\"]\n | EVAL dedupe_a = MV_DEDUPE(a)\n ````\n Remarque : la fonction `MV_DEDUPE` est en mesure de trier les valeurs de la colonne, mais ne le fait pas systématiquement.\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_first": "MV_FIRST", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_first.markdown": "\n\n ### MV_FIRST\n Convertit une expression multivaluée en une colonne à valeur unique comprenant la\n première valeur. Ceci est particulièrement utile pour lire une fonction qui émet\n des colonnes multivaluées dans un ordre connu, comme `SPLIT`.\n\n L'ordre dans lequel les champs multivalués sont lus à partir\n du stockage sous-jacent n'est pas garanti. Il est *souvent* ascendant, mais ne vous y\n fiez pas. Si vous avez besoin de la valeur minimale, utilisez `MV_MIN` au lieu de\n `MV_FIRST`. `MV_MIN` comporte des optimisations pour les valeurs triées, il n'y a donc aucun\n avantage en matière de performances pour `MV_FIRST`.\n\n ````\n ROW a=\"foo;bar;baz\"\n | EVAL first_a = MV_FIRST(SPLIT(a, \";\"))\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_last": "MV_LAST", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_last.markdown": "\n\n ### MV_LAST\n Convertit une expression multivaluée en une colonne à valeur unique comprenant la dernière\n valeur. Ceci est particulièrement utile pour lire une fonction qui émet des champs multivalués\n dans un ordre connu, comme `SPLIT`.\n\n L'ordre dans lequel les champs multivalués sont lus à partir\n du stockage sous-jacent n'est pas garanti. Il est *souvent* ascendant, mais ne vous y\n fiez pas. Si vous avez besoin de la valeur maximale, utilisez `MV_MAX` au lieu de\n `MV_LAST`. `MV_MAX` comporte des optimisations pour les valeurs triées, il n'y a donc aucun\n avantage en matière de performances pour `MV_LAST`.\n\n ````\n ROW a=\"foo;bar;baz\"\n | EVAL last_a = MV_LAST(SPLIT(a, \";\"))\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_max": "MV_MAX", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_max.markdown": "\n\n ### MV_MAX\n Convertit une expression multivaluée en une colonne à valeur unique comprenant la valeur maximale.\n\n ````\n ROW a=[3, 5, 1]\n | EVAL max_a = MV_MAX(a)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_median": "MV_MEDIAN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_median.markdown": "\n\n ### MV_MEDIAN\n Convertit un champ multivalué en un champ à valeur unique comprenant la valeur médiane.\n\n ````\n ROW a=[3, 5, 1]\n | EVAL median_a = MV_MEDIAN(a)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_min": "MV_MIN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_min.markdown": "\n\n ### MV_MIN\n Convertit une expression multivaluée en une colonne à valeur unique comprenant la valeur minimale.\n\n ````\n ROW a=[2, 1]\n | EVAL min_a = MV_MIN(a)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_slice": "MV_SLICE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_slice.markdown": "\n\n ### MV_SLICE\n Renvoie un sous-ensemble du champ multivalué en utilisant les valeurs d'index de début et de fin.\n\n ````\n row a = [1, 2, 2, 3]\n | eval a1 = mv_slice(a, 1), a2 = mv_slice(a, 2, 3)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_sort": "MV_SORT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_sort.markdown": "\n\n ### MV_SORT\n Trie une expression multivaluée par ordre lexicographique.\n\n ````\n ROW a = [4, 2, -3, 2]\n | EVAL sa = mv_sort(a), sd = mv_sort(a, \"DESC\")\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_sum": "MV_SUM", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_sum.markdown": "\n\n ### MV_SUM\n Convertit un champ multivalué en un champ à valeur unique comprenant la somme de toutes les valeurs.\n\n ````\n ROW a=[3, 5, 6]\n | EVAL sum_a = MV_SUM(a)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_zip": "MV_ZIP", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_zip.markdown": "\n\n ### MV_ZIP\n Combine les valeurs de deux champs multivalués avec un délimiteur qui les relie.\n\n ````\n ROW a = [\"x\", \"y\", \"z\"], b = [\"1\", \"2\"]\n | EVAL c = mv_zip(a, b, \"-\")\n | KEEP a, b, c\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mvExpand": "MV_EXPAND", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mvExpand.markdown": "### MV_EXPAND\nLa commande de traitement `MV_EXPAND` développe les champs multivalués en indiquant une valeur par ligne et en dupliquant les autres champs : \n````\nROW a=[1,2,3], b=\"b\", j=[\"a\",\"b\"]\n| MV_EXPAND a\n````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.now": "NOW", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.now.markdown": "\n\n ### NOW\n Renvoie la date et l'heure actuelles.\n\n ````\n ROW current_date = NOW()\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.percentileFunction": "PERCENTILE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.percentileFunction.markdown": "### PERCENTILE\nValeur à laquelle un certain pourcentage des valeurs observées se produit. Par exemple, le 95e percentile est la valeur qui est supérieure à 95 % des valeurs observées et le 50percentile est la médiane (`MEDIAN`).\n\n````\nFROM employees\n| STATS p0 = PERCENTILE(salary, 0)\n , p50 = PERCENTILE(salary, 50)\n , p99 = PERCENTILE(salary, 99)\n````\n\n**REMARQUE** : La fonction `PERCENTILE` est généralement approximative et basée sur l'algorithme TDigest. \n\n**AVERTISSEMENT :** `PERCENTILE` est aussi [non déterministe](https://en.wikipedia.org/wiki/Nondeterministic_algorithm). Cela signifie que vous pouvez obtenir des résultats légèrement différents en utilisant les mêmes données.\n\nCette expression peut utiliser des fonctions alignées. Par exemple, pour calculer un percentile des valeurs maximales d'une colonne multivaluée, il faut d'abord utiliser `MV_MAX` pour obtenir la valeur maximale par ligne et utiliser le résultat avec la fonction `PERCENTILE` :\n\n````\nFROM employees\n| STATS p80_max_salary_change = PERCENTILE(MV_MAX(salary_change), 80)\n````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.pi": "PI", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.pi.markdown": "\n\n ### PI\n Renvoie Pi, le rapport entre la circonférence et le diamètre d'un cercle.\n\n ````\n ROW PI()\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.pow": "POW", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.pow.markdown": "\n\n ### POW\n Renvoie la valeur d’une `base` élevée à la puissance d’un `exposant`.\n\n ````\n ROW base = 2.0, exponent = 2\n | EVAL result = POW(base, exponent)\n ````\n Remarque : Il est toujours possible de dépasser un résultat double ici ; dans ce cas, la valeur `null` sera renvoyée.\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.predicates": "valeurs NULL", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.predicates.markdown": "### Valeurs NULL\nPour une comparaison avec une valeur NULL, utilisez les attributs `IS NULL` et `IS NOT NULL` :\n\n````\nFROM employees\n| WHERE birth_date IS NULL\n| KEEP first_name, last_name\n| SORT first_name\n| LIMIT 3\n````\n\n````\nFROM employees\n| WHERE is_rehired IS NOT NULL\n| STATS count(emp_no)\n````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.rename": "RENAME", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.rename.markdown": "### RENAME\nUtilisez `RENAME` pour renommer une colonne en utilisant la syntaxe suivante :\n\n````\nRENAME AS \n````\n\nPar exemple :\n\n````\nFROM employees\n| KEEP first_name, last_name, still_hired\n| RENAME still_hired AS employed\n````\n\nSi une colonne portant le nouveau nom existe déjà, elle sera remplacée par la nouvelle colonne.\n\nPlusieurs colonnes peuvent être renommées à l'aide d'une seule commande `RENAME` :\n\n````\nFROM employees\n| KEEP first_name, last_name\n| RENAME first_name AS fn, last_name AS ln\n````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.repeat": "REPEAT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.repeat.markdown": "\n\n ### REPEAT\n Renvoie une chaîne construite par la concaténation de la `chaîne` avec elle-même, le `nombre` de fois spécifié.\n\n ````\n ROW a = \"Hello!\"\n | EVAL triple_a = REPEAT(a, 3);\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.replace": "REPLACE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.replace.markdown": "\n\n ### REPLACE\n La fonction remplace dans la chaîne `str` toutes les correspondances avec l'expression régulière `regex`\n par la chaîne de remplacement `newStr`.\n\n ````\n ROW str = \"Hello World\"\n | EVAL str = REPLACE(str, \"World\", \"Universe\")\n | KEEP str\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.right": "RIGHT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.right.markdown": "\n\n ### RIGHT\n Renvoie la sous-chaîne qui extrait la longueur des caractères de `str` en partant de la droite.\n\n ````\n FROM employees\n | KEEP last_name\n | EVAL right = RIGHT(last_name, 3)\n | SORT last_name ASC\n | LIMIT 5\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.round": "ROUND", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.round.markdown": "\n\n ### ROUND\n Arrondit un nombre au nombre spécifié de décimales.\n La valeur par défaut est 0, qui renvoie l'entier le plus proche. Si le\n nombre de décimales spécifié est négatif, la fonction arrondit au nombre de décimales à gauche\n de la virgule.\n\n ````\n FROM employees\n | KEEP first_name, last_name, height\n | EVAL height_ft = ROUND(height * 3.281, 1)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.row": "ROW", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.row.markdown": "### ROW\nLa commande source `ROW` renvoie une ligne contenant une ou plusieurs colonnes avec les valeurs que vous spécifiez. Cette commande peut s'avérer utile pour les tests.\n \n````\nROW a = 1, b = \"two\", c = null\n````\n\nUtilisez des crochets pour créer des colonnes à valeurs multiples :\n\n````\nROW a = [2, 1]\n````\n\nROW permet d'utiliser des fonctions :\n\n````\nROW a = ROUND(1.23, 0)\n````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.rtrim": "RTRIM", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.rtrim.markdown": "\n\n ### RTRIM\n Supprime les espaces à la fin des chaînes.\n\n ````\n ROW message = \" some text \", color = \" red \"\n | EVAL message = RTRIM(message)\n | EVAL color = RTRIM(color)\n | EVAL message = CONCAT(\"'\", message, \"'\")\n | EVAL color = CONCAT(\"'\", color, \"'\")\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.show": "SHOW", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.show.markdown": "### SHOW\nLa commande source `SHOW ` renvoie des informations sur le déploiement et ses capacités :\n\n* Utilisez `SHOW INFO` pour renvoyer la version du déploiement, la date de compilation et le hachage.\n* Utilisez `SHOW FUNCTIONS` pour renvoyer une liste de toutes les fonctions prises en charge et un résumé de chaque fonction.\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.signum": "SIGNUM", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.signum.markdown": "\n\n ### SIGNUM\n Renvoie le signe du nombre donné.\n Il renvoie `-1` pour les nombres négatifs, `0` pour `0` et `1` pour les nombres positifs.\n\n ````\n ROW d = 100.0\n | EVAL s = SIGNUM(d)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sin": "SIN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sin.markdown": "\n\n ### SIN\n Renvoie la fonction trigonométrique sinusoïdale d'un angle.\n\n ````\n ROW a=1.8 \n | EVAL sin=SIN(a)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sinh": "SINH", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sinh.markdown": "\n\n ### SINH\n Renvoie le sinus hyperbolique d'un angle.\n\n ````\n ROW a=1.8 \n | EVAL sinh=SINH(a)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sort": "SORT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sort.markdown": "### SORT\nUtilisez la commande `SORT` pour trier les lignes sur un ou plusieurs champs :\n\n````\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height\n````\n\nL'ordre de tri par défaut est croissant. Définissez un ordre de tri explicite en utilisant `ASC` ou `DESC` :\n\n````\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height DESC\n````\n\nSi deux lignes disposent de la même clé de tri, l'ordre original sera préservé. Vous pouvez ajouter des expressions de tri pour départager les deux lignes :\n\n````\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height DESC, first_name ASC\n````\n\n#### valeurs `null`\nPar défaut, les valeurs `null` sont considérées comme étant supérieures à toutes les autres valeurs. Selon un ordre de tri croissant, les valeurs `null` sont classées en dernier. Selon un ordre de tri décroissant, les valeurs `null` sont classées en premier. Pour modifier cet ordre, utilisez `NULLS FIRST` ou `NULLS LAST` :\n\n````\nFROM employees\n| KEEP first_name, last_name, height\n| SORT first_name ASC NULLS FIRST\n````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.split": "SPLIT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.split.markdown": "\n\n ### SPLIT\n Divise une chaîne de valeur unique en plusieurs chaînes.\n\n ````\n ROW words=\"foo;bar;baz;qux;quux;corge\"\n | EVAL word = SPLIT(words, \";\")\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sqrt": "SQRT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sqrt.markdown": "\n\n ### SQRT\n Renvoie la racine carrée d'un nombre. La valeur de renvoi est toujours un double, quelle que soit la valeur numérique de l'entrée.\n Les racines carrées des nombres négatifs et des infinis sont nulles.\n\n ````\n ROW d = 100.0\n | EVAL s = SQRT(d)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_contains": "ST_CONTAINS", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_contains.markdown": "\n\n ### ST_CONTAINS\n Renvoie si la première géométrie contient la deuxième géométrie.\n Il s'agit de l'inverse de la fonction `ST_WITHIN`.\n\n ````\n FROM airport_city_boundaries\n | WHERE ST_CONTAINS(city_boundary, TO_GEOSHAPE(\"POLYGON((109.35 18.3, 109.45 18.3, 109.45 18.4, 109.35 18.4, 109.35 18.3))\"))\n | KEEP abbrev, airport, region, city, city_location\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_disjoint": "ST_DISJOINT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_disjoint.markdown": "\n\n ### ST_DISJOINT\n Renvoie si les deux géométries ou colonnes géométriques sont disjointes.\n Il s'agit de l'inverse de la fonction `ST_INTERSECTS`.\n En termes mathématiques : ST_Disjoint(A, B) ⇔ A ⋂ B = ∅\n\n ````\n FROM airport_city_boundaries\n | WHERE ST_DISJOINT(city_boundary, TO_GEOSHAPE(\"POLYGON((-10 -60, 120 -60, 120 60, -10 60, -10 -60))\"))\n | KEEP abbrev, airport, region, city, city_location\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_distance": "ST_DISTANCE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_distance.markdown": "\n\n ### ST_DISTANCE\n Calcule la distance entre deux points.\n Pour les géométries cartésiennes, c’est la distance pythagoricienne dans les mêmes unités que les coordonnées d'origine.\n Pour les géométries géographiques, c’est la distance circulaire le long du grand cercle en mètres.\n\n ````\n Aéroports FROM\n | WHERE abbrev == \"CPH\"\n | EVAL distance = ST_DISTANCE(location, city_location)\n | KEEP abbrev, name, location, city_location, distance\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_intersects": "ST_INTERSECTS", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_intersects.markdown": "\n\n ### ST_INTERSECTS\n Renvoie `true` (vrai) si deux géométries se croisent.\n Elles se croisent si elles ont un point commun, y compris leurs points intérieurs\n (les points situés le long des lignes ou dans des polygones).\n Il s'agit de l'inverse de la fonction `ST_DISJOINT`.\n En termes mathématiques : ST_Intersects(A, B) ⇔ A ⋂ B ≠ ∅\n\n ````\n Aéroports FROM\n | WHERE ST_INTERSECTS(location, TO_GEOSHAPE(\"POLYGON((42 14, 43 14, 43 15, 42 15, 42 14))\"))\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_within": "ST_WITHIN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_within.markdown": "\n\n ### ST_WITHIN\n Renvoie si la première géométrie est à l'intérieur de la deuxième géométrie.\n Il s'agit de l'inverse de la fonction `ST_CONTAINS`.\n\n ````\n FROM airport_city_boundaries\n | WHERE ST_WITHIN(city_boundary, TO_GEOSHAPE(\"POLYGON((109.1 18.15, 109.6 18.15, 109.6 18.65, 109.1 18.65, 109.1 18.15))\"))\n | KEEP abbrev, airport, region, city, city_location\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_x": "ST_X", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_x.markdown": "\n\n ### ST_X\n Extrait la coordonnée `x` du point fourni.\n Si les points sont de type `geo_point`, cela revient à extraire la valeur de la `longitude`.\n\n ````\n ROW point = TO_GEOPOINT(\"POINT(42.97109629958868 14.7552534006536)\")\n | EVAL x = ST_X(point), y = ST_Y(point)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_y": "ST_Y", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_y.markdown": "\n\n ### ST_Y\n Extrait la coordonnée `y` du point fourni.\n Si les points sont de type `geo_point`, cela revient à extraire la valeur de la `latitude`.\n\n ````\n ROW point = TO_GEOPOINT(\"POINT(42.97109629958868 14.7552534006536)\")\n | EVAL x = ST_X(point), y = ST_Y(point)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.starts_with": "STARTS_WITH", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.starts_with.markdown": "\n\n ### STARTS_WITH\n Renvoie un booléen qui indique si une chaîne de mot-clés débute par une autre chaîne.\n\n ````\n FROM employees\n | KEEP last_name\n | EVAL ln_S = STARTS_WITH(last_name, \"B\")\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.statsby": "STATS ... BY", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.statsby.markdown": "### STATS ... BY\nUtilisez `STATS ... BY` pour regrouper les lignes en fonction d'une valeur commune et calculer une ou plusieurs valeurs agrégées sur les lignes regroupées.\n\n**Exemples** :\n\n````\nFROM employees\n| STATS count = COUNT(emp_no) BY languages\n| SORT languages\n````\n\nSi `BY` est omis, le tableau de sortie contient exactement une ligne avec les agrégations appliquées sur l'ensemble des données :\n\n````\nFROM employees\n| STATS avg_lang = AVG(languages)\n````\n\nIl est possible de calculer plusieurs valeurs :\n\n````\nFROM employees\n| STATS avg_lang = AVG(languages), max_lang = MAX(languages)\n````\n\nIl est également possible d'effectuer des regroupements en fonction de plusieurs valeurs (uniquement pour les champs longs et les champs de la famille de mots-clés) :\n\n````\nFROM employees\n| EVAL hired = DATE_FORMAT(hire_date, \"YYYY\")\n| STATS avg_salary = AVG(salary) BY hired, languages.long\n| EVAL avg_salary = ROUND(avg_salary)\n| SORT hired, languages.long\n````\n\nConsultez la rubrique **Fonctions d'agrégation** pour obtenir la liste des fonctions pouvant être utilisées avec `STATS ... BY`.\n\nLes fonctions d'agrégation et les expressions de regroupement acceptent toutes deux d'autres fonctions. Ceci est utile pour utiliser `STATS...BY` sur des colonnes à valeur multiple. Par exemple, pour calculer l'évolution moyenne du salaire, vous pouvez utiliser `MV_AVG` pour faire la moyenne des multiples valeurs par employé, et utiliser le résultat avec la fonction `AVG` :\n\n````\nFROM employees\n| STATS avg_salary_change = AVG(MV_AVG(salary_change))\n````\n\nLe regroupement par expression est par exemple le regroupement des employés en fonction de la première lettre de leur nom de famille :\n\n````\nFROM employees\n| STATS my_count = COUNT() BY LEFT(last_name, 1)\n| SORT \"LEFT(last_name, 1)\"\n````\n\nIl n'est pas obligatoire d'indiquer le nom de la colonne de sortie. S'il n'est pas spécifié, le nouveau nom de la colonne est égal à l'expression. La requête suivante renvoie une colonne appelée `AVG(salary)` :\n\n````\nFROM employees\n| STATS AVG(salary)\n````\n\nComme ce nom contient des caractères spéciaux, il doit être placé entre deux caractères (`) lorsqu'il est utilisé dans des commandes suivantes :\n\n````\nFROM employees\n| STATS AVG(salary)\n| EVAL avg_salary_rounded = ROUND(\"AVG(salary)\")\n````\n\n**Remarque** : `STATS` sans aucun groupe est beaucoup plus rapide que l'ajout d'un groupe.\n\n**Remarque** : Le regroupement sur une seule expression est actuellement beaucoup plus optimisé que le regroupement sur plusieurs expressions.\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.stCentroidFunction": "ST_CENTROID_AGG", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.stCentroidFunction.markdown": "### ST_CENTROID_AGG\n**AVERTISSEMENT : Cette fonctionnalité est en version d'évaluation technique et pourra être modifiée ou supprimée dans une future version. Elastic s'efforcera de corriger tout problème éventuel, mais les fonctionnalités des versions d'évaluation technique ne sont pas soumises aux accords de niveau de service (SLA) d'assistance des fonctionnalités officielles en disponibilité générale.**\n\nCalcule le centroïde spatial sur un champ avec un type de géométrie de point spatial.\n\n````\nAéroports FROM\n| STATS centroid=ST_CENTROID_AGG(location)\n````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.stringOperators": "LIKE et RLIKE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.stringOperators.markdown": "### LIKE et RLIKE\nPour comparer des chaînes en utilisant des caractères génériques ou des expressions régulières, utilisez `LIKE` ou `RLIKE` :\n\nUtilisez `LIKE` pour faire correspondre des chaînes à l'aide de caractères génériques. Les caractères génériques suivants sont pris en charge :\n\n* `*` correspond à zéro caractère ou plus.\n* `?` correspond à un seul caractère.\n\n````\nFROM employees\n| WHERE first_name LIKE \"?b*\"\n| KEEP first_name, last_name\n````\n\nUtilisez `RLIKE` pour faire correspondre des chaînes à l'aide d'expressions régulières :\n\n````\nFROM employees\n| WHERE first_name RLIKE \".leja.*\"\n| KEEP first_name, last_name\n````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.substring": "SUBSTRING", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.substring.markdown": "\n\n ### SUBSTRING\n Renvoie la sous-chaîne d'une chaîne, délimitée en fonction d'une position de départ et d'une longueur facultative\n\n ````\n FROM employees\n | KEEP last_name\n | EVAL ln_sub = SUBSTRING(last_name, 1, 3)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sumFunction": "SUM", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sumFunction.markdown": "### SUM\nRenvoie la somme d'un champ numérique.\n\n````\nFROM employees\n| STATS SUM(languages)\n````\n\nCette expression peut utiliser des fonctions alignées. Par exemple, pour calculer la somme de l'évolution de salaire maximale de chaque employé, appliquez la fonction `MV_MAX` à chaque ligne et additionnez les résultats (`SUM`) :\n\n````\nFROM employees\n| STATS total_salary_changes = SUM(MV_MAX(salary_change))\n````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.tan": "TAN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.tan.markdown": "\n\n ### TAN\n Renvoie la fonction trigonométrique Tangente d'un angle.\n\n ````\n ROW a=1.8 \n | EVAL tan=TAN(a)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.tanh": "TANH", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.tanh.markdown": "\n\n ### TANH\n Renvoie la fonction hyperbolique Tangente d'un angle.\n\n ````\n ROW a=1.8 \n | EVAL tanh=TANH(a)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.tau": "TAU", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.tau.markdown": "\n\n ### TAU\n Renvoie le rapport entre la circonférence et le rayon d'un cercle.\n\n ````\n ROW TAU()\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_base64": "TO_BASE64", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_base64.markdown": "\n\n ### TO_BASE64\n Encode une chaîne en chaîne base64.\n\n ````\n row a = \"elastic\" \n | eval e = to_base64(a)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_boolean": "TO_BOOLEAN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_boolean.markdown": "\n\n ### TO_BOOLEAN\n Convertit une valeur d'entrée en une valeur booléenne.\n Une chaîne de valeur *true* sera convertie, sans tenir compte de la casse, en une valeur booléenne *true*.\n Pour toute autre valeur, y compris une chaîne vide, la fonction renverra *false*.\n La valeur numérique *0* sera convertie en *false*, toute autre valeur sera convertie en *true*.\n\n ````\n ROW str = [\"true\", \"TRuE\", \"false\", \"\", \"yes\", \"1\"]\n | EVAL bool = TO_BOOLEAN(str)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_cartesianpoint": "TO_CARTESIANPOINT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_cartesianpoint.markdown": "\n\n ### TO_CARTESIANPOINT\n Convertit la valeur d'une entrée en une valeur `cartesian_point`.\n Une chaîne ne sera convertie que si elle respecte le format WKT Point.\n\n ````\n ROW wkt = [\"POINT(4297.11 -1475.53)\", \"POINT(7580.93 2272.77)\"]\n | MV_EXPAND wkt\n | EVAL pt = TO_CARTESIANPOINT(wkt)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_cartesianshape": "TO_CARTESIANSHAPE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_cartesianshape.markdown": "\n\n ### TO_CARTESIANSHAPE\n Convertit une valeur d'entrée en une valeur `cartesian_shape`.\n Une chaîne ne sera convertie que si elle respecte le format WKT.\n\n ````\n ROW wkt = [\"POINT(4297.11 -1475.53)\", \"POLYGON ((3339584.72 1118889.97, 4452779.63 4865942.27, 2226389.81 4865942.27, 1113194.90 2273030.92, 3339584.72 1118889.97))\"]\n | MV_EXPAND wkt\n | EVAL geom = TO_CARTESIANSHAPE(wkt)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_datetime": "TO_DATETIME", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_datetime.markdown": "\n\n ### TO_DATETIME\n Convertit une valeur d'entrée en une valeur de date.\n Une chaîne ne sera convertie que si elle respecte le format `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'`.\n Pour convertir des dates vers d'autres formats, utilisez `DATE_PARSE`.\n\n ````\n ROW string = [\"1953-09-02T00:00:00.000Z\", \"1964-06-02T00:00:00.000Z\", \"1964-06-02 00:00:00\"]\n | EVAL datetime = TO_DATETIME(string)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_degrees": "TO_DEGREES", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_degrees.markdown": "\n\n ### TO_DEGREES\n Convertit un nombre en radians en degrés.\n\n ````\n ROW rad = [1.57, 3.14, 4.71]\n | EVAL deg = TO_DEGREES(rad)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_double": "TO_DOUBLE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_double.markdown": "\n\n ### TO_DOUBLE\n Convertit une valeur d'entrée en une valeur double. Si le paramètre d'entrée est de type date,\n sa valeur sera interprétée en millisecondes depuis l'heure Unix,\n convertie en double. Le booléen *true* sera converti en double *1.0*, et *false* en *0.0*.\n\n ````\n ROW str1 = \"5.20128E11\", str2 = \"foo\"\n | EVAL dbl = TO_DOUBLE(\"520128000000\"), dbl1 = TO_DOUBLE(str1), dbl2 = TO_DOUBLE(str2)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_geopoint": "TO_GEOPOINT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_geopoint.markdown": "\n\n ### TO_GEOPOINT\n Convertit une valeur d'entrée en une valeur `geo_point`.\n Une chaîne ne sera convertie que si elle respecte le format WKT Point.\n\n ````\n ROW wkt = \"POINT(42.97109630194 14.7552534413725)\"\n | EVAL pt = TO_GEOPOINT(wkt)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_geoshape": "TO_GEOSHAPE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_geoshape.markdown": "\n\n ### TO_GEOSHAPE\n Convertit une valeur d'entrée en une valeur `geo_shape`.\n Une chaîne ne sera convertie que si elle respecte le format WKT.\n\n ````\n ROW wkt = \"POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))\"\n | EVAL geom = TO_GEOSHAPE(wkt)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_integer": "TO_INTEGER", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_integer.markdown": "\n\n ### TO_INTEGER\n Convertit une valeur d'entrée en une valeur entière.\n Si le paramètre d'entrée est de type date, sa valeur sera interprétée en millisecondes\n depuis l'heure Unix, convertie en entier.\n Le booléen *true* sera converti en entier *1*, et *false* en *0*.\n\n ````\n ROW long = [5013792, 2147483647, 501379200000]\n | EVAL int = TO_INTEGER(long)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_ip": "TO_IP", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_ip.markdown": "\n\n ### TO_IP\n Convertit une chaîne d'entrée en valeur IP.\n\n ````\n ROW str1 = \"1.1.1.1\", str2 = \"foo\"\n | EVAL ip1 = TO_IP(str1), ip2 = TO_IP(str2)\n | WHERE CIDR_MATCH(ip1, \"1.0.0.0/8\")\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_long": "TO_LONG", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_long.markdown": "\n\n ### TO_LONG\n Convertit une valeur d'entrée en une valeur longue. Si le paramètre d'entrée est de type date,\n sa valeur sera interprétée en millisecondes depuis l'heure Unix, convertie en valeur longue.\n Le booléen *true* sera converti en valeur longue *1*, et *false* en *0*.\n\n ````\n ROW str1 = \"2147483648\", str2 = \"2147483648.2\", str3 = \"foo\"\n | EVAL long1 = TO_LONG(str1), long2 = TO_LONG(str2), long3 = TO_LONG(str3)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_lower": "TO_LOWER", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_lower.markdown": "\n\n ### TO_LOWER\n Renvoie une nouvelle chaîne représentant la chaîne d'entrée convertie en minuscules.\n\n ````\n ROW message = \"Some Text\"\n | EVAL message_lower = TO_LOWER(message)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_radians": "TO_RADIANS", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_radians.markdown": "\n\n ### TO_RADIANS\n Convertit un nombre en degrés en radians.\n\n ````\n ROW deg = [90.0, 180.0, 270.0]\n | EVAL rad = TO_RADIANS(deg)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_string": "TO_STRING", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_string.markdown": "\n\n ### TO_STRING\n Convertit une valeur d'entrée en une chaîne.\n\n ````\n ROW a=10\n | EVAL j = TO_STRING(a)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_unsigned_long": "TO_UNSIGNED_LONG", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_unsigned_long.markdown": "\n\n ### TO_UNSIGNED_LONG\n Convertit une valeur d'entrée en une valeur longue non signée. Si le paramètre d'entrée est de type date,\n sa valeur sera interprétée en millisecondes depuis l'heure Unix, convertie en valeur longue non signée.\n Le booléen *true* sera converti en valeur longue non signée *1*, et *false* en *0*.\n\n ````\n ROW str1 = \"2147483648\", str2 = \"2147483648.2\", str3 = \"foo\"\n | EVAL long1 = TO_UNSIGNED_LONG(str1), long2 = TO_ULONG(str2), long3 = TO_UL(str3)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_upper": "TO_UPPER", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_upper.markdown": "\n\n ### TO_UPPER\n Renvoie une nouvelle chaîne représentant la chaîne d'entrée convertie en majuscules.\n\n ````\n ROW message = \"Some Text\"\n | EVAL message_upper = TO_UPPER(message)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_version": "TO_VERSION", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_version.markdown": "\n\n ### TO_VERSION\n Convertit une chaîne d'entrée en une valeur de version.\n\n ````\n ROW v = TO_VERSION(\"1.2.3\")\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.trim": "TRIM", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.trim.markdown": "\n\n ### TRIM\n Supprime les espaces de début et de fin d'une chaîne.\n\n ````\n ROW message = \" some text \", color = \" red \"\n | EVAL message = TRIM(message)\n | EVAL color = TRIM(color)\n ````\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.valuesFunction": "VALEURS", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.valuesFunction.markdown": "### VALEURS\n\n**AVERTISSEMENT : N’utilisez pas `VALUES` dans les environnements de production. Cette fonctionnalité est en version d'évaluation technique et pourra être modifiée ou supprimée dans une future version. Elastic s'efforcera de corriger tout problème éventuel, mais les fonctionnalités des versions d'évaluation technique ne sont pas soumises aux accords de niveau de service (SLA) d'assistance des fonctionnalités officielles en disponibilité générale.**\n\nRenvoie toutes les valeurs d’un groupe dans un champ multivalué. L'ordre des valeurs renvoyées n'est pas garanti. Si vous avez besoin que les valeurs renvoyées soient dans l'ordre, utilisez `MV_SORT`.\n\nAccepte une expression de n'importe quel type, sauf `geo_point`, `cartesian_point`, `geo_shape` ou `cartesian_shape`.\n\n\nExemple :\n\n````\n FROM employees\n| EVAL first_letter = SUBSTRING(first_name, 0, 1)\n| STATS first_name=MV_SORT(VALUES(first_name)) BY first_letter\n| SORT first_letter\n````\n\n> _**AVERTISSEMENT :** Ceci peut utiliser une quantité importante de mémoire et ES|QL ne développe pas encore les agrégations au-delà de la mémoire. Cette agrégation fonctionnera donc jusqu'à ce qu'elle soit utilisée pour collecter plus de valeurs que la mémoire ne peut en contenir. Lorsque le nombre de valeurs collectées est trop élevé, la requête échoue avec un message d'erreur de type [Circuit Breaker Error](https://www.elastic.co/guide/en/elasticsearch/reference/current/circuit-breaker-errors.html)._\n\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.where": "WHERE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.where.markdown": "### WHERE\nUtilisez `WHERE` afin d'obtenir un tableau qui comprend toutes les lignes du tableau d'entrée pour lesquelles la condition fournie est évaluée à `true` :\n \n````\nFROM employees\n| KEEP first_name, last_name, still_hired\n| WHERE still_hired == true\n````\n\n#### Opérateurs\n\nPour obtenir un aperçu des opérateurs pris en charge, consultez la section **Opérateurs**.\n\n#### Fonctions\n`WHERE` prend en charge diverses fonctions de calcul des valeurs. Pour en savoir plus, consultez la section **Fonctions**.\n ", + "languageDocumentationPopover.documentationESQL.abs": "ABS", + "languageDocumentationPopover.documentationESQL.abs.markdown": "\n\n ### ABS\n Renvoie la valeur absolue.\n\n ````\n Numéro ROW = -1.0 \n | EVAL abs_number = ABS(number)\n ````\n ", + "languageDocumentationPopover.documentationESQL.acos": "ACOS", + "languageDocumentationPopover.documentationESQL.acos.markdown": "\n\n ### ACOS\n Renvoie l'arc cosinus de `n` sous forme d'angle, exprimé en radians.\n\n ````\n ROW a=.9\n | EVAL acos=ACOS(a)\n ````\n ", + "languageDocumentationPopover.documentationESQL.asin": "ASIN", + "languageDocumentationPopover.documentationESQL.asin.markdown": "\n\n ### ASIN\n Renvoie l'arc sinus de l'entrée\n expression numérique sous forme d'angle, exprimée en radians.\n\n ````\n ROW a=.9\n | EVAL asin=ASIN(a)\n ````\n ", + "languageDocumentationPopover.documentationESQL.atan": "ATAN", + "languageDocumentationPopover.documentationESQL.atan.markdown": "\n\n ### ATAN\n Renvoie l'arc tangente de l'entrée\n expression numérique sous forme d'angle, exprimée en radians.\n\n ````\n ROW a=.12.9\n | EVAL atan=ATAN(a)\n ````\n ", + "languageDocumentationPopover.documentationESQL.atan2": "ATAN2", + "languageDocumentationPopover.documentationESQL.atan2.markdown": "\n\n ### ATAN2\n L'angle entre l'axe positif des x et le rayon allant de\n l'origine au point (x , y) dans le plan cartésien, exprimée en radians.\n\n ````\n ROW y=12.9, x=.6\n | EVAL atan2=ATAN2(y, x)\n ````\n ", + "languageDocumentationPopover.documentationESQL.autoBucketFunction": "COMPARTIMENT", + "languageDocumentationPopover.documentationESQL.autoBucketFunction.markdown": "### COMPARTIMENT\nCréer des groupes de valeurs, des compartiments (\"buckets\"), à partir d'une entrée d'un numéro ou d'un horodatage. La taille des compartiments peut être fournie directement ou choisie selon une plage de valeurs et de décompte recommandée.\n\n`BUCKET` a deux modes de fonctionnement : \n\n1. Dans lequel la taille du compartiment est calculée selon la recommandation de décompte d'un compartiment (quatre paramètres) et une plage.\n2. Dans lequel la taille du compartiment est fournie directement (deux paramètres).\n\nAvec un nombre cible de compartiments, le début d'une plage et la fin d'une plage, `BUCKET` choisit une taille de compartiment appropriée afin de générer le nombre cible de compartiments ou moins.\n\nPar exemple, demander jusqu'à 20 compartiments pour une année organisera les données en intervalles mensuels :\n\n````\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT hire_date\n````\n\n**REMARQUE** : Le but n'est pas de fournir le nombre précis de compartiments, mais plutôt de sélectionner une plage qui fournit, tout au plus, le nombre cible de compartiments.\n\nVous pouvez combiner `BUCKET` avec une agrégation pour créer un histogramme :\n\n````\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_month = COUNT(*) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT month\n````\n\n**REMARQUE** : `BUCKET` ne crée pas de compartiments qui ne correspondent à aucun document. C'est pourquoi, dans l'exemple précédent, il manque 1985-03-01 ainsi que d'autres dates.\n\nDemander d'autres compartiments peut résulter en une plage réduite. Par exemple, demander jusqu'à 100 compartiments en un an résulte en des compartiments hebdomadaires :\n\n````\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 100, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT week\n````\n\n**REMARQUE** : `AUTO_BUCKET` ne filtre aucune ligne. Il n'utilise que la plage fournie pour choisir une taille de compartiment appropriée. Pour les lignes dont la valeur se situe en dehors de la plage, il renvoie une valeur de compartiment qui correspond à un compartiment situé en dehors de la plage. Associez `BUCKET` à `WHERE` pour filtrer les lignes.\n\nSi la taille de compartiment désirée est connue à l'avance, fournissez-la comme second argument, en ignorant la plage :\n\n````\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 1 week)\n| SORT week\n````\n\n**REMARQUE** : Lorsque vous fournissez la taille du compartiment comme second argument, ce dernier doit être une période temporelle ou une durée.\n\n`BUCKET` peut également être utilisé pour des champs numériques. Par exemple, pour créer un histogramme de salaire :\n\n````\nFROM employees\n| STATS COUNT(*) by bs = BUCKET(salary, 20, 25324, 74999)\n| SORT bs\n````\n\nContrairement à l'exemple précédent qui filtre intentionnellement sur une plage temporelle, vous n'avez pas souvent besoin de filtrer sur une plage numérique. Vous devez trouver les valeurs min et max séparément. ES|QL n'a pas encore de façon aisée d'effectuer cette opération automatiquement.\n\nLa plage peut être ignorée si la taille désirée de compartiment est connue à l'avance. Fournissez-la simplement comme second argument :\n\n````\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS c = COUNT(1) BY b = BUCKET(salary, 5000.)\n| SORT b\n````\n\n**REMARQUE** : Lorsque vous fournissez la taille du compartiment comme second argument, elle doit être de type à **virgule flottante**.\n\nVoici un exemple sur comment créer des compartiments horaires pour les dernières 24 heures, et calculer le nombre d'événements par heure :\n\n````\nFROM sample_data\n| WHERE @timestamp >= NOW() - 1 day and @timestamp < NOW()\n| STATS COUNT(*) BY bucket = BUCKET(@timestamp, 25, NOW() - 1 day, NOW())\n````\n\nVoici un exemple permettant de créer des compartiments mensuels pour l'année 1985, et calculer le salaire moyen par mois d'embauche :\n\n````\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS AVG(salary) BY bucket = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT bucket\n````\n\n`BUCKET` peut être utilisé pour les parties de groupage et d'agrégation de la commande `STATS …​ BY ...`, tant que la partie d'agrégation de la fonction est **référencée par un alias défini dans la partie de groupage**, ou que celle-ci est invoquée avec exactement la même expression.\n\nPar exemple :\n\n````\nFROM employees\n| STATS s1 = b1 + 1, s2 = BUCKET(salary / 1000 + 999, 50.) + 2 BY b1 = BUCKET(salary / 100 + 99, 50.), b2 = BUCKET(salary / 1000 + 999, 50.)\n| SORT b1, b2\n| KEEP s1, b1, s2, b2\n````\n ", + "languageDocumentationPopover.documentationESQL.avgFunction": "AVG", + "languageDocumentationPopover.documentationESQL.avgFunction.markdown": "### AVG\nRenvoie la moyenne d'un champ numérique.\n\n````\nFROM employees\n| STATS AVG(height)\n````\n\nCette expression peut utiliser des fonctions alignées. Par exemple, pour calculer la moyenne sur une colonne multivaluée, il faut d'abord utiliser`MV_AVG` pour faire la moyenne des multiples valeurs par ligne et utiliser le résultat avec la fonction `AVG` :\n\n````\nFROM employees\n| STATS avg_salary_change = AVG(MV_AVG(salary_change))\n````\n ", + "languageDocumentationPopover.documentationESQL.binaryOperators": "Opérateurs binaires", + "languageDocumentationPopover.documentationESQL.binaryOperators.markdown": "### Opérateurs binaires\nLes opérateurs de comparaison binaire suivants sont pris en charge :\n\n* égalité : `==`\n* inégalité : `!=`\n* inférieur à : `<`\n* inférieur ou égal à : `<=`\n* supérieur à : `>`\n* supérieur ou égal à : `>=`\n* ajouter : `+`\n* soustraire : `-`\n* multiplier par : `*`\n* diviser par : `/`\n* module : `%`\n ", + "languageDocumentationPopover.documentationESQL.booleanOperators": "Opérateurs booléens", + "languageDocumentationPopover.documentationESQL.booleanOperators.markdown": "### Opérateurs booléens\nLes opérateurs booléens suivants sont pris en charge :\n\n* `AND`\n* `OR`\n* `NOT`\n ", + "languageDocumentationPopover.documentationESQL.bucket": "COMPARTIMENT", + "languageDocumentationPopover.documentationESQL.bucket.markdown": "\n\n ### COMPARTIMENT\n Créer des groupes de valeurs, des compartiments (\"buckets\"), à partir d'une entrée d'un numéro ou d'un horodatage.\n La taille des compartiments peut être fournie directement ou choisie selon une plage de valeurs et de décompte recommandée.\n\n ````\n FROM employees\n | WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n | STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n | SORT hire_date\n ````\n ", + "languageDocumentationPopover.documentationESQL.case": "CASE", + "languageDocumentationPopover.documentationESQL.case.markdown": "\n\n ### CAS\n Accepte les paires de conditions et de valeurs. La fonction renvoie la valeur qui\n appartient à la première condition étant évaluée comme `true`.\n\n Si le nombre d'arguments est impair, le dernier argument est la valeur par défaut qui est\n renvoyée si aucune condition ne correspond. Si le nombre d'arguments est pair, et\n qu'aucune condition ne correspond, la fonction renvoie `null`.\n\n ````\n FROM employees\n | EVAL type = CASE(\n languages <= 1, \"monolingual\",\n languages <= 2, \"bilingual\",\n \"polyglot\")\n | KEEP emp_no, languages, type\n ````\n ", + "languageDocumentationPopover.documentationESQL.castOperator": "Cast (::)", + "languageDocumentationPopover.documentationESQL.castOperator.markdown": "### CAST (`::`)\nL'opérateur `::` fournit une syntaxe alternative pratique au type de converstion de fonction `TO_`.\n\nExemple :\n````\nROW ver = CONCAT((\"0\"::INT + 1)::STRING, \".2.3\")::VERSION\n````\n ", + "languageDocumentationPopover.documentationESQL.cbrt": "CBRT", + "languageDocumentationPopover.documentationESQL.cbrt.markdown": "\n\n ### CBRT\n Renvoie la racine cubique d'un nombre. La valeur de renvoi est toujours un double, quelle que soit la valeur numérique de l'entrée.\n La racine cubique de l’infini est nulle.\n\n ````\n ROW d = 1000.0\n | EVAL c = cbrt(d)\n ````\n ", + "languageDocumentationPopover.documentationESQL.ceil": "CEIL", + "languageDocumentationPopover.documentationESQL.ceil.markdown": "\n\n ### CEIL\n Arrondir un nombre à l'entier supérieur.\n\n ```\n ROW a=1.8\n | EVAL a=CEIL(a)\n ```\n Remarque : Il s'agit d'un noop pour `long` (y compris non signé) et `integer`. Pour `double`, la fonction choisit la valeur `double` la plus proche de l'entier, de manière similaire à la méthode Math.ceil.\n ", + "languageDocumentationPopover.documentationESQL.cidr_match": "CIDR_MATCH", + "languageDocumentationPopover.documentationESQL.cidr_match.markdown": "\n\n ### CIDR_MATCH\n Renvoie `true` si l'IP fournie est contenue dans l'un des blocs CIDR fournis.\n\n ````\n FROM hosts \n | WHERE CIDR_MATCH(ip1, \"127.0.0.2/32\", \"127.0.0.3/32\") \n | KEEP card, host, ip0, ip1\n ````\n ", + "languageDocumentationPopover.documentationESQL.coalesce": "COALESCE", + "languageDocumentationPopover.documentationESQL.coalesce.markdown": "\n\n ### COALESCE\n Renvoie le premier de ses arguments qui n'est pas nul. Si tous les arguments sont nuls, `null` est renvoyé.\n\n ````\n ROW a=null, b=\"b\"\n | EVAL COALESCE(a, b)\n ````\n ", + "languageDocumentationPopover.documentationESQL.concat": "CONCAT", + "languageDocumentationPopover.documentationESQL.concat.markdown": "\n\n ### CONCAT\n Concatène deux ou plusieurs chaînes.\n\n ```\n FROM employees\n | KEEP first_name, last_name\n | EVAL fullname = CONCAT(first_name, \" \", last_name)\n ````\n ", + "languageDocumentationPopover.documentationESQL.cos": "COS", + "languageDocumentationPopover.documentationESQL.cos.markdown": "\n\n ### COS\n Renvoie le cosinus d'un angle.\n\n ````\n ROW a=1.8 \n | EVAL cos=COS(a)\n ````\n ", + "languageDocumentationPopover.documentationESQL.cosh": "COSH", + "languageDocumentationPopover.documentationESQL.cosh.markdown": "\n\n ### COSH\n Renvoie le cosinus hyperbolique d'un angle.\n\n ````\n ROW a=1.8 \n | EVAL cosh=COSH(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.countDistinctFunction": "COUNT_DISTINCT", + "languageDocumentationPopover.documentationESQL.countDistinctFunction.markdown": "### COUNT_DISTINCT\nDécompte le nombre approximatif de valeurs distinctes.\n\n````\nFROM hosts\n| STATS COUNT_DISTINCT(ip0), COUNT_DISTINCT(ip1)\n```\n\nLa fonction `COUNT_DISTINCT` est approximative, basée sur l'algorithme HyperLogLog++. Pour en savoir plus, consultez la [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-cardinality-aggregation.html#_counts_are_approximate). La précision est configurable à l'aide d'un deuxième paramètre facultatif. La valeur maximale compatible est 40000. Les seuils supérieurs à ce nombre auront le même effet qu'un seuil de 40000. La valeur par défaut est 3000.\n\n````\nFROM hosts\n| STATS COUNT_DISTINCT(ip0, 80000), COUNT_DISTINCT(ip1, 5)\n````\n\nCette expression peut utiliser des fonctions alignées. Cet exemple divise une chaîne en plusieurs valeurs à l'aide de la fonction `SPLIT` et compte les valeurs uniques :\n\n````\nROW words=\"foo;bar;baz;qux;quux;foo\"\n| STATS distinct_word_count = COUNT_DISTINCT(SPLIT(words, \";\"))\n````\n ", + "languageDocumentationPopover.documentationESQL.countFunction": "COUNT", + "languageDocumentationPopover.documentationESQL.countFunction.markdown": "### COUNT\nRenvoie le nombre total de valeurs en entrée.\n\n````\nFROM employees\n| STATS COUNT(height)\n````\n\nPeut prendre n'importe quel type de champ en entrée.\n\nPour compter le nombre de lignes, utiliser `COUNT()` ou `COUNT(*)` :\n\n````\nFROM employees\n| STATS count = COUNT(*) BY languages\n| SORT languages DESC\n````\n\nCette expression peut utiliser des fonctions alignées. Cet exemple divise une chaîne en plusieurs valeurs à l'aide de la fonction `SPLIT` et compte les valeurs :\n\n````\nROW words=\"foo;bar;baz;qux;quux;foo\"\n| STATS word_count = COUNT(SPLIT(words, \";\"))\n````\n ", + "languageDocumentationPopover.documentationESQL.date_diff": "DATE_DIFF", + "languageDocumentationPopover.documentationESQL.date_diff.markdown": "\n\n ### DATE_DIFF\n Soustrait le `startTimestamp` du `endTimestamp` et renvoie la différence en multiples `d'unité`.\n Si `startTimestamp` est postérieur à `endTimestamp`, des valeurs négatives sont renvoyées.\n\n ````\n ROW date1 = TO_DATETIME(\"2023-12-02T11:00:00.000Z\"), date2 = TO_DATETIME(\"2023-12-02T11:00:00.001Z\")\n | EVAL dd_ms = DATE_DIFF(\"microseconds\", date1, date2)\n ````\n ", + "languageDocumentationPopover.documentationESQL.date_extract": "DATE_EXTRACT", + "languageDocumentationPopover.documentationESQL.date_extract.markdown": "\n\n ### DATE_EXTRACT\n Extrait des parties d'une date, telles que l'année, le mois, le jour, l'heure.\n\n ````\n ROW date = DATE_PARSE(\"yyyy-MM-dd\", \"2022-05-06\")\n | EVAL year = DATE_EXTRACT(\"year\", date)\n ````\n ", + "languageDocumentationPopover.documentationESQL.date_format": "DATE_FORMAT", + "languageDocumentationPopover.documentationESQL.date_format.markdown": "\n\n ### DATE_FORMAT\n Renvoie une représentation sous forme de chaîne d'une date dans le format fourni.\n\n ````\n FROM employees\n | KEEP first_name, last_name, hire_date\n | EVAL hired = DATE_FORMAT(\"YYYY-MM-dd\", hire_date)\n ````\n ", + "languageDocumentationPopover.documentationESQL.date_parse": "DATE_PARSE", + "languageDocumentationPopover.documentationESQL.date_parse.markdown": "\n\n ### DATE_PARSE\n Renvoie une date en analysant le deuxième argument selon le format spécifié dans le premier argument.\n\n ````\n ROW date_string = \"2022-05-06\"\n | EVAL date = DATE_PARSE(\"yyyy-MM-dd\", date_string)\n ````\n ", + "languageDocumentationPopover.documentationESQL.date_trunc": "DATE_TRUNC", + "languageDocumentationPopover.documentationESQL.date_trunc.markdown": "\n\n ### DATE_TRUNC\n Arrondit une date à l'intervalle le plus proche.\n\n ```\n FROM employees\n | KEEP first_name, last_name, hire_date\n | EVAL year_hired = DATE_TRUNC(1 year, hire_date)\n ````\n ", + "languageDocumentationPopover.documentationESQL.dissect": "DISSECT", + "languageDocumentationPopover.documentationESQL.dissect.markdown": "### DISSECT\n`DISSECT` vous permet d'extraire des données structurées d'une chaîne. `DISSECT` compare la chaîne à un modèle basé sur les délimiteurs, et extrait les clés indiquées en tant que colonnes.\n\nPour obtenir la syntaxe des modèles \"dissect\", consultez [la documentation relative au processeur \"dissect\"](https://www.elastic.co/guide/en/elasticsearch/reference/current/dissect-processor.html).\n\n```\nROW a = \"1953-01-23T12:15:00Z - some text - 127.0.0.1\"\n| DISSECT a \"%'{Y}-%{M}-%{D}T%{h}:%{m}:%{s}Z - %{msg} - %{ip}'\"\n```` ", + "languageDocumentationPopover.documentationESQL.drop": "DROP", + "languageDocumentationPopover.documentationESQL.drop.markdown": "### DROP\nAfin de supprimer certaines colonnes d'un tableau, utilisez `DROP` :\n \n```\nFROM employees\n| DROP height\n```\n\nPlutôt que de spécifier chaque colonne par son nom, vous pouvez utiliser des caractères génériques pour supprimer toutes les colonnes dont le nom correspond à un modèle :\n\n```\nFROM employees\n| DROP height*\n````\n ", + "languageDocumentationPopover.documentationESQL.e": "E", + "languageDocumentationPopover.documentationESQL.e.markdown": "\n\n ### E\n Retourne le nombre d'Euler.\n\n ````\n ROW E()\n ````\n ", + "languageDocumentationPopover.documentationESQL.ends_with": "ENDS_WITH", + "languageDocumentationPopover.documentationESQL.ends_with.markdown": "\n\n ### ENDS_WITH\n Renvoie une valeur booléenne qui indique si une chaîne de mots-clés se termine par une autre chaîne.\n\n ````\n FROM employees\n | KEEP last_name\n | EVAL ln_E = ENDS_WITH(last_name, \"d\")\n ````\n ", + "languageDocumentationPopover.documentationESQL.enrich": "ENRICH", + "languageDocumentationPopover.documentationESQL.enrich.markdown": "### ENRICH\nVous pouvez utiliser `ENRICH` pour ajouter les données de vos index existants aux enregistrements entrants. Une fonction similaire à l'[enrichissement par ingestion](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html), mais qui fonctionne au moment de la requête.\n\n```\nROW language_code = \"1\"\n| ENRICH languages_policy\n```\n\n`ENRICH` requiert l'exécution d'une [politique d'enrichissement](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html#enrich-policy). La politique d'enrichissement définit un champ de correspondance (un champ clé) et un ensemble de champs d'enrichissement.\n\n`ENRICH` recherche les enregistrements dans l'[index d'enrichissement](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html#enrich-index) en se basant sur la valeur du champ de correspondance. La clé de correspondance dans l'ensemble de données d'entrée peut être définie en utilisant `ON `. Si elle n'est pas spécifiée, la correspondance sera effectuée sur un champ portant le même nom que le champ de correspondance défini dans la politique d'enrichissement.\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a\n```\n\nVous pouvez indiquer quels attributs (parmi ceux définis comme champs d'enrichissement dans la politique) doivent être ajoutés au résultat, en utilisant la syntaxe `WITH , ...`.\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a WITH language_name\n```\n\nLes attributs peuvent également être renommés à l'aide de la syntaxe `WITH new_name=`\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a WITH name = language_name\n````\n\nPar défaut (si aucun `WITH` n'est défini), `ENRICH` ajoute au résultat tous les champs d'enrichissement définis dans la politique d'enrichissement.\n\nEn cas de collision de noms, les champs nouvellement créés remplacent les champs existants.\n ", + "languageDocumentationPopover.documentationESQL.eval": "EVAL", + "languageDocumentationPopover.documentationESQL.eval.markdown": "### EVAL\n`EVAL` permet d'ajouter des colonnes :\n\n````\nFROM employees\n| KEEP first_name, last_name, height\n| EVAL height_feet = height * 3.281, height_cm = height * 100\n````\n\nSi la colonne indiquée existe déjà, la colonne existante sera supprimée et la nouvelle colonne sera ajoutée au tableau :\n\n````\nFROM employees\n| KEEP first_name, last_name, height\n| EVAL height = height * 3.281\n````\n\n#### Fonctions\n`EVAL` prend en charge diverses fonctions de calcul des valeurs. Pour en savoir plus, consultez les fonctions.\n ", + "languageDocumentationPopover.documentationESQL.floor": "FLOOR", + "languageDocumentationPopover.documentationESQL.floor.markdown": "\n\n ### FLOOR\n Arrondir un nombre à l'entier inférieur.\n\n ````\n ROW a=1.8\n | EVAL a=FLOOR(a)\n ````\n Remarque : Il s'agit d'un noop pour `long` (y compris non signé) et `integer`.\n Pour `double`, la fonction choisit la valeur `double` la plus proche de l'entier,\n de manière similaire à Math.floor.\n ", + "languageDocumentationPopover.documentationESQL.from": "FROM", + "languageDocumentationPopover.documentationESQL.from_base64": "FROM_BASE64", + "languageDocumentationPopover.documentationESQL.from_base64.markdown": "\n\n ### FROM_BASE64\n Décodez une chaîne base64.\n\n ````\n row a = \"ZWxhc3RpYw==\" \n | eval d = from_base64(a)\n ````\n ", + "languageDocumentationPopover.documentationESQL.from.markdown": "### FROM\nLa commande source `FROM` renvoie un tableau contenant jusqu'à 10 000 documents issus d'un flux de données, d'un index ou d'un alias. Chaque ligne du tableau obtenu correspond à un document. Chaque colonne correspond à un champ et est accessible par le nom de ce champ.\n\n````\nFROM employees\n````\n\nVous pouvez utiliser des [calculs impliquant des dates](https://www.elastic.co/guide/en/elasticsearch/reference/current/api-conventions.html#api-date-math-index-names) pour désigner les indices, les alias et les flux de données. Cela peut s'avérer utile pour les données temporelles.\n\nUtilisez des listes séparées par des virgules ou des caractères génériques pour rechercher plusieurs flux de données, indices ou alias :\n\n````\nFROM employees-00001,employees-*\n````\n\n#### Métadonnées\n\nES|QL peut accéder aux champs de métadonnées suivants :\n\n* `_index` : l'index auquel appartient le document. Le champ est du type `keyword`.\n* `_id` : l'identifiant du document source. Le champ est du type `keyword`.\n* `_id` : la version du document source. Le champ est du type `long`.\n\nUtilisez la directive `METADATA` pour activer les champs de métadonnées :\n\n````\nFROM index [METADATA _index, _id]\n````\n\nLes champs de métadonnées ne sont disponibles que si la source des données est un index. Par conséquent, `FROM` est la seule commande source qui prend en charge la directive `METADATA`.\n\nUne fois activés, les champs sont disponibles pour les commandes de traitement suivantes, tout comme les autres champs de l'index :\n\n````\nFROM ul_logs, apps [METADATA _index, _version]\n| WHERE id IN (13, 14) AND _version == 1\n| EVAL key = CONCAT(_index, \"_\", TO_STR(id))\n| SORT id, _index\n| KEEP id, _index, _version, key\n````\n\nDe même, comme pour les champs d'index, une fois l'agrégation effectuée, un champ de métadonnées ne sera plus accessible aux commandes suivantes, sauf s'il est utilisé comme champ de regroupement :\n\n````\nFROM employees [METADATA _index, _id]\n| STATS max = MAX(emp_no) BY _index\n````\n ", + "languageDocumentationPopover.documentationESQL.greatest": "GREATEST", + "languageDocumentationPopover.documentationESQL.greatest.markdown": "\n\n ### GREATEST\n Renvoie la valeur maximale de plusieurs colonnes. Similaire à `MV_MAX`\n sauf que ceci est destiné à une exécution sur plusieurs colonnes à la fois.\n\n ````\n ROW a = 10, b = 20\n | EVAL g = GREATEST(a, b)\n ````\n Remarque : Lorsque cette fonction est exécutée sur les champs `keyword` ou `text`, elle renvoie la dernière chaîne dans l'ordre alphabétique. Lorsqu'elle est exécutée sur des colonnes `boolean`, elle renvoie `true` si l'une des valeurs l'est.\n ", + "languageDocumentationPopover.documentationESQL.grok": "GROK", + "languageDocumentationPopover.documentationESQL.grok.markdown": "### GROK\n`GROK` vous permet d'extraire des données structurées d'une chaîne. `GROK` compare la chaîne à des modèles, sur la base d’expressions régulières, et extrait les modèles indiqués en tant que colonnes.\n\nPour obtenir la syntaxe des modèles \"grok\", consultez [la documentation relative au processeur \"grok\"](https://www.elastic.co/guide/en/elasticsearch/reference/current/grok-processor.html).\n\n````\nROW a = \"12 15.5 15.6 true\"\n| GROK a \"%'{NUMBER:b:int}' %'{NUMBER:c:float}' %'{NUMBER:d:double}' %'{WORD:e:boolean}'\"\n````\n ", + "languageDocumentationPopover.documentationESQL.inOperator": "IN", + "languageDocumentationPopover.documentationESQL.inOperator.markdown": "### IN\nL'opérateur `IN` permet de tester si un champ ou une expression est égal à un élément d'une liste de littéraux, de champs ou d'expressions :\n\n````\nROW a = 1, b = 4, c = 3\n| WHERE c-a IN (3, b / 2, a)\n````\n ", + "languageDocumentationPopover.documentationESQL.ip_prefix": "IP_PREFIX", + "languageDocumentationPopover.documentationESQL.ip_prefix.markdown": "\n\n ### IP_PREFIX\n Tronque une adresse IP à une longueur de préfixe donnée.\n\n ````\n row ip4 = to_ip(\"1.2.3.4\"), ip6 = to_ip(\"fe80::cae2:65ff:fece:feb9\")\n | eval ip4_prefix = ip_prefix(ip4, 24, 0), ip6_prefix = ip_prefix(ip6, 0, 112);\n ````\n ", + "languageDocumentationPopover.documentationESQL.keep": "KEEP", + "languageDocumentationPopover.documentationESQL.keep.markdown": "### KEEP\nLa commande `KEEP` permet de définir les colonnes qui seront renvoyées et l'ordre dans lequel elles le seront.\n\nPour limiter les colonnes retournées, utilisez une liste de noms de colonnes séparés par des virgules. Les colonnes sont renvoyées dans l'ordre indiqué :\n \n````\nFROM employees\n| KEEP first_name, last_name, height\n````\n\nPlutôt que de spécifier chaque colonne par son nom, vous pouvez utiliser des caractères génériques pour renvoyer toutes les colonnes dont le nom correspond à un modèle :\n\n````\nFROM employees\n| KEEP h*\n````\n\nLe caractère générique de l'astérisque (\"*\") placé de manière isolée transpose l'ensemble des colonnes qui ne correspondent pas aux autres arguments. La requête suivante renverra en premier lieu toutes les colonnes dont le nom commence par un h, puis toutes les autres colonnes :\n\n````\nFROM employees\n| KEEP h*, *\n````\n ", + "languageDocumentationPopover.documentationESQL.least": "LEAST", + "languageDocumentationPopover.documentationESQL.least.markdown": "\n\n ### LEAST\n Renvoie la valeur minimale de plusieurs colonnes. Cette fonction est similaire à `MV_MIN`. Toutefois, elle est destinée à être exécutée sur plusieurs colonnes à la fois.\n\n ````\n ROW a = 10, b = 20\n | EVAL l = LEAST(a, b)\n ````\n ", + "languageDocumentationPopover.documentationESQL.left": "LEFT", + "languageDocumentationPopover.documentationESQL.left.markdown": "\n\n ### LEFT\n Renvoie la sous-chaîne qui extrait la \"longueur\" des caractères de la \"chaîne\" en partant de la gauche.\n\n ````\n FROM employees\n | KEEP last_name\n | EVAL left = LEFT(last_name, 3)\n | SORT last_name ASC\n | LIMIT 5\n ````\n ", + "languageDocumentationPopover.documentationESQL.length": "LENGHT", + "languageDocumentationPopover.documentationESQL.length.markdown": "\n\n ### LENGTH\n Renvoie la longueur des caractères d'une chaîne.\n\n ````\n FROM employees\n | KEEP first_name, last_name\n | EVAL fn_length = LENGTH(first_name)\n ````\n ", + "languageDocumentationPopover.documentationESQL.limit": "LIMIT", + "languageDocumentationPopover.documentationESQL.limit.markdown": "### LIMIT\nLa commande de traitement `LIMIT` permet de restreindre le nombre de lignes :\n \n````\nFROM employees\n| LIMIT 5\n````\n ", + "languageDocumentationPopover.documentationESQL.locate": "LOCATE", + "languageDocumentationPopover.documentationESQL.locate.markdown": "\n\n ### LOCATE\n Renvoie un entier qui indique la position d'une sous-chaîne de mots-clés dans une autre chaîne\n\n ````\n row a = \"hello\"\n | eval a_ll = locate(a, \"ll\")\n ````\n ", + "languageDocumentationPopover.documentationESQL.log": "LOG", + "languageDocumentationPopover.documentationESQL.log.markdown": "\n\n ### LOG\n Renvoie le logarithme d'une valeur dans une base. La valeur de renvoi est toujours un double, quelle que soit la valeur numérique de l'entrée.\n\n Les journaux de zéros, de nombres négatifs et de base 1 renvoient `null` ainsi qu'un avertissement.\n\n ````\n ROW base = 2.0, value = 8.0\n | EVAL s = LOG(base, value)\n ````\n ", + "languageDocumentationPopover.documentationESQL.log10": "LOG10", + "languageDocumentationPopover.documentationESQL.log10.markdown": "\n\n ### LOG10\n Renvoie le logarithme d'une valeur en base 10. La valeur de renvoi est toujours un double, quelle que soit la valeur numérique de l'entrée.\n\n Les logs de 0 et de nombres négatifs renvoient `null` ainsi qu'un avertissement.\n\n ````\n ROW d = 1000.0 \n | EVAL s = LOG10(d)\n ````\n ", + "languageDocumentationPopover.documentationESQL.ltrim": "LTRIM", + "languageDocumentationPopover.documentationESQL.ltrim.markdown": "\n\n ### LTRIM\n Retire les espaces au début des chaînes.\n\n ````\n ROW message = \" some text \", color = \" red \"\n | EVAL message = LTRIM(message)\n | EVAL color = LTRIM(color)\n | EVAL message = CONCAT(\"'\", message, \"'\")\n | EVAL color = CONCAT(\"'\", color, \"'\")\n ````\n ", + "languageDocumentationPopover.documentationESQL.markdown": "## ES|QL\n\nUne requête ES|QL (langage de requête Elasticsearch) se compose d'une série de commandes, séparées par une barre verticale : `|`. Chaque requête commence par une **commande source**, qui produit un tableau, habituellement avec des données issues d'Elasticsearch. \n\nUne commande source peut être suivie d'une ou plusieurs **commandes de traitement**. Les commandes de traitement peuvent modifier le tableau de sortie de la commande précédente en ajoutant, supprimant ou modifiant les lignes et les colonnes.\n\n````\nsource-command\n| processing-command1\n| processing-command2\n````\n\nLe résultat d'une requête est le tableau produit par la dernière commande de traitement. \n ", + "languageDocumentationPopover.documentationESQL.maxFunction": "MAX", + "languageDocumentationPopover.documentationESQL.maxFunction.markdown": "### MAX\nRenvoie la valeur maximale d'une expression numérique.\n\n````\nFROM employees\n| STATS MAX(languages)\n````\n\nCette expression peut utiliser des fonctions alignées. Par exemple, pour calculer le maximum sur une moyenne d'une colonne multivaluée, il faut utiliser `MV_AVG` pour faire la moyenne des multiples valeurs par ligne et utiliser le résultat avec la fonction `MAX` :\n\n````\nFROM employees\n| STATS max_avg_salary_change = MAX(MV_AVG(salary_change))\n````\n ", + "languageDocumentationPopover.documentationESQL.medianAbsoluteDeviationFunction": "MEDIAN_ABSOLUTE_DEVIATION", + "languageDocumentationPopover.documentationESQL.medianAbsoluteDeviationFunction.markdown": "### MEDIAN_ABSOLUTE_DEVIATION\nRenvoie l'écart absolu médian, une mesure de la variabilité. Il s'agit d'un indicateur robuste, ce qui signifie qu'il est utile pour décrire des données qui peuvent présenter des valeurs aberrantes ou ne pas être normalement distribuées. Pour de telles données, il peut être plus descriptif que l'écart-type.\n\nIl est calculé comme la médiane de chaque écart de point de données par rapport à la médiane de l'ensemble de l'échantillon. Autrement dit, pour une variable aléatoire X, l'écart absolu médian est `median(|median(X) - X|)`.\n\n````\nFROM employees\n| STATS MEDIAN(salary), MEDIAN_ABSOLUTE_DEVIATION(salary)\n````\n\nREMARQUE : Comme la fonction `PERCENTILE`, la fonction `MEDIAN_ABSOLUTE_DEVIATION` est généralement approximative, et basée sur l'algorithme TDigest. Elle est également non déterministe. Cela signifie que vous pouvez obtenir des résultats légèrement différents en utilisant les mêmes données.\n\nCette expression peut utiliser des fonctions alignées. Par exemple, pour calculer l'écart absolu médian des valeurs maximales d'une colonne multivaluée, il faut d'abord utiliser `MV_MAX` pour obtenir la valeur maximale par ligne, et utiliser le résultat avec la fonction `MEDIAN_ABSOLUTE_DEVIATION` :\n\n````\nFROM employees\n| STATS m_a_d_max_salary_change = MEDIAN_ABSOLUTE_DEVIATION(MV_MAX(salary_change))\n````\n\n", + "languageDocumentationPopover.documentationESQL.medianFunction": "MEDIAN", + "languageDocumentationPopover.documentationESQL.medianFunction.markdown": "### MEDIAN\nRenvoie la valeur qui est supérieure à la moitié de toutes les valeurs et inférieure à la moitié de toutes les valeurs, également connue sous le nom de `PERCENTILE` 50 %.\n\n**REMARQUE :** Comme la fonction `PERCENTILE`, la fonction `MEDIAN` est généralement approximative et basée sur l'algorithme TDigest.\n\n**AVERTISSEMENT :** `MEDIAN` est également [non déterministe](https://en.wikipedia.org/wiki/Nondeterministic_algorithm). Cela signifie que vous pouvez obtenir des résultats légèrement différents en utilisant les mêmes données.\n\nExemple :\n\n````\nFROM employees\n| STATS MEDIAN(salary), PERCENTILE(salary, 50)\n````\n\nCette expression peut utiliser des fonctions alignées. Par exemple, pour calculer le médian des valeurs maximales d'une colonne multivaluée, il faut d'abord utiliser `MV_MAX` pour obtenir la valeur maximale par ligne et utiliser le résultat avec la fonction `MEDIAN` :\n\n````\nFROM employees\n| STATS median_max_salary_change = MEDIAN(MV_MAX(salary_change))\n````\n ", + "languageDocumentationPopover.documentationESQL.minFunction": "MIN", + "languageDocumentationPopover.documentationESQL.minFunction.markdown": "### MIN\nRenvoie la valeur minimale d'un champ numérique.\n\n````\nFROM employees\n| STATS MIN(languages)\n````\n\nCette expression peut utiliser des fonctions alignées. Par exemple, pour calculer le minimum sur une moyenne d'une colonne multivaluée, il faut utiliser `MV_AVG` pour faire la moyenne des valeurs multiples par ligne et utiliser le résultat avec la fonction `MIN` :\n\n````\nFROM employees\n| STATS min_avg_salary_change = MIN(MV_AVG(salary_change))\n````\n ", + "languageDocumentationPopover.documentationESQL.mv_append": "MV_APPEND", + "languageDocumentationPopover.documentationESQL.mv_append.markdown": "\n\n ### MV_APPEND\n Concatène les valeurs de deux champs à valeurs multiples.\n\n ", + "languageDocumentationPopover.documentationESQL.mv_avg": "MV_AVG", + "languageDocumentationPopover.documentationESQL.mv_avg.markdown": "\n\n ### MV_AVG\n Convertit un champ multivalué en un champ à valeur unique comprenant la moyenne de toutes les valeurs.\n\n ````\n ROW a=[3, 5, 1, 6]\n | EVAL avg_a = MV_AVG(a)\n ````\n ", + "languageDocumentationPopover.documentationESQL.mv_concat": "MV_CONCAT", + "languageDocumentationPopover.documentationESQL.mv_concat.markdown": "\n\n ### MV_CONCAT\n Convertit une expression de type chaîne multivalué en une colonne à valeur unique comprenant la concaténation de toutes les valeurs, séparées par un délimiteur.\n\n ````\n ROW a=[\"foo\", \"zoo\", \"bar\"]\n | EVAL j = MV_CONCAT(a, \", \")\n ````\n ", + "languageDocumentationPopover.documentationESQL.mv_count": "MV_COUNT", + "languageDocumentationPopover.documentationESQL.mv_count.markdown": "\n\n ### MV_COUNT\n Convertit une expression multivaluée en une colonne à valeur unique comprenant le total du nombre de valeurs.\n\n ````\n ROW a=[\"foo\", \"zoo\", \"bar\"]\n | EVAL count_a = MV_COUNT(a)\n ````\n ", + "languageDocumentationPopover.documentationESQL.mv_dedupe": "MV_DEDUPE", + "languageDocumentationPopover.documentationESQL.mv_dedupe.markdown": "\n\n ### MV_DEDUPE\n Supprime les valeurs en doublon d'un champ multivalué.\n\n ````\n ROW a=[\"foo\", \"foo\", \"bar\", \"foo\"]\n | EVAL dedupe_a = MV_DEDUPE(a)\n ````\n Remarque : la fonction `MV_DEDUPE` est en mesure de trier les valeurs de la colonne, mais ne le fait pas systématiquement.\n ", + "languageDocumentationPopover.documentationESQL.mv_first": "MV_FIRST", + "languageDocumentationPopover.documentationESQL.mv_first.markdown": "\n\n ### MV_FIRST\n Convertit une expression multivaluée en une colonne à valeur unique comprenant la\n première valeur. Ceci est particulièrement utile pour lire une fonction qui émet\n des colonnes multivaluées dans un ordre connu, comme `SPLIT`.\n\n L'ordre dans lequel les champs multivalués sont lus à partir\n du stockage sous-jacent n'est pas garanti. Il est *souvent* ascendant, mais ne vous y\n fiez pas. Si vous avez besoin de la valeur minimale, utilisez `MV_MIN` au lieu de\n `MV_FIRST`. `MV_MIN` comporte des optimisations pour les valeurs triées, il n'y a donc aucun\n avantage en matière de performances pour `MV_FIRST`.\n\n ````\n ROW a=\"foo;bar;baz\"\n | EVAL first_a = MV_FIRST(SPLIT(a, \";\"))\n ````\n ", + "languageDocumentationPopover.documentationESQL.mv_last": "MV_LAST", + "languageDocumentationPopover.documentationESQL.mv_last.markdown": "\n\n ### MV_LAST\n Convertit une expression multivaluée en une colonne à valeur unique comprenant la dernière\n valeur. Ceci est particulièrement utile pour lire une fonction qui émet des champs multivalués\n dans un ordre connu, comme `SPLIT`.\n\n L'ordre dans lequel les champs multivalués sont lus à partir\n du stockage sous-jacent n'est pas garanti. Il est *souvent* ascendant, mais ne vous y\n fiez pas. Si vous avez besoin de la valeur maximale, utilisez `MV_MAX` au lieu de\n `MV_LAST`. `MV_MAX` comporte des optimisations pour les valeurs triées, il n'y a donc aucun\n avantage en matière de performances pour `MV_LAST`.\n\n ````\n ROW a=\"foo;bar;baz\"\n | EVAL last_a = MV_LAST(SPLIT(a, \";\"))\n ````\n ", + "languageDocumentationPopover.documentationESQL.mv_max": "MV_MAX", + "languageDocumentationPopover.documentationESQL.mv_max.markdown": "\n\n ### MV_MAX\n Convertit une expression multivaluée en une colonne à valeur unique comprenant la valeur maximale.\n\n ````\n ROW a=[3, 5, 1]\n | EVAL max_a = MV_MAX(a)\n ````\n ", + "languageDocumentationPopover.documentationESQL.mv_median": "MV_MEDIAN", + "languageDocumentationPopover.documentationESQL.mv_median.markdown": "\n\n ### MV_MEDIAN\n Convertit un champ multivalué en un champ à valeur unique comprenant la valeur médiane.\n\n ````\n ROW a=[3, 5, 1]\n | EVAL median_a = MV_MEDIAN(a)\n ````\n ", + "languageDocumentationPopover.documentationESQL.mv_min": "MV_MIN", + "languageDocumentationPopover.documentationESQL.mv_min.markdown": "\n\n ### MV_MIN\n Convertit une expression multivaluée en une colonne à valeur unique comprenant la valeur minimale.\n\n ````\n ROW a=[2, 1]\n | EVAL min_a = MV_MIN(a)\n ````\n ", + "languageDocumentationPopover.documentationESQL.mv_slice": "MV_SLICE", + "languageDocumentationPopover.documentationESQL.mv_slice.markdown": "\n\n ### MV_SLICE\n Renvoie un sous-ensemble du champ multivalué en utilisant les valeurs d'index de début et de fin.\n\n ````\n row a = [1, 2, 2, 3]\n | eval a1 = mv_slice(a, 1), a2 = mv_slice(a, 2, 3)\n ````\n ", + "languageDocumentationPopover.documentationESQL.mv_sort": "MV_SORT", + "languageDocumentationPopover.documentationESQL.mv_sort.markdown": "\n\n ### MV_SORT\n Trie une expression multivaluée par ordre lexicographique.\n\n ````\n ROW a = [4, 2, -3, 2]\n | EVAL sa = mv_sort(a), sd = mv_sort(a, \"DESC\")\n ````\n ", + "languageDocumentationPopover.documentationESQL.mv_sum": "MV_SUM", + "languageDocumentationPopover.documentationESQL.mv_sum.markdown": "\n\n ### MV_SUM\n Convertit un champ multivalué en un champ à valeur unique comprenant la somme de toutes les valeurs.\n\n ````\n ROW a=[3, 5, 6]\n | EVAL sum_a = MV_SUM(a)\n ````\n ", + "languageDocumentationPopover.documentationESQL.mv_zip": "MV_ZIP", + "languageDocumentationPopover.documentationESQL.mv_zip.markdown": "\n\n ### MV_ZIP\n Combine les valeurs de deux champs multivalués avec un délimiteur qui les relie.\n\n ````\n ROW a = [\"x\", \"y\", \"z\"], b = [\"1\", \"2\"]\n | EVAL c = mv_zip(a, b, \"-\")\n | KEEP a, b, c\n ````\n ", + "languageDocumentationPopover.documentationESQL.mvExpand": "MV_EXPAND", + "languageDocumentationPopover.documentationESQL.mvExpand.markdown": "### MV_EXPAND\nLa commande de traitement `MV_EXPAND` développe les champs multivalués en indiquant une valeur par ligne et en dupliquant les autres champs : \n````\nROW a=[1,2,3], b=\"b\", j=[\"a\",\"b\"]\n| MV_EXPAND a\n````\n ", + "languageDocumentationPopover.documentationESQL.now": "NOW", + "languageDocumentationPopover.documentationESQL.now.markdown": "\n\n ### NOW\n Renvoie la date et l'heure actuelles.\n\n ````\n ROW current_date = NOW()\n ````\n ", + "languageDocumentationPopover.documentationESQL.percentileFunction": "PERCENTILE", + "languageDocumentationPopover.documentationESQL.percentileFunction.markdown": "### PERCENTILE\nValeur à laquelle un certain pourcentage des valeurs observées se produit. Par exemple, le 95e percentile est la valeur qui est supérieure à 95 % des valeurs observées et le 50percentile est la médiane (`MEDIAN`).\n\n````\nFROM employees\n| STATS p0 = PERCENTILE(salary, 0)\n , p50 = PERCENTILE(salary, 50)\n , p99 = PERCENTILE(salary, 99)\n````\n\n**REMARQUE** : La fonction `PERCENTILE` est généralement approximative et basée sur l'algorithme TDigest. \n\n**AVERTISSEMENT :** `PERCENTILE` est aussi [non déterministe](https://en.wikipedia.org/wiki/Nondeterministic_algorithm). Cela signifie que vous pouvez obtenir des résultats légèrement différents en utilisant les mêmes données.\n\nCette expression peut utiliser des fonctions alignées. Par exemple, pour calculer un percentile des valeurs maximales d'une colonne multivaluée, il faut d'abord utiliser `MV_MAX` pour obtenir la valeur maximale par ligne et utiliser le résultat avec la fonction `PERCENTILE` :\n\n````\nFROM employees\n| STATS p80_max_salary_change = PERCENTILE(MV_MAX(salary_change), 80)\n````\n ", + "languageDocumentationPopover.documentationESQL.pi": "PI", + "languageDocumentationPopover.documentationESQL.pi.markdown": "\n\n ### PI\n Renvoie Pi, le rapport entre la circonférence et le diamètre d'un cercle.\n\n ````\n ROW PI()\n ````\n ", + "languageDocumentationPopover.documentationESQL.pow": "POW", + "languageDocumentationPopover.documentationESQL.pow.markdown": "\n\n ### POW\n Renvoie la valeur d’une `base` élevée à la puissance d’un `exposant`.\n\n ````\n ROW base = 2.0, exponent = 2\n | EVAL result = POW(base, exponent)\n ````\n Remarque : Il est toujours possible de dépasser un résultat double ici ; dans ce cas, la valeur `null` sera renvoyée.\n ", + "languageDocumentationPopover.documentationESQL.predicates": "valeurs NULL", + "languageDocumentationPopover.documentationESQL.predicates.markdown": "### Valeurs NULL\nPour une comparaison avec une valeur NULL, utilisez les attributs `IS NULL` et `IS NOT NULL` :\n\n````\nFROM employees\n| WHERE birth_date IS NULL\n| KEEP first_name, last_name\n| SORT first_name\n| LIMIT 3\n````\n\n````\nFROM employees\n| WHERE is_rehired IS NOT NULL\n| STATS count(emp_no)\n````\n ", + "languageDocumentationPopover.documentationESQL.rename": "RENAME", + "languageDocumentationPopover.documentationESQL.rename.markdown": "### RENAME\nUtilisez `RENAME` pour renommer une colonne en utilisant la syntaxe suivante :\n\n````\nRENAME AS \n````\n\nPar exemple :\n\n````\nFROM employees\n| KEEP first_name, last_name, still_hired\n| RENAME still_hired AS employed\n````\n\nSi une colonne portant le nouveau nom existe déjà, elle sera remplacée par la nouvelle colonne.\n\nPlusieurs colonnes peuvent être renommées à l'aide d'une seule commande `RENAME` :\n\n````\nFROM employees\n| KEEP first_name, last_name\n| RENAME first_name AS fn, last_name AS ln\n````\n ", + "languageDocumentationPopover.documentationESQL.repeat": "REPEAT", + "languageDocumentationPopover.documentationESQL.repeat.markdown": "\n\n ### REPEAT\n Renvoie une chaîne construite par la concaténation de la `chaîne` avec elle-même, le `nombre` de fois spécifié.\n\n ````\n ROW a = \"Hello!\"\n | EVAL triple_a = REPEAT(a, 3);\n ````\n ", + "languageDocumentationPopover.documentationESQL.replace": "REPLACE", + "languageDocumentationPopover.documentationESQL.replace.markdown": "\n\n ### REPLACE\n La fonction remplace dans la chaîne `str` toutes les correspondances avec l'expression régulière `regex`\n par la chaîne de remplacement `newStr`.\n\n ````\n ROW str = \"Hello World\"\n | EVAL str = REPLACE(str, \"World\", \"Universe\")\n | KEEP str\n ````\n ", + "languageDocumentationPopover.documentationESQL.right": "RIGHT", + "languageDocumentationPopover.documentationESQL.right.markdown": "\n\n ### RIGHT\n Renvoie la sous-chaîne qui extrait la longueur des caractères de `str` en partant de la droite.\n\n ````\n FROM employees\n | KEEP last_name\n | EVAL right = RIGHT(last_name, 3)\n | SORT last_name ASC\n | LIMIT 5\n ````\n ", + "languageDocumentationPopover.documentationESQL.round": "ROUND", + "languageDocumentationPopover.documentationESQL.round.markdown": "\n\n ### ROUND\n Arrondit un nombre au nombre spécifié de décimales.\n La valeur par défaut est 0, qui renvoie l'entier le plus proche. Si le\n nombre de décimales spécifié est négatif, la fonction arrondit au nombre de décimales à gauche\n de la virgule.\n\n ````\n FROM employees\n | KEEP first_name, last_name, height\n | EVAL height_ft = ROUND(height * 3.281, 1)\n ````\n ", + "languageDocumentationPopover.documentationESQL.row": "ROW", + "languageDocumentationPopover.documentationESQL.row.markdown": "### ROW\nLa commande source `ROW` renvoie une ligne contenant une ou plusieurs colonnes avec les valeurs que vous spécifiez. Cette commande peut s'avérer utile pour les tests.\n \n````\nROW a = 1, b = \"two\", c = null\n````\n\nUtilisez des crochets pour créer des colonnes à valeurs multiples :\n\n````\nROW a = [2, 1]\n````\n\nROW permet d'utiliser des fonctions :\n\n````\nROW a = ROUND(1.23, 0)\n````\n ", + "languageDocumentationPopover.documentationESQL.rtrim": "RTRIM", + "languageDocumentationPopover.documentationESQL.rtrim.markdown": "\n\n ### RTRIM\n Supprime les espaces à la fin des chaînes.\n\n ````\n ROW message = \" some text \", color = \" red \"\n | EVAL message = RTRIM(message)\n | EVAL color = RTRIM(color)\n | EVAL message = CONCAT(\"'\", message, \"'\")\n | EVAL color = CONCAT(\"'\", color, \"'\")\n ````\n ", + "languageDocumentationPopover.documentationESQL.show": "SHOW", + "languageDocumentationPopover.documentationESQL.show.markdown": "### SHOW\nLa commande source `SHOW ` renvoie des informations sur le déploiement et ses capacités :\n\n* Utilisez `SHOW INFO` pour renvoyer la version du déploiement, la date de compilation et le hachage.\n* Utilisez `SHOW FUNCTIONS` pour renvoyer une liste de toutes les fonctions prises en charge et un résumé de chaque fonction.\n ", + "languageDocumentationPopover.documentationESQL.signum": "SIGNUM", + "languageDocumentationPopover.documentationESQL.signum.markdown": "\n\n ### SIGNUM\n Renvoie le signe du nombre donné.\n Il renvoie `-1` pour les nombres négatifs, `0` pour `0` et `1` pour les nombres positifs.\n\n ````\n ROW d = 100.0\n | EVAL s = SIGNUM(d)\n ````\n ", + "languageDocumentationPopover.documentationESQL.sin": "SIN", + "languageDocumentationPopover.documentationESQL.sin.markdown": "\n\n ### SIN\n Renvoie la fonction trigonométrique sinusoïdale d'un angle.\n\n ````\n ROW a=1.8 \n | EVAL sin=SIN(a)\n ````\n ", + "languageDocumentationPopover.documentationESQL.sinh": "SINH", + "languageDocumentationPopover.documentationESQL.sinh.markdown": "\n\n ### SINH\n Renvoie le sinus hyperbolique d'un angle.\n\n ````\n ROW a=1.8 \n | EVAL sinh=SINH(a)\n ````\n ", + "languageDocumentationPopover.documentationESQL.sort": "SORT", + "languageDocumentationPopover.documentationESQL.sort.markdown": "### SORT\nUtilisez la commande `SORT` pour trier les lignes sur un ou plusieurs champs :\n\n````\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height\n````\n\nL'ordre de tri par défaut est croissant. Définissez un ordre de tri explicite en utilisant `ASC` ou `DESC` :\n\n````\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height DESC\n````\n\nSi deux lignes disposent de la même clé de tri, l'ordre original sera préservé. Vous pouvez ajouter des expressions de tri pour départager les deux lignes :\n\n````\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height DESC, first_name ASC\n````\n\n#### valeurs `null`\nPar défaut, les valeurs `null` sont considérées comme étant supérieures à toutes les autres valeurs. Selon un ordre de tri croissant, les valeurs `null` sont classées en dernier. Selon un ordre de tri décroissant, les valeurs `null` sont classées en premier. Pour modifier cet ordre, utilisez `NULLS FIRST` ou `NULLS LAST` :\n\n````\nFROM employees\n| KEEP first_name, last_name, height\n| SORT first_name ASC NULLS FIRST\n````\n ", + "languageDocumentationPopover.documentationESQL.split": "SPLIT", + "languageDocumentationPopover.documentationESQL.split.markdown": "\n\n ### SPLIT\n Divise une chaîne de valeur unique en plusieurs chaînes.\n\n ````\n ROW words=\"foo;bar;baz;qux;quux;corge\"\n | EVAL word = SPLIT(words, \";\")\n ````\n ", + "languageDocumentationPopover.documentationESQL.sqrt": "SQRT", + "languageDocumentationPopover.documentationESQL.sqrt.markdown": "\n\n ### SQRT\n Renvoie la racine carrée d'un nombre. La valeur de renvoi est toujours un double, quelle que soit la valeur numérique de l'entrée.\n Les racines carrées des nombres négatifs et des infinis sont nulles.\n\n ````\n ROW d = 100.0\n | EVAL s = SQRT(d)\n ````\n ", + "languageDocumentationPopover.documentationESQL.st_contains": "ST_CONTAINS", + "languageDocumentationPopover.documentationESQL.st_contains.markdown": "\n\n ### ST_CONTAINS\n Renvoie si la première géométrie contient la deuxième géométrie.\n Il s'agit de l'inverse de la fonction `ST_WITHIN`.\n\n ````\n FROM airport_city_boundaries\n | WHERE ST_CONTAINS(city_boundary, TO_GEOSHAPE(\"POLYGON((109.35 18.3, 109.45 18.3, 109.45 18.4, 109.35 18.4, 109.35 18.3))\"))\n | KEEP abbrev, airport, region, city, city_location\n ````\n ", + "languageDocumentationPopover.documentationESQL.st_disjoint": "ST_DISJOINT", + "languageDocumentationPopover.documentationESQL.st_disjoint.markdown": "\n\n ### ST_DISJOINT\n Renvoie si les deux géométries ou colonnes géométriques sont disjointes.\n Il s'agit de l'inverse de la fonction `ST_INTERSECTS`.\n En termes mathématiques : ST_Disjoint(A, B) ⇔ A ⋂ B = ∅\n\n ````\n FROM airport_city_boundaries\n | WHERE ST_DISJOINT(city_boundary, TO_GEOSHAPE(\"POLYGON((-10 -60, 120 -60, 120 60, -10 60, -10 -60))\"))\n | KEEP abbrev, airport, region, city, city_location\n ````\n ", + "languageDocumentationPopover.documentationESQL.st_distance": "ST_DISTANCE", + "languageDocumentationPopover.documentationESQL.st_distance.markdown": "\n\n ### ST_DISTANCE\n Calcule la distance entre deux points.\n Pour les géométries cartésiennes, c’est la distance pythagoricienne dans les mêmes unités que les coordonnées d'origine.\n Pour les géométries géographiques, c’est la distance circulaire le long du grand cercle en mètres.\n\n ````\n Aéroports FROM\n | WHERE abbrev == \"CPH\"\n | EVAL distance = ST_DISTANCE(location, city_location)\n | KEEP abbrev, name, location, city_location, distance\n ````\n ", + "languageDocumentationPopover.documentationESQL.st_intersects": "ST_INTERSECTS", + "languageDocumentationPopover.documentationESQL.st_intersects.markdown": "\n\n ### ST_INTERSECTS\n Renvoie `true` (vrai) si deux géométries se croisent.\n Elles se croisent si elles ont un point commun, y compris leurs points intérieurs\n (les points situés le long des lignes ou dans des polygones).\n Il s'agit de l'inverse de la fonction `ST_DISJOINT`.\n En termes mathématiques : ST_Intersects(A, B) ⇔ A ⋂ B ≠ ∅\n\n ````\n Aéroports FROM\n | WHERE ST_INTERSECTS(location, TO_GEOSHAPE(\"POLYGON((42 14, 43 14, 43 15, 42 15, 42 14))\"))\n ````\n ", + "languageDocumentationPopover.documentationESQL.st_within": "ST_WITHIN", + "languageDocumentationPopover.documentationESQL.st_within.markdown": "\n\n ### ST_WITHIN\n Renvoie si la première géométrie est à l'intérieur de la deuxième géométrie.\n Il s'agit de l'inverse de la fonction `ST_CONTAINS`.\n\n ````\n FROM airport_city_boundaries\n | WHERE ST_WITHIN(city_boundary, TO_GEOSHAPE(\"POLYGON((109.1 18.15, 109.6 18.15, 109.6 18.65, 109.1 18.65, 109.1 18.15))\"))\n | KEEP abbrev, airport, region, city, city_location\n ````\n ", + "languageDocumentationPopover.documentationESQL.st_x": "ST_X", + "languageDocumentationPopover.documentationESQL.st_x.markdown": "\n\n ### ST_X\n Extrait la coordonnée `x` du point fourni.\n Si les points sont de type `geo_point`, cela revient à extraire la valeur de la `longitude`.\n\n ````\n ROW point = TO_GEOPOINT(\"POINT(42.97109629958868 14.7552534006536)\")\n | EVAL x = ST_X(point), y = ST_Y(point)\n ````\n ", + "languageDocumentationPopover.documentationESQL.st_y": "ST_Y", + "languageDocumentationPopover.documentationESQL.st_y.markdown": "\n\n ### ST_Y\n Extrait la coordonnée `y` du point fourni.\n Si les points sont de type `geo_point`, cela revient à extraire la valeur de la `latitude`.\n\n ````\n ROW point = TO_GEOPOINT(\"POINT(42.97109629958868 14.7552534006536)\")\n | EVAL x = ST_X(point), y = ST_Y(point)\n ````\n ", + "languageDocumentationPopover.documentationESQL.starts_with": "STARTS_WITH", + "languageDocumentationPopover.documentationESQL.starts_with.markdown": "\n\n ### STARTS_WITH\n Renvoie un booléen qui indique si une chaîne de mot-clés débute par une autre chaîne.\n\n ````\n FROM employees\n | KEEP last_name\n | EVAL ln_S = STARTS_WITH(last_name, \"B\")\n ````\n ", + "languageDocumentationPopover.documentationESQL.statsby": "STATS ... BY", + "languageDocumentationPopover.documentationESQL.statsby.markdown": "### STATS ... BY\nUtilisez `STATS ... BY` pour regrouper les lignes en fonction d'une valeur commune et calculer une ou plusieurs valeurs agrégées sur les lignes regroupées.\n\n**Exemples** :\n\n````\nFROM employees\n| STATS count = COUNT(emp_no) BY languages\n| SORT languages\n````\n\nSi `BY` est omis, le tableau de sortie contient exactement une ligne avec les agrégations appliquées sur l'ensemble des données :\n\n````\nFROM employees\n| STATS avg_lang = AVG(languages)\n````\n\nIl est possible de calculer plusieurs valeurs :\n\n````\nFROM employees\n| STATS avg_lang = AVG(languages), max_lang = MAX(languages)\n````\n\nIl est également possible d'effectuer des regroupements en fonction de plusieurs valeurs (uniquement pour les champs longs et les champs de la famille de mots-clés) :\n\n````\nFROM employees\n| EVAL hired = DATE_FORMAT(hire_date, \"YYYY\")\n| STATS avg_salary = AVG(salary) BY hired, languages.long\n| EVAL avg_salary = ROUND(avg_salary)\n| SORT hired, languages.long\n````\n\nConsultez la rubrique **Fonctions d'agrégation** pour obtenir la liste des fonctions pouvant être utilisées avec `STATS ... BY`.\n\nLes fonctions d'agrégation et les expressions de regroupement acceptent toutes deux d'autres fonctions. Ceci est utile pour utiliser `STATS...BY` sur des colonnes à valeur multiple. Par exemple, pour calculer l'évolution moyenne du salaire, vous pouvez utiliser `MV_AVG` pour faire la moyenne des multiples valeurs par employé, et utiliser le résultat avec la fonction `AVG` :\n\n````\nFROM employees\n| STATS avg_salary_change = AVG(MV_AVG(salary_change))\n````\n\nLe regroupement par expression est par exemple le regroupement des employés en fonction de la première lettre de leur nom de famille :\n\n````\nFROM employees\n| STATS my_count = COUNT() BY LEFT(last_name, 1)\n| SORT \"LEFT(last_name, 1)\"\n````\n\nIl n'est pas obligatoire d'indiquer le nom de la colonne de sortie. S'il n'est pas spécifié, le nouveau nom de la colonne est égal à l'expression. La requête suivante renvoie une colonne appelée `AVG(salary)` :\n\n````\nFROM employees\n| STATS AVG(salary)\n````\n\nComme ce nom contient des caractères spéciaux, il doit être placé entre deux caractères (`) lorsqu'il est utilisé dans des commandes suivantes :\n\n````\nFROM employees\n| STATS AVG(salary)\n| EVAL avg_salary_rounded = ROUND(\"AVG(salary)\")\n````\n\n**Remarque** : `STATS` sans aucun groupe est beaucoup plus rapide que l'ajout d'un groupe.\n\n**Remarque** : Le regroupement sur une seule expression est actuellement beaucoup plus optimisé que le regroupement sur plusieurs expressions.\n ", + "languageDocumentationPopover.documentationESQL.stCentroidFunction": "ST_CENTROID_AGG", + "languageDocumentationPopover.documentationESQL.stCentroidFunction.markdown": "### ST_CENTROID_AGG\n**AVERTISSEMENT : Cette fonctionnalité est en version d'évaluation technique et pourra être modifiée ou supprimée dans une future version. Elastic s'efforcera de corriger tout problème éventuel, mais les fonctionnalités des versions d'évaluation technique ne sont pas soumises aux accords de niveau de service (SLA) d'assistance des fonctionnalités officielles en disponibilité générale.**\n\nCalcule le centroïde spatial sur un champ avec un type de géométrie de point spatial.\n\n````\nAéroports FROM\n| STATS centroid=ST_CENTROID_AGG(location)\n````\n ", + "languageDocumentationPopover.documentationESQL.stringOperators": "LIKE et RLIKE", + "languageDocumentationPopover.documentationESQL.stringOperators.markdown": "### LIKE et RLIKE\nPour comparer des chaînes en utilisant des caractères génériques ou des expressions régulières, utilisez `LIKE` ou `RLIKE` :\n\nUtilisez `LIKE` pour faire correspondre des chaînes à l'aide de caractères génériques. Les caractères génériques suivants sont pris en charge :\n\n* `*` correspond à zéro caractère ou plus.\n* `?` correspond à un seul caractère.\n\n````\nFROM employees\n| WHERE first_name LIKE \"?b*\"\n| KEEP first_name, last_name\n````\n\nUtilisez `RLIKE` pour faire correspondre des chaînes à l'aide d'expressions régulières :\n\n````\nFROM employees\n| WHERE first_name RLIKE \".leja.*\"\n| KEEP first_name, last_name\n````\n ", + "languageDocumentationPopover.documentationESQL.substring": "SUBSTRING", + "languageDocumentationPopover.documentationESQL.substring.markdown": "\n\n ### SUBSTRING\n Renvoie la sous-chaîne d'une chaîne, délimitée en fonction d'une position de départ et d'une longueur facultative\n\n ````\n FROM employees\n | KEEP last_name\n | EVAL ln_sub = SUBSTRING(last_name, 1, 3)\n ````\n ", + "languageDocumentationPopover.documentationESQL.sumFunction": "SUM", + "languageDocumentationPopover.documentationESQL.sumFunction.markdown": "### SUM\nRenvoie la somme d'un champ numérique.\n\n````\nFROM employees\n| STATS SUM(languages)\n````\n\nCette expression peut utiliser des fonctions alignées. Par exemple, pour calculer la somme de l'évolution de salaire maximale de chaque employé, appliquez la fonction `MV_MAX` à chaque ligne et additionnez les résultats (`SUM`) :\n\n````\nFROM employees\n| STATS total_salary_changes = SUM(MV_MAX(salary_change))\n````\n ", + "languageDocumentationPopover.documentationESQL.tan": "TAN", + "languageDocumentationPopover.documentationESQL.tan.markdown": "\n\n ### TAN\n Renvoie la fonction trigonométrique Tangente d'un angle.\n\n ````\n ROW a=1.8 \n | EVAL tan=TAN(a)\n ````\n ", + "languageDocumentationPopover.documentationESQL.tanh": "TANH", + "languageDocumentationPopover.documentationESQL.tanh.markdown": "\n\n ### TANH\n Renvoie la fonction hyperbolique Tangente d'un angle.\n\n ````\n ROW a=1.8 \n | EVAL tanh=TANH(a)\n ````\n ", + "languageDocumentationPopover.documentationESQL.tau": "TAU", + "languageDocumentationPopover.documentationESQL.tau.markdown": "\n\n ### TAU\n Renvoie le rapport entre la circonférence et le rayon d'un cercle.\n\n ````\n ROW TAU()\n ````\n ", + "languageDocumentationPopover.documentationESQL.to_base64": "TO_BASE64", + "languageDocumentationPopover.documentationESQL.to_base64.markdown": "\n\n ### TO_BASE64\n Encode une chaîne en chaîne base64.\n\n ````\n row a = \"elastic\" \n | eval e = to_base64(a)\n ````\n ", + "languageDocumentationPopover.documentationESQL.to_boolean": "TO_BOOLEAN", + "languageDocumentationPopover.documentationESQL.to_boolean.markdown": "\n\n ### TO_BOOLEAN\n Convertit une valeur d'entrée en une valeur booléenne.\n Une chaîne de valeur *true* sera convertie, sans tenir compte de la casse, en une valeur booléenne *true*.\n Pour toute autre valeur, y compris une chaîne vide, la fonction renverra *false*.\n La valeur numérique *0* sera convertie en *false*, toute autre valeur sera convertie en *true*.\n\n ````\n ROW str = [\"true\", \"TRuE\", \"false\", \"\", \"yes\", \"1\"]\n | EVAL bool = TO_BOOLEAN(str)\n ````\n ", + "languageDocumentationPopover.documentationESQL.to_cartesianpoint": "TO_CARTESIANPOINT", + "languageDocumentationPopover.documentationESQL.to_cartesianpoint.markdown": "\n\n ### TO_CARTESIANPOINT\n Convertit la valeur d'une entrée en une valeur `cartesian_point`.\n Une chaîne ne sera convertie que si elle respecte le format WKT Point.\n\n ````\n ROW wkt = [\"POINT(4297.11 -1475.53)\", \"POINT(7580.93 2272.77)\"]\n | MV_EXPAND wkt\n | EVAL pt = TO_CARTESIANPOINT(wkt)\n ````\n ", + "languageDocumentationPopover.documentationESQL.to_cartesianshape": "TO_CARTESIANSHAPE", + "languageDocumentationPopover.documentationESQL.to_cartesianshape.markdown": "\n\n ### TO_CARTESIANSHAPE\n Convertit une valeur d'entrée en une valeur `cartesian_shape`.\n Une chaîne ne sera convertie que si elle respecte le format WKT.\n\n ````\n ROW wkt = [\"POINT(4297.11 -1475.53)\", \"POLYGON ((3339584.72 1118889.97, 4452779.63 4865942.27, 2226389.81 4865942.27, 1113194.90 2273030.92, 3339584.72 1118889.97))\"]\n | MV_EXPAND wkt\n | EVAL geom = TO_CARTESIANSHAPE(wkt)\n ````\n ", + "languageDocumentationPopover.documentationESQL.to_datetime": "TO_DATETIME", + "languageDocumentationPopover.documentationESQL.to_datetime.markdown": "\n\n ### TO_DATETIME\n Convertit une valeur d'entrée en une valeur de date.\n Une chaîne ne sera convertie que si elle respecte le format `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'`.\n Pour convertir des dates vers d'autres formats, utilisez `DATE_PARSE`.\n\n ````\n ROW string = [\"1953-09-02T00:00:00.000Z\", \"1964-06-02T00:00:00.000Z\", \"1964-06-02 00:00:00\"]\n | EVAL datetime = TO_DATETIME(string)\n ````\n ", + "languageDocumentationPopover.documentationESQL.to_degrees": "TO_DEGREES", + "languageDocumentationPopover.documentationESQL.to_degrees.markdown": "\n\n ### TO_DEGREES\n Convertit un nombre en radians en degrés.\n\n ````\n ROW rad = [1.57, 3.14, 4.71]\n | EVAL deg = TO_DEGREES(rad)\n ````\n ", + "languageDocumentationPopover.documentationESQL.to_double": "TO_DOUBLE", + "languageDocumentationPopover.documentationESQL.to_double.markdown": "\n\n ### TO_DOUBLE\n Convertit une valeur d'entrée en une valeur double. Si le paramètre d'entrée est de type date,\n sa valeur sera interprétée en millisecondes depuis l'heure Unix,\n convertie en double. Le booléen *true* sera converti en double *1.0*, et *false* en *0.0*.\n\n ````\n ROW str1 = \"5.20128E11\", str2 = \"foo\"\n | EVAL dbl = TO_DOUBLE(\"520128000000\"), dbl1 = TO_DOUBLE(str1), dbl2 = TO_DOUBLE(str2)\n ````\n ", + "languageDocumentationPopover.documentationESQL.to_geopoint": "TO_GEOPOINT", + "languageDocumentationPopover.documentationESQL.to_geopoint.markdown": "\n\n ### TO_GEOPOINT\n Convertit une valeur d'entrée en une valeur `geo_point`.\n Une chaîne ne sera convertie que si elle respecte le format WKT Point.\n\n ````\n ROW wkt = \"POINT(42.97109630194 14.7552534413725)\"\n | EVAL pt = TO_GEOPOINT(wkt)\n ````\n ", + "languageDocumentationPopover.documentationESQL.to_geoshape": "TO_GEOSHAPE", + "languageDocumentationPopover.documentationESQL.to_geoshape.markdown": "\n\n ### TO_GEOSHAPE\n Convertit une valeur d'entrée en une valeur `geo_shape`.\n Une chaîne ne sera convertie que si elle respecte le format WKT.\n\n ````\n ROW wkt = \"POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))\"\n | EVAL geom = TO_GEOSHAPE(wkt)\n ````\n ", + "languageDocumentationPopover.documentationESQL.to_integer": "TO_INTEGER", + "languageDocumentationPopover.documentationESQL.to_integer.markdown": "\n\n ### TO_INTEGER\n Convertit une valeur d'entrée en une valeur entière.\n Si le paramètre d'entrée est de type date, sa valeur sera interprétée en millisecondes\n depuis l'heure Unix, convertie en entier.\n Le booléen *true* sera converti en entier *1*, et *false* en *0*.\n\n ````\n ROW long = [5013792, 2147483647, 501379200000]\n | EVAL int = TO_INTEGER(long)\n ````\n ", + "languageDocumentationPopover.documentationESQL.to_ip": "TO_IP", + "languageDocumentationPopover.documentationESQL.to_ip.markdown": "\n\n ### TO_IP\n Convertit une chaîne d'entrée en valeur IP.\n\n ````\n ROW str1 = \"1.1.1.1\", str2 = \"foo\"\n | EVAL ip1 = TO_IP(str1), ip2 = TO_IP(str2)\n | WHERE CIDR_MATCH(ip1, \"1.0.0.0/8\")\n ````\n ", + "languageDocumentationPopover.documentationESQL.to_long": "TO_LONG", + "languageDocumentationPopover.documentationESQL.to_long.markdown": "\n\n ### TO_LONG\n Convertit une valeur d'entrée en une valeur longue. Si le paramètre d'entrée est de type date,\n sa valeur sera interprétée en millisecondes depuis l'heure Unix, convertie en valeur longue.\n Le booléen *true* sera converti en valeur longue *1*, et *false* en *0*.\n\n ````\n ROW str1 = \"2147483648\", str2 = \"2147483648.2\", str3 = \"foo\"\n | EVAL long1 = TO_LONG(str1), long2 = TO_LONG(str2), long3 = TO_LONG(str3)\n ````\n ", + "languageDocumentationPopover.documentationESQL.to_lower": "TO_LOWER", + "languageDocumentationPopover.documentationESQL.to_lower.markdown": "\n\n ### TO_LOWER\n Renvoie une nouvelle chaîne représentant la chaîne d'entrée convertie en minuscules.\n\n ````\n ROW message = \"Some Text\"\n | EVAL message_lower = TO_LOWER(message)\n ````\n ", + "languageDocumentationPopover.documentationESQL.to_radians": "TO_RADIANS", + "languageDocumentationPopover.documentationESQL.to_radians.markdown": "\n\n ### TO_RADIANS\n Convertit un nombre en degrés en radians.\n\n ````\n ROW deg = [90.0, 180.0, 270.0]\n | EVAL rad = TO_RADIANS(deg)\n ````\n ", + "languageDocumentationPopover.documentationESQL.to_string": "TO_STRING", + "languageDocumentationPopover.documentationESQL.to_string.markdown": "\n\n ### TO_STRING\n Convertit une valeur d'entrée en une chaîne.\n\n ````\n ROW a=10\n | EVAL j = TO_STRING(a)\n ````\n ", + "languageDocumentationPopover.documentationESQL.to_unsigned_long": "TO_UNSIGNED_LONG", + "languageDocumentationPopover.documentationESQL.to_unsigned_long.markdown": "\n\n ### TO_UNSIGNED_LONG\n Convertit une valeur d'entrée en une valeur longue non signée. Si le paramètre d'entrée est de type date,\n sa valeur sera interprétée en millisecondes depuis l'heure Unix, convertie en valeur longue non signée.\n Le booléen *true* sera converti en valeur longue non signée *1*, et *false* en *0*.\n\n ````\n ROW str1 = \"2147483648\", str2 = \"2147483648.2\", str3 = \"foo\"\n | EVAL long1 = TO_UNSIGNED_LONG(str1), long2 = TO_ULONG(str2), long3 = TO_UL(str3)\n ````\n ", + "languageDocumentationPopover.documentationESQL.to_upper": "TO_UPPER", + "languageDocumentationPopover.documentationESQL.to_upper.markdown": "\n\n ### TO_UPPER\n Renvoie une nouvelle chaîne représentant la chaîne d'entrée convertie en majuscules.\n\n ````\n ROW message = \"Some Text\"\n | EVAL message_upper = TO_UPPER(message)\n ````\n ", + "languageDocumentationPopover.documentationESQL.to_version": "TO_VERSION", + "languageDocumentationPopover.documentationESQL.to_version.markdown": "\n\n ### TO_VERSION\n Convertit une chaîne d'entrée en une valeur de version.\n\n ````\n ROW v = TO_VERSION(\"1.2.3\")\n ````\n ", + "languageDocumentationPopover.documentationESQL.trim": "TRIM", + "languageDocumentationPopover.documentationESQL.trim.markdown": "\n\n ### TRIM\n Supprime les espaces de début et de fin d'une chaîne.\n\n ````\n ROW message = \" some text \", color = \" red \"\n | EVAL message = TRIM(message)\n | EVAL color = TRIM(color)\n ````\n ", + "languageDocumentationPopover.documentationESQL.valuesFunction": "VALEURS", + "languageDocumentationPopover.documentationESQL.valuesFunction.markdown": "### VALEURS\n\n**AVERTISSEMENT : N’utilisez pas `VALUES` dans les environnements de production. Cette fonctionnalité est en version d'évaluation technique et pourra être modifiée ou supprimée dans une future version. Elastic s'efforcera de corriger tout problème éventuel, mais les fonctionnalités des versions d'évaluation technique ne sont pas soumises aux accords de niveau de service (SLA) d'assistance des fonctionnalités officielles en disponibilité générale.**\n\nRenvoie toutes les valeurs d’un groupe dans un champ multivalué. L'ordre des valeurs renvoyées n'est pas garanti. Si vous avez besoin que les valeurs renvoyées soient dans l'ordre, utilisez `MV_SORT`.\n\nAccepte une expression de n'importe quel type, sauf `geo_point`, `cartesian_point`, `geo_shape` ou `cartesian_shape`.\n\n\nExemple :\n\n````\n FROM employees\n| EVAL first_letter = SUBSTRING(first_name, 0, 1)\n| STATS first_name=MV_SORT(VALUES(first_name)) BY first_letter\n| SORT first_letter\n````\n\n> _**AVERTISSEMENT :** Ceci peut utiliser une quantité importante de mémoire et ES|QL ne développe pas encore les agrégations au-delà de la mémoire. Cette agrégation fonctionnera donc jusqu'à ce qu'elle soit utilisée pour collecter plus de valeurs que la mémoire ne peut en contenir. Lorsque le nombre de valeurs collectées est trop élevé, la requête échoue avec un message d'erreur de type [Circuit Breaker Error](https://www.elastic.co/guide/en/elasticsearch/reference/current/circuit-breaker-errors.html)._\n\n ", + "languageDocumentationPopover.documentationESQL.where": "WHERE", + "languageDocumentationPopover.documentationESQL.where.markdown": "### WHERE\nUtilisez `WHERE` afin d'obtenir un tableau qui comprend toutes les lignes du tableau d'entrée pour lesquelles la condition fournie est évaluée à `true` :\n \n````\nFROM employees\n| KEEP first_name, last_name, still_hired\n| WHERE still_hired == true\n````\n\n#### Opérateurs\n\nPour obtenir un aperçu des opérateurs pris en charge, consultez la section **Opérateurs**.\n\n#### Fonctions\n`WHERE` prend en charge diverses fonctions de calcul des valeurs. Pour en savoir plus, consultez la section **Fonctions**.\n ", "textBasedEditor.query.textBasedLanguagesEditor.EnableWordWrapLabel": "Ajouter des sauts de ligne aux barres verticales", "textBasedEditor.query.textBasedLanguagesEditor.errorCount": "{count} {count, plural, one {erreur} other {erreurs}}", "textBasedEditor.query.textBasedLanguagesEditor.errorsTitle": "Erreurs", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index ddbcf30c5727a5..e9fe2b1d4d3fe4 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -7197,253 +7197,253 @@ "textBasedEditor.query.textBasedLanguagesEditor.collapseLabel": "縮小", "textBasedEditor.query.textBasedLanguagesEditor.commandsDescription": "通常、ソースコマンドはElasticsearchのデータを使ってテーブルを生成します。ES|QLは以下のソースコマンドをサポートしています。", "textBasedEditor.query.textBasedLanguagesEditor.disableWordWrapLabel": "パイプの改行を削除", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.abs": "ABS", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.abs.markdown": "\n\n ### ABS\n 絶対値を返します。\n\n ```\n ROW number = -1.0 \n | EVAL abs_number = ABS(number)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.acos": "ACOS", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.acos.markdown": "\n\n ### ACOS\n nのアークコサインをラジアンで表記された角度として返します。\n\n ```\n ROW a=.9\n | EVAL acos=ACOS(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.asin": "ASIN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.asin.markdown": "\n\n ### ASIN\n 入力\n 数値式のアークサインをラジアンで表記された角度として返します。\n\n ```\n ROW a=.9\n | EVAL asin=ASIN(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.atan": "ATAN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.atan.markdown": "\n\n ### ATAN\n 入力\n 数値式のアークタンジェントをラジアンで表記された角度として返します。\n\n ```\n ROW a=12.9\n | EVAL atan=ATAN(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.atan2": "ATAN2", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.atan2.markdown": "\n\n ### ATAN2\n 直交平面上の原点から点(x , y)に向かう光線と正のx軸のなす角(ラジアン表記)。\n \n\n ```\n ROW y=12.9, x=.6\n | EVAL atan2=ATAN2(y, x)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.autoBucketFunction": "BUCKET", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.autoBucketFunction.markdown": "### バケット\n日時または数値入力から、値(バケット)のグループを作成します。バケットのサイズは直接指定するか、推奨される数と値の範囲に基づいて選択できます。\n\nBUCKETは次の2つのモードで動作します。\n\n1.バケットのサイズがバケット数の提案(4つのパラメーター)と範囲に基づいて計算される。\n2.バケットサイズが直接指定される(2つのパラメーター)。\n\n目標バケット数、開始日、終了日を使用すると、目標バケット数以下のバケットを生成するために適切なバケットサイズがBUCKETによって選択されます。\n\nたとえば、1年に最大20バケットをリクエストすると、データが1か月間隔で整理されます。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT hire_date\n```\n\n**注**:ここでは、正確な目標バケット数を指定するのではなく、目標バケット数を_上限_として範囲を指定します。\n\nBUCKETを集約と組み合わせ、ヒストグラムを作成できます。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_month = COUNT(*) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT month\n```\n\n**注**:BUCKETは、どのドキュメントにも一致しないバケットを作成しません。そのため、前の例では1985-03-01やその他の日付が抜けています。\n\nその他のバケットを要求すると、範囲が小さくなることがあります。たとえば、1年に最大100バケットをリクエストすると、1週間単位のバケットになります。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 100, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT week\n```\n\n**注**:AUTO_BUCKETは行をフィルタリングしません。指定された範囲のみを使用して、適切なバケットサイズを選択します。範囲外の値の行に対しては、範囲外のバケツに対応するバケット値を返します。行をフィルタリングするには、BUCKETとWHEREを組み合わせます。\n\n事前に任意のバケットサイズがわかっている場合は、2番目の引数として指定し、範囲を除外します。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 1 week)\n| SORT week\n```\n\n**注**:バケットサイズを2番目のパラメーターとして指定するときには、時間の期間または日付の期間を選択する必要があります。\n\nBUCKETは数値フィールドでも動作します。たとえば、給与ヒストグラムを作成します。\n\n```\nFROM employees\n| STATS COUNT(*) by bs = BUCKET(salary, 20, 25324, 74999)\n| SORT bs\n```\n\n日付範囲で意図的フィルタリングする前の例とは異なり、数値フィールドでフィルタリングすることはほとんどありません。最小値と最大値を別々に見つける必要があります。ES|QLにはそれを自動的に実行するための簡単な方法がありません。\n\n任意のバケットサイズが事前にわかっている場合は、範囲を省略できます。2番目の引数として指定します。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS c = COUNT(1) BY b = BUCKET(salary, 5000.)\n| SORT b\n```\n\n**注**:バケットサイズを2番目のパラメーターとして指定するときには、**浮動小数点数型**でなければなりません。\n\n次の例は、過去24時間の1時間単位のバケットを作成し、1時間当たりのイベント数を計算します。\n\n```\nFROM sample_data\n| WHERE @timestamp >= NOW() - 1 day and @timestamp < NOW()\n| STATS COUNT(*) BY bucket = BUCKET(@timestamp, 25, NOW() - 1 day, NOW())\n```\n\n次の例は、1985年の1か月単位のバケットを作成し、採用月別に平均給与を計算します。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS AVG(salary) BY bucket = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT bucket\n```\n\n集約部で関数が**グループ部で定義されたエイリアスによって参照されている**場合、またはまったく同じ式で呼び出されている場合、BUCKETは、 STATS …​ BY …コマンドの集約部とグループ部の両方で使用できます。\n\n例:\n\n```\nFROM employees\n| STATS s1 = b1 + 1, s2 = BUCKET(salary / 1000 + 999, 50.) + 2 BY b1 = BUCKET(salary / 100 + 99, 50.), b2 = BUCKET(salary / 1000 + 999, 50.)\n| SORT b1, b2\n| KEEP s1, b1, s2, b2\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.avgFunction": "AVG", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.avgFunction.markdown": "### AVG\n数値フィールドの平均を返します。\n\n```\nFROM employees\n| STATS AVG(height)\n```\n\n式はインライン関数を使用できます。たとえば、複数値列で平均を計算するには、まず、MV_AVGを使用して行ごとに複数の値の平均を求め、その結果にAVG関数を適用します。\n\n```\nFROM employees\n| STATS avg_salary_change = AVG(MV_AVG(salary_change))\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.binaryOperators": "バイナリ演算子", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.binaryOperators.markdown": "### バイナリ演算子\n次のバイナリ比較演算子がサポートされています。\n\n* 等号:`==`\n* 不等号:`!=`\n* より小さい:`<`\n* 以下:`<=`\n* より大きい:`>`\n* 以上:`>=`\n* 加算:`+`\n* 減算:`-`\n* 乗算:`*`\n* 除算:`/`\n* 係数:`%`\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.booleanOperators": "ブール演算子", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.booleanOperators.markdown": "### ブール演算子\n次のブール演算子がサポートされています。\n\n* `AND`\n* `OR`\n* `NOT`\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.bucket": "BUCKET", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.bucket.markdown": "\n\n ### BUCKET\n 日時または数値入力から、値(バケット)のグループを作成します。\n バケットのサイズは直接指定するか、推奨される数と値の範囲に基づいて選択できます。\n\n ```\n FROM employees\n | WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n | STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n | SORT hire_date\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.case": "CASE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.case.markdown": "\n\n ### CASE\n 条件と値のペアを指定できます。この関数は、trueと評価される\n 最初の条件に属する値を返します。\n\n 引数の数が奇数の場合、最後の引数は条件に一致しない場合に返されるデフォルト値になります。\n 引数の数が偶数で、\n 条件が一致しない場合、この関数はnullを返します。\n\n ```\n FROM employees\n | EVAL type = CASE(\n languages <= 1, \"monolingual\",\n languages <= 2, \"bilingual\",\n \"polyglot\")\n | KEEP emp_no, languages, type\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.castOperator": "Cast (::)", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.castOperator.markdown": "### CAST (`::`)\n::演算子はO_型変換関数に代わる便利な構文です。\n\n例:\n```\nROW ver = CONCAT((\"0\"::INT + 1)::STRING, \".2.3\")::VERSION\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cbrt": "CBRT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cbrt.markdown": "\n\n ### CBRT\n 数値の立方根を返します。入力は任意の数値で、戻り値は常にdoubleです。\n 無限大の立方根はnullです。\n\n ```\n ROW d = 1000.0\n | EVAL c = cbrt(d)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ceil": "CEIL", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ceil.markdown": "\n\n ### CEIL\n 最も近い整数に数値を切り上げます。\n\n ```\n ROW a=1.8\n | EVAL a=CEIL(a)\n ```\n 注:これはlong(符号なしを含む)とintegerのnoopです。doubleの場合、JavaのMath.ceilと同様に、整数に最も近いdoubleの値を選びます。\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cidr_match": "CIDR_MATCH", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cidr_match.markdown": "\n\n ### CIDR_MATCH\n 指定されたIPが指定されたCIDRブロックのいずれかに含まれていればtrueを返します。\n\n ```\n FROM hosts \n | WHERE CIDR_MATCH(ip1, \"127.0.0.2/32\", \"127.0.0.3/32\") \n | KEEP card, host, ip0, ip1\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.coalesce": "COALESCE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.coalesce.markdown": "\n\n ### COALESCE\n nullでない最初の引数を返します。すべての引数がnullの場合はnullを返します。\n\n ```\n ROW a=null, b=\"b\"\n | EVAL COALESCE(a, b)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.concat": "CONCAT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.concat.markdown": "\n\n ### CONCAT\n 2つ以上の文字列を連結します。\n\n ```\n FROM employees\n | KEEP first_name, last_name\n | EVAL fullname = CONCAT(first_name, \" \", last_name)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cos": "COS", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cos.markdown": "\n\n ### COS\n 角度の余弦を返します。\n\n ```\n ROW a=1.8 \n | EVAL cos=COS(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cosh": "COSH", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cosh.markdown": "\n\n ### COSH\n 角度の双曲余弦を返します。\n\n ```\n ROW a=1.8 \n | EVAL cosh=COSH(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.countDistinctFunction": "COUNT_DISTINCT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.countDistinctFunction.markdown": "### COUNT_DISTINCT\n異なる値のおおよその数をカウントします。\n\n```\nFROM hosts\n| STATS COUNT_DISTINCT(ip0), COUNT_DISTINCT(ip1)\n```\n\nCOUNT_DISTINCT関数はHyperLogLog++アルゴリズムに基づく近似関数です。詳細については、[ドキュメント](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-cardinality-aggregation.html#_counts_are_approximate)を参照してください。精度は、オプションの2番目のパラメーターを使って設定できます。サポートされている最大値は40000です。この数値を超えたしきい値は、しきい値40000と同じ結果になります。デフォルト値は3000です。\n\n```\nFROM hosts\n| STATS COUNT_DISTINCT(ip0, 80000), COUNT_DISTINCT(ip1, 5)\n```\n\n式はインライン関数を使用できます。この例では、SPLIT関数を使用して、複数の値を分割し、一意の値をカウントします。\n\n```\nROW words=\"foo;bar;baz;qux;quux;foo\"\n| STATS distinct_word_count = COUNT_DISTINCT(SPLIT(words, \";\"))\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.countFunction": "COUNT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.countFunction.markdown": "### COUNT\n入力値の合計数(カウント)が返されます。\n\n```\nFROM employees\n| STATS COUNT(height)\n```\n\n任意のフィールドを入力として渡すことができます。\n\n行数をカウントするには、`COUNT()`または`COUNT(*)`を使用します。\n\n```\nFROM employees\n| STATS count = COUNT(*) BY languages\n| SORT languages DESC\n```\n\n式はインライン関数を使用できます。この例では、SPLIT関数を使用して、複数の値を分割し、値をカウントします。\n\n```\nROW words=\"foo;bar;baz;qux;quux;foo\"\n| STATS word_count = COUNT(SPLIT(words, \";\"))\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_diff": "DATE_DIFF", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_diff.markdown": "\n\n ### DATE_DIFF\n startTimestampをendTimestampから減算し、unitの乗数の差を返します。\n startTimestampがendTimestampより後の場合は、負の値が返されます。\n\n ```\n ROW date1 = TO_DATETIME(\"2023-12-02T11:00:00.000Z\"), date2 = TO_DATETIME(\"2023-12-02T11:00:00.001Z\")\n | EVAL dd_ms = DATE_DIFF(\"microseconds\", date1, date2)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_extract": "DATE_EXTRACT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_extract.markdown": "\n\n ### DATE_EXTRACT\n 年、月、日、時間など、日付の一部を抽出します。\n\n ```\n ROW date = DATE_PARSE(\"yyyy-MM-dd\", \"2022-05-06\")\n | EVAL year = DATE_EXTRACT(\"year\", date)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_format": "DATE_FORMAT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_format.markdown": "\n\n ### DATE_FORMAT\n 指定した書式の日付の文字列表現を返します。\n\n ```\n FROM employees\n | KEEP first_name, last_name, hire_date\n | EVAL hired = DATE_FORMAT(\"YYYY-MM-dd\", hire_date)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_parse": "DATE_PARSE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_parse.markdown": "\n\n ### DATE_PARSE\n 最初の引数で指定した形式を使用して、2番目の引数を解析することで、日付を返します。\n\n ```\n ROW date_string = \"2022-05-06\"\n | EVAL date = DATE_PARSE(\"yyyy-MM-dd\", date_string)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_trunc": "DATE_TRUNC", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_trunc.markdown": "\n\n ### DATE_TRUNC\n 最も近い区間まで日付を切り捨てます。\n\n ```\n FROM employees\n | KEEP first_name, last_name, hire_date\n | EVAL year_hired = DATE_TRUNC(1 year, hire_date)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.dissect": "DISSECT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.dissect.markdown": "### DISSECT\nDISSECTは文字列から構造化データを取り出すことができます。DISSECTは文字列を区切り文字ベースのパターンと照合し、指定されたキーを列として抽出します。\n\ndissectパターンの構文については、[dissectプロセッサードキュメント](https://www.elastic.co/guide/en/elasticsearch/reference/current/dissect-processor.html)を参照してください。\n\n```\nROW a = \"1953-01-23T12:15:00Z - some text - 127.0.0.1\"\n| DISSECT a \"%'{Y}-%{M}-%{D}T%{h}:%{m}:%{s}Z - %{msg} - %{ip}'\"\n``` ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.drop": "DROP", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.drop.markdown": "### DROP\nテーブルから列を削除するには、DROPを使用します。\n \n```\nFROM employees\n| DROP height\n```\n\n各列を名前で指定するのではなく、ワイルドカードを使って、パターンと一致する名前の列をすべて削除することができます。\n\n```\nFROM employees\n| DROP height*\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.e": "E", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.e.markdown": "\n\n ### E\n オイラー数を返します。\n\n ```\n ROW E()\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ends_with": "ENDS_WITH", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ends_with.markdown": "\n\n ### ENDS_WITH\n キーワード文字列が他の文字列で終わるかどうかを示すブール値を返します。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL ln_E = ENDS_WITH(last_name, \"d\")\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.enrich": "ENRICH", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.enrich.markdown": "### ENRICH\nENRICH`を使用すると、既存のインデックスのデータを受信レコードに追加することができます。[インジェストエンリッチ](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html)と似ていますが、クエリー時に動作します。\n\n```\nROW language_code = \"1\"\n| ENRICH languages_policy\n```\n\nENRICHでは、[エンリッチポリシー](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html#enrich-policy)を実行する必要があります。エンリッチポリシーは、一致フィールド (キーフィールド) とエンリッチフィールドのセットを定義します。\n\nENRICHは、一致フィールド値に基づいて、[エンリッチインデックス](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html#enrich-index)のレコードを検索します。入力データセットの一致するキーは、ON を使用して定義できます。指定しない場合は、エンリッチポリシーで定義された一致フィールドと同じ名前のフィールドで一致が実行されます。\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a\n```\n\nWITH , ...構文を使用して、結果に追加される属性(ポリシーでエンリッチフィールドとして定義された属性の間)を指定できます。\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a WITH language_name\n```\n\n属性の名前は、WITH new_name=を使用して変更できます。\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a WITH name = language_name\n```\n\nデフォルトでは、(WITHが定義されていない場合)、ENRICHはエンリッチポリシーで定義されたすべてのエンリッチフィールドを結果に追加します。\n\n名前の競合が発生した場合、新しく作成されたフィールドが既存のフィールドを上書きします。\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.eval": "EVAL", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.eval.markdown": "### EVAL\nEVALでは、新しい列を追加できます。\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| EVAL height_feet = height * 3.281, height_cm = height * 100\n```\n\n指定した列がすでに存在する場合、既存の列は削除され、新しい列がテーブルに追加されます。\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| EVAL height = height * 3.281\n```\n\n#### 関数\nEVALは値を計算するためのさまざまな関数をサポートしています。関数をクリックすると詳細が表示されます。\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.floor": "FLOOR", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.floor.markdown": "\n\n ### FLOOR\n 最も近い整数に数値を切り捨てます。\n\n ```\n ROW a=1.8\n | EVAL a=FLOOR(a)\n ```\n 注:これはlong(符号なしを含む)とintegerのnoopです。\n doubleの場合、Math.floorと同様に、整数に最も近いdoubleの値を選びます。\n \n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.from": "FROM", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.from_base64": "FROM_BASE64", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.from_base64.markdown": "\n\n ### FROM_BASE64\n base64文字列をデコードします。\n\n ```\n row a = \"ZWxhc3RpYw==\" \n | eval d = from_base64(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.from.markdown": "### FROM\nソースコマンドFROMは、データストリーム、インデックス、またはエイリアスから、最大10,000ドキュメントを含むテーブルを返します。結果のテーブルの各行はドキュメントを表します。各列はフィールドに対応し、そのフィールドの名前でアクセスできます。\n\n```\nFROM employees\n```\n\n[日付演算](https://www.elastic.co/guide/en/elasticsearch/reference/current/api-conventions.html#api-date-math-index-names) を使用して、インデックス、エイリアス、データストリームを参照できます。これは時系列データの場合に便利です。\n\nカンマ区切りのリストまたはワイルドカードを使用して、複数のデータストリーム、インデックス、またはエイリアスをクエリーします。\n\n```\nFROM employees-00001,employees-*\n```\n\n#### メタデータ\n\nES|QLは以下のメタデータフィールドにアクセスできます。\n\n* `_index`:ドキュメントが属するインデックス。このフィールドはkeyword型です。\n* `_id`:ソースドキュメントのID。このフィールドはkeyword型です。### `_version`:ソースドキュメントのバージョン。フィールドの型はlongです。\n\nメタデータフィールドを有効にするには、METADATAディレクティブを使います。\n\n```\nFROM index [METADATA _index, _id]\n```\n\nメタデータフィールドは、データのソースがインデックスである場合にのみ使用できます。その結果、FROMはMETADATAディレクティブをサポートする唯一のソースコマンドです。\n\nこのフィールドが有効になると、他のインデックスフィールドと同様に、後続の処理コマンドで利用できるようになります。\n\n```\nFROM ul_logs, apps [METADATA _index, _version]\n| WHERE id IN (13, 14) AND _version == 1\n| EVAL key = CONCAT(_index, \"_\", TO_STR(id))\n| SORT id, _index\n| KEEP id, _index, _version, key\n```\n\nまた、インデックス・フィールドと同様に、一度集約が実行されると、グループ化フィールドとして使用されないかぎり、メタデータフィールドは後続のコマンドからはアクセスできなくなります。\n\n```\nFROM employees [METADATA _index, _id]\n| STATS max = MAX(emp_no) BY _index\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.greatest": "GREATEST", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.greatest.markdown": "\n\n ### GREATEST\n 多数の列から最大値を返します。これはMV_MAX\n と似ていますが、一度に複数の列に対して実行します。\n\n ```\n ROW a = 10, b = 20\n | EVAL g = GREATEST(a, b)\n ```\n 注:keywordまたはtextフィールドに対して実行すると、アルファベット順の最後の文字列を返します。boolean列に対して実行すると、値がtrueの場合にtrueを返します。\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.grok": "GROK", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.grok.markdown": "### GROK\nGROKを使うと、文字列から構造化データを抽出できます。GROKは正規表現に基づいて文字列をパターンと一致させ、指定されたパターンを列として抽出します。\n\ngrokパターンの構文については、 [grokプロセッサードキュメント](https://www.elastic.co/guide/en/elasticsearch/reference/current/grok-processor.html)を参照してください。\n\n```\nROW a = \"12 15.5 15.6 true\"\n| GROK a \"%'{NUMBER:b:int}' %'{NUMBER:c:float}' %'{NUMBER:d:double}' %'{WORD:e:boolean}'\"\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.inOperator": "IN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.inOperator.markdown": "### IN\nIN演算子は、フィールドや式がリテラル、フィールド、式のリストの要素と等しいかどうかをテストすることができます。\n\n```\nROW a = 1, b = 4, c = 3\n| WHERE c-a IN (3, b / 2, a)\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ip_prefix": "IP_PREFIX", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ip_prefix.markdown": "\n\n ### IP_PREFIX\n IPを特定のプレフィックス長に切り詰めます。\n\n ```\n row ip4 = to_ip(\"1.2.3.4\"), ip6 = to_ip(\"fe80::cae2:65ff:fece:feb9\")\n | eval ip4_prefix = ip_prefix(ip4, 24, 0), ip6_prefix = ip_prefix(ip6, 0, 112);\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.keep": "KEEP", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.keep.markdown": "### KEEP\nKEEPコマンドは、返される列と、列が返される順序を指定することができます。\n\n返される列を制限するには、カンマで区切りの列名リストを使用します。列は指定された順序で返されます。\n \n```\nFROM employees\n| KEEP first_name, last_name, height\n```\n\n各列を名前で指定するのではなく、ワイルドカードを使って、パターンと一致する名前の列をすべて返すことができます。\n\n```\nFROM employees\n| KEEP h*\n```\n\nアスタリスクワイルドカード(*)は単独で、他の引数と一致しないすべての列に変換されます。このクエリーは、最初にhで始まる名前の列をすべて返し、その後にその他の列をすべて返します。\n\n```\nFROM employees\n| KEEP h*, *\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.least": "LEAST", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.least.markdown": "\n\n ### LEAST\n 多数の列から最小値を返します。これはMV_MINと似ていますが、一度に複数の列に対して実行します。\n\n ```\n ROW a = 10, b = 20\n | EVAL l = LEAST(a, b)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.left": "LEFT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.left.markdown": "\n\n ### LEFT\n stringから左から順にlength文字を抜き出したサブ文字列を返します。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL left = LEFT(last_name, 3)\n | SORT last_name ASC\n | LIMIT 5\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.length": "LENGTH", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.length.markdown": "\n\n ### LENGTH\n 文字列の文字数を返します。\n\n ```\n FROM employees\n | KEEP first_name, last_name\n | EVAL fn_length = LENGTH(first_name)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.limit": "LIMIT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.limit.markdown": "### LIMIT\nLIMIT`処理コマンドは行数を制限することができます。\n \n```\nFROM employees\n| LIMIT 5\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.locate": "LOCATE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.locate.markdown": "\n\n ### LOCATE\n 別の文字列内のキーワードサブ文字列の位置を示す整数を返します。\n\n ```\n row a = \"hello\"\n | eval a_ll = locate(a, \"ll\")\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.log": "LOG", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.log.markdown": "\n\n ### LOG\n 基数に対する値の対数を返します。入力は任意の数値で、戻り値は常にdoubleです。\n\n ゼロの対数、負数、1の基数はnullと警告を返します。\n\n ```\n ROW base = 2.0, value = 8.0\n | EVAL s = LOG(base, value)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.log10": "LOG10", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.log10.markdown": "\n\n ### LOG10\n 基数10に対する値の対数を返します。入力は任意の数値で、戻り値は常にdoubleです。\n\n 0の対数および負数はnullと警告を返します。\n\n ```\n ROW d = 1000.0 \n | EVAL s = LOG10(d)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ltrim": "LTRIM", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ltrim.markdown": "\n\n ### LTRIM\n 文字列から先頭の空白を取り除きます。\n\n ```\n ROW message = \" some text \", color = \" red \"\n | EVAL message = LTRIM(message)\n | EVAL color = LTRIM(color)\n | EVAL message = CONCAT(\"'\", message, \"'\")\n | EVAL color = CONCAT(\"'\", color, \"'\")\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.markdown": "## ES|QL\n\nES|QL(Elasticsearch クエリー言語)クエリーは、パイプ文字の|で区切られた一連のコマンドで構成されます。各クエリーは**ソースコマンド**で始まり、通常はElasticsearchのデータを使ってテーブルを生成します。\n\nソースコマンドには、1つ以上の**処理コマンド**を続けることができます。処理コマンドは、行や列を追加、削除、変更することで、前のコマンドの出力テーブルを変更することができます。\n\n```\nsource-command\n| processing-command1\n| processing-command2\n```\n\nクエリーの結果は、最終的な処理コマンドによって生成されるテーブルです。 \n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.maxFunction": "MAX", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.maxFunction.markdown": "### MAX\n数値式の最大値を返します。\n\n```\nFROM employees\n| STATS MAX(languages)\n```\n\n式はインライン関数を使用できます。たとえば、複数値列の平均に対して最大値を計算するには、まず、MV_AVGを使用して行ごとに複数の値の平均を求め、その結果にMAX関数を適用します。\n\n```\nFROM employees\n| STATS max_avg_salary_change = MAX(MV_AVG(salary_change))\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.medianAbsoluteDeviationFunction": "MEDIAN_ABSOLUTE_DEVIATION", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.medianAbsoluteDeviationFunction.markdown": "### MEDIAN_ABSOLUTE_DEVIATION\n絶対偏差の中央値で、ばらつきを表す指標を返します。これはロバスト統計量であり、外れ値があったり、正規分布していない可能性があるデータを説明するのに有用です。このようなデータでは、標準偏差よりもわかりやすくなります。\n\nこれは、サンプル全体の中央値からの各データポイントの偏差の中央値として計算されます。つまり、確率変数Xに対して、絶対偏差の中央値はmedian(|median(X) - X|)です。\n\n```\nFROM employees\n| STATS MEDIAN(salary), MEDIAN_ABSOLUTE_DEVIATION(salary)\n```\n\n注:PERCENTILEと同様に、通常、MEDIAN_ABSOLUTE_DEVIATIONはTDigestアルゴリズムに基づく近似値です。MEDIAN_ABSOLUTE_DEVIATIONも非決定論的です。つまり、同じデータでも微妙に異なる結果が得られる可能性があります。\n\n式はインライン関数を使用できます。たとえば、複数値列の最大値の中央絶対偏差を計算するには、まず、MV_MAXを使用して行ごとの最大値を取得し、その結果に対してMEDIAN_ABSOLUTE_DEVIATION関数を使用します。\n\n```\nFROM employees\n| STATS m_a_d_max_salary_change = MEDIAN_ABSOLUTE_DEVIATION(MV_MAX(salary_change))\n```\n\n", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.medianFunction": "MEDIAN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.medianFunction.markdown": "### MEDIAN\n全数値の半分より大きく、全数値の半分より小さい値で、50%パーセンタイルとも呼ばれる値を返します。\n\n**注:**PERCENTILEと同様に、通常MEDIANはTDigestアルゴリズムに基づく近似値です。\n\n**警告:** MEDIANは[非決定性](https://en.wikipedia.org/wiki/Nondeterministic_algorithm)です。つまり、同じデータでも微妙に異なる結果が得られる可能性があります。\n\n例:\n\n```\nFROM employees\n| STATS MEDIAN(salary), PERCENTILE(salary, 50)\n```\n\n式はインライン関数を使用できます。たとえば、複数値列の最大値の中央値を計算するには、まず、MV_MAXを使用して行ごとに最大値を求め、その結果にMEDIAN関数を適用します。\n\n```\nFROM employees\n| STATS median_max_salary_change = MEDIAN(MV_MAX(salary_change))\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.minFunction": "MIN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.minFunction.markdown": "### MIN\n数値フィールドの最小値を返します。\n\n```\nFROM employees\n| STATS MIN(languages)\n```\n\n式はインライン関数を使用できます。たとえば、複数値列の平均に対して最小値を計算するには、まず、MV_AVGを使用して行ごとに複数の値の平均を求め、その結果にMIN関数を適用します。\n\n```\nFROM employees\n| STATS min_avg_salary_change = MIN(MV_AVG(salary_change))\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_append": "MV_APPEND", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_append.markdown": "\n\n ### MV_APPEND\n 2つの複数値フィールドの値を連結します\n\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_avg": "MV_AVG", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_avg.markdown": "\n\n ### MV_AVG\n 複数値フィールドを、すべての値の平均を含む単一値フィールドに変換します。\n\n ```\n ROW a=[3, 5, 1, 6]\n | EVAL avg_a = MV_AVG(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_concat": "MV_CONCAT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_concat.markdown": "\n\n ### MV_CONCAT\n 複数値文字列式を、区切り文字で区切られたすべての値を連結した単一値列に変換します。\n\n ```\n ROW a=[\"foo\", \"zoo\", \"bar\"]\n | EVAL j = MV_CONCAT(a, \", \")\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_count": "MV_COUNT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_count.markdown": "\n\n ### MV_COUNT\n 複数値式を、値の数をカウントする単一値列に変換します。\n\n ```\n ROW a=[\"foo\", \"zoo\", \"bar\"]\n | EVAL count_a = MV_COUNT(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_dedupe": "MV_DEDUPE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_dedupe.markdown": "\n\n ### MV_DEDUPE\n 複数値フィールドから重複する値を削除します。\n\n ```\n ROW a=[\"foo\", \"foo\", \"bar\", \"foo\"]\n | EVAL dedupe_a = MV_DEDUPE(a)\n ```\n 注:MV_DEDUPEは列の値をソートすることがありますが、常にソートするわけではありません。\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_first": "MV_FIRST", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_first.markdown": "\n\n ### MV_FIRST\n \n 複数値式を、最初の値を含む単一値列に変換します。これは、SPLITなどの既知の順序で複数値列を発行する関数から読み取るときに役立ちます。\n \n\n 複数値フィールドが基本ストレージから読み取られる順序は保証されません。\n \n 通常は昇順ですが、必ずしもそうであるわけではありません。最小値が必要な場合は、MV_FIRSTの代わりに、MV_MINを使用します。\n MV_MINは、ソートされた値向けに最適化されているため、\n MV_FIRSTにパフォーマンスの利点はありません。\n\n ```\n ROW a=\"foo;bar;baz\"\n | EVAL first_a = MV_FIRST(SPLIT(a, \";\"))\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_last": "MV_LAST", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_last.markdown": "\n\n ### MV_LAST\n \n 複数値式を、最後の値を含む単一値列に変換します。これは、SPLITなどの既知の順序で複数値列を発行する関数から読み取るときに役立ちます。\n \n\n 複数値フィールドが基本ストレージから読み取られる順序は保証されません。\n \n 通常は昇順ですが、必ずしもそうであるわけではありません。最大値が必要な場合は、MV_LASTの代わりに、MV_MAXを使用します。\n MV_MAXは、ソートされた値向けに最適化されているため、\n MV_LASTにパフォーマンスの利点はありません。\n\n ```\n ROW a=\"foo;bar;baz\"\n | EVAL last_a = MV_LAST(SPLIT(a, \";\"))\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_max": "MV_MAX", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_max.markdown": "\n\n ### MV_MAX\n 複数値フィールドを、最大値を含む単一値フィールドに変換します。\n\n ```\n ROW a=[3, 5, 1]\n | EVAL max_a = MV_MAX(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_median": "MV_MEDIAN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_median.markdown": "\n\n ### MV_MEDIAN\n 複数値フィールドを、中央値を含む単一値フィールドに変換します。\n\n ```\n ROW a=[3, 5, 1]\n | EVAL median_a = MV_MEDIAN(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_min": "MV_MIN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_min.markdown": "\n\n ### MV_MIN\n 複数値フィールドを、最小値を含む単一値フィールドに変換します。\n\n ```\n ROW a=[2, 1]\n | EVAL min_a = MV_MIN(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_slice": "MV_SLICE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_slice.markdown": "\n\n ### MV_SLICE\n 開始インデックス値と終了インデックス値を使用して、複数値フィールドのサブセットを返します。\n\n ```\n row a = [1, 2, 2, 3]\n | eval a1 = mv_slice(a, 1), a2 = mv_slice(a, 2, 3)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_sort": "MV_SORT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_sort.markdown": "\n\n ### MV_SORT\n 辞書の順序で複数値フィールドを並べ替えます。\n\n ```\n ROW a = [4, 2, -3, 2]\n | EVAL sa = mv_sort(a), sd = mv_sort(a, \"DESC\")\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_sum": "MV_SUM", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_sum.markdown": "\n\n ### MV_SUM\n 複数値フィールドを、すべての値の合計を含む単一値フィールドに変換します。\n\n ```\n ROW a=[3, 5, 6]\n | EVAL sum_a = MV_SUM(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_zip": "MV_ZIP", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_zip.markdown": "\n\n ### MV_ZIP\n 値を結合する区切り文字を使用して、2つの複数値フィールドの値を結合します。\n\n ```\n ROW a = [\"x\", \"y\", \"z\"], b = [\"1\", \"2\"]\n | EVAL c = mv_zip(a, b, \"-\")\n | KEEP a, b, c\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mvExpand": "MV_EXPAND", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mvExpand.markdown": "### MV_EXPAND\nMV_EXPAND処理コマンドは、複数値フィールドを値ごとに1行に展開し、他のフィールドを複製します。 \n```\nROW a=[1,2,3], b=\"b\", j=[\"a\",\"b\"]\n| MV_EXPAND a\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.now": "NOW", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.now.markdown": "\n\n ### NOW\n 現在の日付と時刻を返します。\n\n ```\n ROW current_date = NOW()\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.percentileFunction": "PERCENTILE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.percentileFunction.markdown": "### PERCENTILE\n観測値の特定の割合で発生する値。たとえば、95パーセンタイルは観測値の95%より大きい値で、50パーセンタイルはMEDIAN`です。\n\n```\nFROM employees\n| STATS p0 = PERCENTILE(salary, 0)\n , p50 = PERCENTILE(salary, 50)\n , p99 = PERCENTILE(salary, 99)\n```\n\n**注**:PERCENTILEは通常TDigestアルゴリズムに基づく近似値です。\n\n**警告:**PERCENTILEは[非決定性](https://en.wikipedia.org/wiki/Nondeterministic_algorithm)です。つまり、同じデータでも微妙に異なる結果が得られる可能性があります。\n\n式はインライン関数を使用できます。たとえば、複数値列の最大値のパーセンタイルを計算するには、まず、MV_MAXを使用して行ごとの最大値を取得し、その結果に対してMEDIAN_ABSOLUTE_DEVIATION関数を使用します。\n\n```\nFROM employees\n| STATS p80_max_salary_change = PERCENTILE(MV_MAX(salary_change), 80)\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.pi": "PI", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.pi.markdown": "\n\n ### PI\n 円の円周と直径の比率であるPiを返します。\n\n ```\n ROW PI()\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.pow": "POW", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.pow.markdown": "\n\n ### POW\n exponentのべき乗にしたbaseの値を返します。\n\n ```\n ROW base = 2.0, exponent = 2\n | EVAL result = POW(base, exponent)\n ```\n 注:ここでは、倍精度浮動小数点数の結果でもオーバーフローする可能性があります。その場合は、NULLが返されます。\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.predicates": "NULL値", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.predicates.markdown": "### NULL値\nNULLの比較には、IS NULLとIS NOT NULL述語を使います。\n\n```\nFROM employees\n| WHERE birth_date IS NULL\n| KEEP first_name, last_name\n| SORT first_name\n| LIMIT 3\n```\n\n```\nFROM employees\n| WHERE is_rehired IS NOT NULL\n| STATS count(emp_no)\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.rename": "RENAME", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.rename.markdown": "### RENAME\nRENAMEを使用して、次の構文で列の名前を変更します。\n\n```\nRENAME AS \n```\n\n例:\n\n```\nFROM employees\n| KEEP first_name, last_name, still_hired\n| RENAME still_hired AS employed\n```\n\n新しい名前の列がすでに存在する場合、その列は新しい列に置き換えられます。\n\n複数の列の名前を1つのRENAMEコマンドで変更することができます。\n\n```\nFROM employees\n| KEEP first_name, last_name\n| RENAME first_name AS fn, last_name AS ln\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.repeat": "REPEAT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.repeat.markdown": "\n\n ### REPEAT\n 指定したnumberの回数、文字列stringとそれ自身を連結して構成された文字列を返します。\n\n ```\n ROW a = \"Hello!\"\n | EVAL triple_a = REPEAT(a, 3);\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.replace": "REPLACE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.replace.markdown": "\n\n ### REPLACE\n \n この関数は、正規表現regexと置換文字列newStrの任意の一致を文字列strに代入します。\n\n ```\n ROW str = \"Hello World\"\n | EVAL str = REPLACE(str, \"World\", \"Universe\")\n | KEEP str\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.right": "RIGHT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.right.markdown": "\n\n ### RIGHT\n strのうち右から数えてlength文字までのサブ文字列を返します。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL right = RIGHT(last_name, 3)\n | SORT last_name ASC\n | LIMIT 5\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.round": "ROUND", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.round.markdown": "\n\n ### ROUND\n 数値を指定した小数点以下の桁数に丸めます。\n デフォルトは0で、最も近い整数を返します。\n 精度が負の場合、小数点以下の桁数に丸めます。\n \n\n ```\n FROM employees\n | KEEP first_name, last_name, height\n | EVAL height_ft = ROUND(height * 3.281, 1)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.row": "ROW", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.row.markdown": "### ROW\nROWソースコマンドは、指定した値の列を1つ以上含む行を作成します。これはテストの場合に便利です。\n \n```\nROW a = 1, b = \"two\", c = null\n```\n\n複数の値を含む列を作成するには角括弧を使用します。\n\n```\nROW a = [2, 1]\n```\n\nROWは関数の使用をサポートしています。\n\n```\nROW a = ROUND(1.23, 0)\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.rtrim": "RTRIM", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.rtrim.markdown": "\n\n ### RTRIM\n 文字列から末尾の空白を取り除きます。\n\n ```\n ROW message = \" some text \", color = \" red \"\n | EVAL message = RTRIM(message)\n | EVAL color = RTRIM(color)\n | EVAL message = CONCAT(\"'\", message, \"'\")\n | EVAL color = CONCAT(\"'\", color, \"'\")\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.show": "SHOW", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.show.markdown": "### SHOW\nSHOW ソースコマンドはデプロイとその能力に関する情報を返します。\n\n* デプロイのバージョン、ビルド日、ハッシュを返すには、SHOW INFOを使用します。\n* SHOW FUNCTIONSを使用すると、サポートされているすべての関数のリストと各関数の概要を返します。\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.signum": "SIGNUM", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.signum.markdown": "\n\n ### SIGNUM\n 任意の数値の符号を返します。\n 負の数値の場合は-1を返します。0の場合は0を返します。正の数値の場合は1を返します。\n\n ```\n ROW d = 100.0\n | EVAL s = SIGNUM(d)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sin": "SIN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sin.markdown": "\n\n ### SIN\n 角度の正弦三角関数を返します。\n\n ```\n ROW a=1.8 \n | EVAL sin=SIN(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sinh": "SINH", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sinh.markdown": "\n\n ### SINH\n 角度の双曲線正弦を返します。\n\n ```\n ROW a=1.8 \n | EVAL sinh=SINH(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sort": "SORT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sort.markdown": "### SORT\nSORTコマンドを使用すると、1つ以上のフィールドで行をソートすることができます。\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height\n```\n\nデフォルトのソート順は昇順です。ASCまたはDESCを使って明示的なソート順を設定します。\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height DESC\n```\n\n2つの行のソートキーが同じ場合、元の順序が保持されます。タイブレーカーとなるソート式を追加で指定できます。\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height DESC, first_name ASC\n```\n\n#### null値\nデフォルトでは、null値は他のどの値よりも大きい値として扱われます。昇順のソートではnull値は最後にソートされ、降順のソートではnull値は最初にソートされます。NULLS FIRSTまたはNULLS LASTを指定することで変更できます。\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT first_name ASC NULLS FIRST\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.split": "SPLIT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.split.markdown": "\n\n ### SPLIT\n 単一の値の文字列を複数の文字列に分割します。\n\n ```\n ROW words=\"foo;bar;baz;qux;quux;corge\"\n | EVAL word = SPLIT(words, \";\")\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sqrt": "SQRT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sqrt.markdown": "\n\n ### SQRT\n 数値の平方根を返します。入力は任意の数値で、戻り値は常にdoubleです。\n 負数と無限大の平方根はnullです。\n\n ```\n ROW d = 100.0\n | EVAL s = SQRT(d)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_contains": "ST_CONTAINS", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_contains.markdown": "\n\n ### ST_CONTAINS\n 最初のジオメトリに2番目のジオメトリが含まれるかどうかを返します。\n これはST_WITHIN関数の逆関数です。\n\n ```\n FROM airport_city_boundaries\n | WHERE ST_CONTAINS(city_boundary, TO_GEOSHAPE(\"POLYGON((109.35 18.3, 109.45 18.3, 109.45 18.4, 109.35 18.4, 109.35 18.3))\"))\n | KEEP abbrev, airport, region, city, city_location\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_disjoint": "ST_DISJOINT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_disjoint.markdown": "\n\n ### ST_DISJOINT\n 2つのジオメトリまたはジオメトリ列が結合解除されているかどうかを返します。\n これはST_INTERSECTS関数の逆関数です。\n 数学的には次のようになります。ST_Disjoint(A, B) ⇔ A ⋂ B = ∅\n\n ```\n FROM airport_city_boundaries\n | WHERE ST_DISJOINT(city_boundary, TO_GEOSHAPE(\"POLYGON((-10 -60, 120 -60, 120 60, -10 60, -10 -60))\"))\n | KEEP abbrev, airport, region, city, city_location\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_distance": "ST_DISTANCE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_distance.markdown": "\n\n ### ST_DISTANCE\n 2点間の距離を計算します。\n デカルト幾何学の場合、これは元の座標と同じ単位でのピタゴラス距離です。\n 地理的幾何学では、これはメートル単位での円に沿った円周距離です。\n\n ```\n FROM airports\n | WHERE abbrev == \"CPH\"\n | EVAL distance = ST_DISTANCE(location, city_location)\n | KEEP abbrev, name, location, city_location, distance\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_intersects": "ST_INTERSECTS", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_intersects.markdown": "\n\n ### ST_INTERSECTS\n 2つのジオメトリが交差している場合はTrueを返します。\n 内部点を含め、共通の点がある場合は交差しています\n (線に沿った点または多角形内の点)。\n これはST_DISJOINT関数の逆関数です。\n 数学的には次のようになります。ST_Intersects(A, B) ⇔ A ⋂ B ≠ ∅\n\n ```\n FROM airports\n | WHERE ST_INTERSECTS(location, TO_GEOSHAPE(\"POLYGON((42 14, 43 14, 43 15, 42 15, 42 14))\"))\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_within": "ST_WITHIN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_within.markdown": "\n\n ### ST_WITHIN\n 最初のジオメトリが2番目のジオメトリ内にあるかどうかを返します。\n これはST_CONTAINS関数の逆関数です。\n\n ```\n FROM airport_city_boundaries\n | WHERE ST_WITHIN(city_boundary, TO_GEOSHAPE(\"POLYGON((109.1 18.15, 109.6 18.15, 109.6 18.65, 109.1 18.65, 109.1 18.15))\"))\n | KEEP abbrev, airport, region, city, city_location\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_x": "ST_X", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_x.markdown": "\n\n ### ST_X\n 指定された点からx座標を抽出します。\n この点がgeo_pointタイプの場合は、longitude値を抽出するのと同じ結果になります。\n\n ```\n ROW point = TO_GEOPOINT(\"POINT(42.97109629958868 14.7552534006536)\")\n | EVAL x = ST_X(point), y = ST_Y(point)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_y": "ST_Y", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_y.markdown": "\n\n ### ST_Y\n 指定された点からy座標を抽出します。\n この点がgeo_pointタイプの場合は、latitude値を抽出するのと同じ結果になります。\n\n ```\n ROW point = TO_GEOPOINT(\"POINT(42.97109629958868 14.7552534006536)\")\n | EVAL x = ST_X(point), y = ST_Y(point)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.starts_with": "STARTS_WITH", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.starts_with.markdown": "\n\n ### STARTS_WITH\n キーワード文字列が他の文字列で始まるかどうかを示すブール値を返します。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL ln_S = STARTS_WITH(last_name, \"B\")\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.statsby": "STATS ...BY", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.statsby.markdown": "### STATS ...BY\nSTATS ...BYを使用すると、共通の値に従って行をグループ化し、グループ化された行に対する1つ以上の集約値を計算します。\n\n**例**:\n\n```\nFROM employees\n| STATS count = COUNT(emp_no) BY languages\n| SORT languages\n```\n\nBYが省略された場合、出力テーブルには、データセット全体に適用された集約が正確に1行だけ含まれます。\n\n```\nFROM employees\n| STATS avg_lang = AVG(languages)\n```\n\n複数の値を計算することができます。\n\n```\nFROM employees\n| STATS avg_lang = AVG(languages), max_lang = MAX(languages)\n```\n\n複数の値でグループ化することも可能です(longおよびkeywordファミリーフィールドでのみサポート)。\n\n```\nFROM employees\n| EVAL hired = DATE_FORMAT(hire_date, \"YYYY\")\n| STATS avg_salary = AVG(salary) BY hired, languages.long\n| EVAL avg_salary = ROUND(avg_salary)\n| SORT hired, languages.long\n```\n\nSTATS ...BYで使用できる関数の一覧については、**集計関数**を参照してください。\n\n集計関数とグループ式の両方で他の関数を使用できます。これは、複数値列でSTATS...BYを使用するときに有用です。たとえば、平均給与変動を計算するには、まず、MV_AVGを使用して従業員ごとに複数の値の平均を求め、その結果にAVG関数を適用します。\n\n```\nFROM employees\n| STATS avg_salary_change = AVG(MV_AVG(salary_change))\n```\n\n式によるグループ化の例は、姓の最初の文字で従業員をグループ化することです。\n\n```\nFROM employees\n| STATS my_count = COUNT() BY LEFT(last_name, 1)\n| SORT `LEFT(last_name, 1)`\n```\n\n出力列名の指定は任意です。指定しない場合は、新しい列名が式と等しくなります。次のクエリーは列\"AVG(salary)\"を返します。\n\n```\nFROM employees\n| STATS AVG(salary)\n```\n\nこの名前には特殊文字が含まれているため、後続のコマンドで使用するときには、バッククオート(`)で囲む必要があります。\n\n```\nFROM employees\n| STATS AVG(salary)\n| EVAL avg_salary_rounded = ROUND(`AVG(salary)`)\n```\n\n**注**:グループなしのSTATSは、グループを追加するよりも大幅に高速です。\n\n**注**:単一式でのグループは、現在、複数式でのグループよりも大幅に最適化されています。\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.stCentroidFunction": "ST_CENTROID_AGG", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.stCentroidFunction.markdown": "### ST_CENTROID_AGG\n**警告:この機能はテクニカルプレビュー中であり、将来のリリースでは変更されたり削除されたりする場合があります。Elasticはすべての問題の修正に努めますが、テクニカルプレビュー中の機能には正式なGA機能のサポートSLAが適用されません。**\n\n空間点ジオメトリタイプのフィールドで、空間中心を計算します。\n\n```\nFROM airports\n| STATS centroid=ST_CENTROID_AGG(location)\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.stringOperators": "LIKEおよびRLIKE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.stringOperators.markdown": "### LIKEおよびRLIKE\nワイルドカードや正規表現を使った文字列比較にはLIKEまたはRLIKEを使います。\n\nワイルドカードを使って文字列を一致させるにはLIKEを使います。次のワイルドカード文字がサポートされています。\n\n* `*`は0文字以上と一致します。\n* `?`は1文字と一致します。\n\n```\nFROM employees\n| WHERE first_name LIKE \"?b*\"\n| KEEP first_name, last_name\n```\n\n正規表現を使って文字列を一致させるには、RLIKEを使います。\n\n```\nFROM employees\n| WHERE first_name RLIKE \".leja.*\"\n| KEEP first_name, last_name\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.substring": "SUBSTRING", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.substring.markdown": "\n\n ### SUBSTRING\n 文字列のサブ文字列を、開始位置とオプションの長さで指定して返します。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL ln_sub = SUBSTRING(last_name, 1, 3)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sumFunction": "SUM", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sumFunction.markdown": "### SUM\n数値フィールドの合計を返します。\n\n```\nFROM employees\n| STATS SUM(languages)\n```\n\n式はインライン関数を使用できます。たとえば、各従業員の最大給与変動の総計を計算するには、MV_MAX関数を各行に適用してから、その結果にSUMを適用します。\n\n```\nFROM employees\n| STATS total_salary_changes = SUM(MV_MAX(salary_change))\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.tan": "TAN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.tan.markdown": "\n\n ### TAN\n 角度の正接三角関数を返します。\n\n ```\n ROW a=1.8 \n | EVAL tan=TAN(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.tanh": "TANH", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.tanh.markdown": "\n\n ### TANH\n 角度の正接双曲線関数を返します。\n\n ```\n ROW a=1.8 \n | EVAL tanh=TANH(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.tau": "TAU", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.tau.markdown": "\n\n ### TAU\n 円の円周と半径の比率を返します。\n\n ```\n ROW TAU()\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_base64": "TO_BASE64", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_base64.markdown": "\n\n ### TO_BASE64\n 文字列をbase64文字列にエンコードします。\n\n ```\n row a = \"elastic\" \n | eval e = to_base64(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_boolean": "TO_BOOLEAN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_boolean.markdown": "\n\n ### TO_BOOLEAN\n 入力値をブール値に変換します。\n 文字列値*true*は、大文字小文字を区別せずにブール値*true*に変換されます。\n 空文字列を含むそれ以外の値に対しては、この関数は*false*を返します。\n 数値*0*は*false*に変換され、それ以外は*true*に変換されます。\n\n ```\n ROW str = [\"true\", \"TRuE\", \"false\", \"\", \"yes\", \"1\"]\n | EVAL bool = TO_BOOLEAN(str)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_cartesianpoint": "TO_CARTESIANPOINT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_cartesianpoint.markdown": "\n\n ### TO_CARTESIANPOINT\n 入力値をcartesian_point値に変換します。\n 文字列は、WKT Point形式に従っている場合にのみ、正常に変換されます。\n\n ```\n ROW wkt = [\"POINT(4297.11 -1475.53)\", \"POINT(7580.93 2272.77)\"]\n | MV_EXPAND wkt\n | EVAL pt = TO_CARTESIANPOINT(wkt)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_cartesianshape": "TO_CARTESIANSHAPE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_cartesianshape.markdown": "\n\n ### TO_CARTESIANSHAPE\n 入力値をcartesian_shape値に変換します。\n 文字列は、WKT形式に従っている場合にのみ、正常に変換されます。\n\n ```\n ROW wkt = [\"POINT(4297.11 -1475.53)\", \"POLYGON ((3339584.72 1118889.97, 4452779.63 4865942.27, 2226389.81 4865942.27, 1113194.90 2273030.92, 3339584.72 1118889.97))\"]\n | MV_EXPAND wkt\n | EVAL geom = TO_CARTESIANSHAPE(wkt)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_datetime": "TO_DATETIME", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_datetime.markdown": "\n\n ### TO_DATETIME\n 入力値を日付値に変換します。\n 文字列は、yyyy-MM-dd'T'HH:mm:ss.SSS'Z'の書式に従っている場合のみ変換が成功します。\n 日付を他の形式に変換するには、DATE_PARSEを使用します。\n\n ```\n ROW string = [\"1953-09-02T00:00:00.000Z\", \"1964-06-02T00:00:00.000Z\", \"1964-06-02 00:00:00\"]\n | EVAL datetime = TO_DATETIME(string)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_degrees": "TO_DEGREES", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_degrees.markdown": "\n\n ### TO_DEGREES\n ラジアンの数値を度数に変換します。\n\n ```\n ROW rad = [1.57, 3.14, 4.71]\n | EVAL deg = TO_DEGREES(rad)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_double": "TO_DOUBLE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_double.markdown": "\n\n ### TO_DOUBLE\n 入力値をdouble値に変換します。入力パラメーターが日付型の場合、その値はUnixのエポックからのミリ秒として解釈され、doubleに変換されます。\n \n ブール値の*true*はdouble値の*1.0*に、*false*は*0.0*に変換されます。\n\n ```\n ROW str1 = \"5.20128E11\", str2 = \"foo\"\n | EVAL dbl = TO_DOUBLE(\"520128000000\"), dbl1 = TO_DOUBLE(str1), dbl2 = TO_DOUBLE(str2)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_geopoint": "TO_GEOPOINT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_geopoint.markdown": "\n\n ### TO_GEOPOINT\n 入力値をgeo_point値に変換します。\n 文字列は、WKT Point形式に従っている場合にのみ、正常に変換されます。\n\n ```\n ROW wkt = \"POINT(42.97109630194 14.7552534413725)\"\n | EVAL pt = TO_GEOPOINT(wkt)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_geoshape": "TO_GEOSHAPE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_geoshape.markdown": "\n\n ### TO_GEOSHAPE\n 入力値をgeo_shape値に変換します。\n 文字列は、WKT形式に従っている場合にのみ、正常に変換されます。\n\n ```\n ROW wkt = \"POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))\"\n | EVAL geom = TO_GEOSHAPE(wkt)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_integer": "TO_INTEGER", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_integer.markdown": "\n\n ### TO_INTEGER\n 入力値を整数値に変換します。\n 入力パラメーターが日付型の場合、その値はUnixのエポックからのミリ秒として解釈され、整数に変換されます。\n \n ブール値*true*は整数*1*に、*false*は*0*に変換されます。\n\n ```\n ROW long = [5013792, 2147483647, 501379200000]\n | EVAL int = TO_INTEGER(long)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_ip": "TO_IP", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_ip.markdown": "\n\n ### TO_IP\n 入力文字列をIP値に変換します。\n\n ```\n ROW str1 = \"1.1.1.1\", str2 = \"foo\"\n | EVAL ip1 = TO_IP(str1), ip2 = TO_IP(str2)\n | WHERE CIDR_MATCH(ip1, \"1.0.0.0/8\")\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_long": "TO_LONG", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_long.markdown": "\n\n ### TO_LONG\n 入力値をlong値に変換します。入力パラメーターが日付型の場合、\n その値はUnixのエポックからのミリ秒として解釈され、longに変換されます。\n ブール値の*true*は*long*値の*1*に、*false*は*0*に変換されます。\n\n ```\n ROW str1 = \"2147483648\", str2 = \"2147483648.2\", str3 = \"foo\"\n | EVAL long1 = TO_LONG(str1), long2 = TO_LONG(str2), long3 = TO_LONG(str3)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_lower": "TO_LOWER", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_lower.markdown": "\n\n ### TO_LOWER\n 小文字に変換された入力文字列を表す新しい文字列を返します。\n\n ```\n ROW message = \"Some Text\"\n | EVAL message_lower = TO_LOWER(message)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_radians": "TO_RADIANS", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_radians.markdown": "\n\n ### TO_RADIANS\n 度数をラジアンに変換します。\n\n ```\n ROW deg = [90.0, 180.0, 270.0]\n | EVAL rad = TO_RADIANS(deg)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_string": "TO_STRING", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_string.markdown": "\n\n ### TO_STRING\n 入力値を文字列に変換します。\n\n ```\n ROW a=10\n | EVAL j = TO_STRING(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_unsigned_long": "TO_UNSIGNED_LONG", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_unsigned_long.markdown": "\n\n ### TO_UNSIGNED_LONG\n 入力値を符号なしlong値に変換します。入力パラメーターが日付型の場合、\n その値はUnixのエポックからのミリ秒として解釈され、符号なしlong値に変換されます。\n ブール値の*true*は符号なし*long*値の*1*に、*false*は*0*に変換されます。\n\n ```\n ROW str1 = \"2147483648\", str2 = \"2147483648.2\", str3 = \"foo\"\n | EVAL long1 = TO_UNSIGNED_LONG(str1), long2 = TO_ULONG(str2), long3 = TO_UL(str3)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_upper": "TO_UPPER", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_upper.markdown": "\n\n ### TO_UPPER\n 大文字に変換された入力文字列を表す新しい文字列を返します。\n\n ```\n ROW message = \"Some Text\"\n | EVAL message_upper = TO_UPPER(message)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_version": "TO_VERSION", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_version.markdown": "\n\n ### TO_VERSION\n 入力文字列をバージョン値に変換します。\n\n ```\n ROW v = TO_VERSION(\"1.2.3\")\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.trim": "TRIM", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.trim.markdown": "\n\n ### TRIM\n 文字列から先頭と末尾の空白を削除します。\n\n ```\n ROW message = \" some text \", color = \" red \"\n | EVAL message = TRIM(message)\n | EVAL color = TRIM(color)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.valuesFunction": "VALUES", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.valuesFunction.markdown": "### 値\n\n**警告:本番環境ではVALUESを使用しないでください。この機能はテクニカルプレビュー中であり、将来のリリースでは変更されたり削除されたりする場合があります。Elasticはすべての問題の修正に努めますが、テクニカルプレビュー中の機能には正式なGA機能のサポートSLAが適用されません。**\n\nグループのすべての値を複数値フィールドとして返します。返された値の順序は保証されません。返された値を並べ替える必要がある場合はMV_SORTを使用します。\n\ngeo_point、cartesian_point、geo_shape、またはcartesian_shapeを除く任意のタイプの式を使用できます。\n\n\n例:\n\n```\n FROM employees\n| EVAL first_letter = SUBSTRING(first_name, 0, 1)\n| STATS first_name=MV_SORT(VALUES(first_name)) BY first_letter\n| SORT first_letter\n```\n\n> _**警告:** これはメモリの使用量が非常に大きくなるため、ES|QLはメモリを超えると、集約を拡大しません。このため、この集約は、収集する値がメモリに収まらなくなるまでは機能します。収集する値が多くなりすぎると、[回路ブレーカーエラー](https://www.elastic.co/guide/en/elasticsearch/reference/current/circuit-breaker-errors.html)でクエリが失敗します。_\n\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.where": "WHERE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.where.markdown": "### WHERE\nWHEREを使用すると、入力テーブルから、指定した条件がtrueと評価されるすべての行を含むテーブルを作成します。\n \n```\nFROM employees\n| KEEP first_name, last_name, still_hired\n| WHERE still_hired == true\n```\n\n#### 演算子\n\nサポートされている演算子の概要については、**演算子**を参照してください。\n\n#### 関数\nWHEREは値を計算するためのさまざまな関数をサポートしています。**関数**をクリックすると詳細が表示されます。\n ", + "languageDocumentationPopover.documentationESQL.abs": "ABS", + "languageDocumentationPopover.documentationESQL.abs.markdown": "\n\n ### ABS\n 絶対値を返します。\n\n ```\n ROW number = -1.0 \n | EVAL abs_number = ABS(number)\n ```\n ", + "languageDocumentationPopover.documentationESQL.acos": "ACOS", + "languageDocumentationPopover.documentationESQL.acos.markdown": "\n\n ### ACOS\n nのアークコサインをラジアンで表記された角度として返します。\n\n ```\n ROW a=.9\n | EVAL acos=ACOS(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.asin": "ASIN", + "languageDocumentationPopover.documentationESQL.asin.markdown": "\n\n ### ASIN\n 入力\n 数値式のアークサインをラジアンで表記された角度として返します。\n\n ```\n ROW a=.9\n | EVAL asin=ASIN(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.atan": "ATAN", + "languageDocumentationPopover.documentationESQL.atan.markdown": "\n\n ### ATAN\n 入力\n 数値式のアークタンジェントをラジアンで表記された角度として返します。\n\n ```\n ROW a=12.9\n | EVAL atan=ATAN(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.atan2": "ATAN2", + "languageDocumentationPopover.documentationESQL.atan2.markdown": "\n\n ### ATAN2\n 直交平面上の原点から点(x , y)に向かう光線と正のx軸のなす角(ラジアン表記)。\n \n\n ```\n ROW y=12.9, x=.6\n | EVAL atan2=ATAN2(y, x)\n ```\n ", + "languageDocumentationPopover.documentationESQL.autoBucketFunction": "BUCKET", + "languageDocumentationPopover.documentationESQL.autoBucketFunction.markdown": "### バケット\n日時または数値入力から、値(バケット)のグループを作成します。バケットのサイズは直接指定するか、推奨される数と値の範囲に基づいて選択できます。\n\nBUCKETは次の2つのモードで動作します。\n\n1.バケットのサイズがバケット数の提案(4つのパラメーター)と範囲に基づいて計算される。\n2.バケットサイズが直接指定される(2つのパラメーター)。\n\n目標バケット数、開始日、終了日を使用すると、目標バケット数以下のバケットを生成するために適切なバケットサイズがBUCKETによって選択されます。\n\nたとえば、1年に最大20バケットをリクエストすると、データが1か月間隔で整理されます。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT hire_date\n```\n\n**注**:ここでは、正確な目標バケット数を指定するのではなく、目標バケット数を_上限_として範囲を指定します。\n\nBUCKETを集約と組み合わせ、ヒストグラムを作成できます。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_month = COUNT(*) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT month\n```\n\n**注**:BUCKETは、どのドキュメントにも一致しないバケットを作成しません。そのため、前の例では1985-03-01やその他の日付が抜けています。\n\nその他のバケットを要求すると、範囲が小さくなることがあります。たとえば、1年に最大100バケットをリクエストすると、1週間単位のバケットになります。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 100, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT week\n```\n\n**注**:AUTO_BUCKETは行をフィルタリングしません。指定された範囲のみを使用して、適切なバケットサイズを選択します。範囲外の値の行に対しては、範囲外のバケツに対応するバケット値を返します。行をフィルタリングするには、BUCKETとWHEREを組み合わせます。\n\n事前に任意のバケットサイズがわかっている場合は、2番目の引数として指定し、範囲を除外します。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 1 week)\n| SORT week\n```\n\n**注**:バケットサイズを2番目のパラメーターとして指定するときには、時間の期間または日付の期間を選択する必要があります。\n\nBUCKETは数値フィールドでも動作します。たとえば、給与ヒストグラムを作成します。\n\n```\nFROM employees\n| STATS COUNT(*) by bs = BUCKET(salary, 20, 25324, 74999)\n| SORT bs\n```\n\n日付範囲で意図的フィルタリングする前の例とは異なり、数値フィールドでフィルタリングすることはほとんどありません。最小値と最大値を別々に見つける必要があります。ES|QLにはそれを自動的に実行するための簡単な方法がありません。\n\n任意のバケットサイズが事前にわかっている場合は、範囲を省略できます。2番目の引数として指定します。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS c = COUNT(1) BY b = BUCKET(salary, 5000.)\n| SORT b\n```\n\n**注**:バケットサイズを2番目のパラメーターとして指定するときには、**浮動小数点数型**でなければなりません。\n\n次の例は、過去24時間の1時間単位のバケットを作成し、1時間当たりのイベント数を計算します。\n\n```\nFROM sample_data\n| WHERE @timestamp >= NOW() - 1 day and @timestamp < NOW()\n| STATS COUNT(*) BY bucket = BUCKET(@timestamp, 25, NOW() - 1 day, NOW())\n```\n\n次の例は、1985年の1か月単位のバケットを作成し、採用月別に平均給与を計算します。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS AVG(salary) BY bucket = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT bucket\n```\n\n集約部で関数が**グループ部で定義されたエイリアスによって参照されている**場合、またはまったく同じ式で呼び出されている場合、BUCKETは、 STATS …​ BY …コマンドの集約部とグループ部の両方で使用できます。\n\n例:\n\n```\nFROM employees\n| STATS s1 = b1 + 1, s2 = BUCKET(salary / 1000 + 999, 50.) + 2 BY b1 = BUCKET(salary / 100 + 99, 50.), b2 = BUCKET(salary / 1000 + 999, 50.)\n| SORT b1, b2\n| KEEP s1, b1, s2, b2\n```\n ", + "languageDocumentationPopover.documentationESQL.avgFunction": "AVG", + "languageDocumentationPopover.documentationESQL.avgFunction.markdown": "### AVG\n数値フィールドの平均を返します。\n\n```\nFROM employees\n| STATS AVG(height)\n```\n\n式はインライン関数を使用できます。たとえば、複数値列で平均を計算するには、まず、MV_AVGを使用して行ごとに複数の値の平均を求め、その結果にAVG関数を適用します。\n\n```\nFROM employees\n| STATS avg_salary_change = AVG(MV_AVG(salary_change))\n```\n ", + "languageDocumentationPopover.documentationESQL.binaryOperators": "バイナリ演算子", + "languageDocumentationPopover.documentationESQL.binaryOperators.markdown": "### バイナリ演算子\n次のバイナリ比較演算子がサポートされています。\n\n* 等号:`==`\n* 不等号:`!=`\n* より小さい:`<`\n* 以下:`<=`\n* より大きい:`>`\n* 以上:`>=`\n* 加算:`+`\n* 減算:`-`\n* 乗算:`*`\n* 除算:`/`\n* 係数:`%`\n ", + "languageDocumentationPopover.documentationESQL.booleanOperators": "ブール演算子", + "languageDocumentationPopover.documentationESQL.booleanOperators.markdown": "### ブール演算子\n次のブール演算子がサポートされています。\n\n* `AND`\n* `OR`\n* `NOT`\n ", + "languageDocumentationPopover.documentationESQL.bucket": "BUCKET", + "languageDocumentationPopover.documentationESQL.bucket.markdown": "\n\n ### BUCKET\n 日時または数値入力から、値(バケット)のグループを作成します。\n バケットのサイズは直接指定するか、推奨される数と値の範囲に基づいて選択できます。\n\n ```\n FROM employees\n | WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n | STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n | SORT hire_date\n ```\n ", + "languageDocumentationPopover.documentationESQL.case": "CASE", + "languageDocumentationPopover.documentationESQL.case.markdown": "\n\n ### CASE\n 条件と値のペアを指定できます。この関数は、trueと評価される\n 最初の条件に属する値を返します。\n\n 引数の数が奇数の場合、最後の引数は条件に一致しない場合に返されるデフォルト値になります。\n 引数の数が偶数で、\n 条件が一致しない場合、この関数はnullを返します。\n\n ```\n FROM employees\n | EVAL type = CASE(\n languages <= 1, \"monolingual\",\n languages <= 2, \"bilingual\",\n \"polyglot\")\n | KEEP emp_no, languages, type\n ```\n ", + "languageDocumentationPopover.documentationESQL.castOperator": "Cast (::)", + "languageDocumentationPopover.documentationESQL.castOperator.markdown": "### CAST (`::`)\n::演算子はO_型変換関数に代わる便利な構文です。\n\n例:\n```\nROW ver = CONCAT((\"0\"::INT + 1)::STRING, \".2.3\")::VERSION\n```\n ", + "languageDocumentationPopover.documentationESQL.cbrt": "CBRT", + "languageDocumentationPopover.documentationESQL.cbrt.markdown": "\n\n ### CBRT\n 数値の立方根を返します。入力は任意の数値で、戻り値は常にdoubleです。\n 無限大の立方根はnullです。\n\n ```\n ROW d = 1000.0\n | EVAL c = cbrt(d)\n ```\n ", + "languageDocumentationPopover.documentationESQL.ceil": "CEIL", + "languageDocumentationPopover.documentationESQL.ceil.markdown": "\n\n ### CEIL\n 最も近い整数に数値を切り上げます。\n\n ```\n ROW a=1.8\n | EVAL a=CEIL(a)\n ```\n 注:これはlong(符号なしを含む)とintegerのnoopです。doubleの場合、JavaのMath.ceilと同様に、整数に最も近いdoubleの値を選びます。\n ", + "languageDocumentationPopover.documentationESQL.cidr_match": "CIDR_MATCH", + "languageDocumentationPopover.documentationESQL.cidr_match.markdown": "\n\n ### CIDR_MATCH\n 指定されたIPが指定されたCIDRブロックのいずれかに含まれていればtrueを返します。\n\n ```\n FROM hosts \n | WHERE CIDR_MATCH(ip1, \"127.0.0.2/32\", \"127.0.0.3/32\") \n | KEEP card, host, ip0, ip1\n ```\n ", + "languageDocumentationPopover.documentationESQL.coalesce": "COALESCE", + "languageDocumentationPopover.documentationESQL.coalesce.markdown": "\n\n ### COALESCE\n nullでない最初の引数を返します。すべての引数がnullの場合はnullを返します。\n\n ```\n ROW a=null, b=\"b\"\n | EVAL COALESCE(a, b)\n ```\n ", + "languageDocumentationPopover.documentationESQL.concat": "CONCAT", + "languageDocumentationPopover.documentationESQL.concat.markdown": "\n\n ### CONCAT\n 2つ以上の文字列を連結します。\n\n ```\n FROM employees\n | KEEP first_name, last_name\n | EVAL fullname = CONCAT(first_name, \" \", last_name)\n ```\n ", + "languageDocumentationPopover.documentationESQL.cos": "COS", + "languageDocumentationPopover.documentationESQL.cos.markdown": "\n\n ### COS\n 角度の余弦を返します。\n\n ```\n ROW a=1.8 \n | EVAL cos=COS(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.cosh": "COSH", + "languageDocumentationPopover.documentationESQL.cosh.markdown": "\n\n ### COSH\n 角度の双曲余弦を返します。\n\n ```\n ROW a=1.8 \n | EVAL cosh=COSH(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.countDistinctFunction": "COUNT_DISTINCT", + "languageDocumentationPopover.documentationESQL.countDistinctFunction.markdown": "### COUNT_DISTINCT\n異なる値のおおよその数をカウントします。\n\n```\nFROM hosts\n| STATS COUNT_DISTINCT(ip0), COUNT_DISTINCT(ip1)\n```\n\nCOUNT_DISTINCT関数はHyperLogLog++アルゴリズムに基づく近似関数です。詳細については、[ドキュメント](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-cardinality-aggregation.html#_counts_are_approximate)を参照してください。精度は、オプションの2番目のパラメーターを使って設定できます。サポートされている最大値は40000です。この数値を超えたしきい値は、しきい値40000と同じ結果になります。デフォルト値は3000です。\n\n```\nFROM hosts\n| STATS COUNT_DISTINCT(ip0, 80000), COUNT_DISTINCT(ip1, 5)\n```\n\n式はインライン関数を使用できます。この例では、SPLIT関数を使用して、複数の値を分割し、一意の値をカウントします。\n\n```\nROW words=\"foo;bar;baz;qux;quux;foo\"\n| STATS distinct_word_count = COUNT_DISTINCT(SPLIT(words, \";\"))\n```\n ", + "languageDocumentationPopover.documentationESQL.countFunction": "COUNT", + "languageDocumentationPopover.documentationESQL.countFunction.markdown": "### COUNT\n入力値の合計数(カウント)が返されます。\n\n```\nFROM employees\n| STATS COUNT(height)\n```\n\n任意のフィールドを入力として渡すことができます。\n\n行数をカウントするには、`COUNT()`または`COUNT(*)`を使用します。\n\n```\nFROM employees\n| STATS count = COUNT(*) BY languages\n| SORT languages DESC\n```\n\n式はインライン関数を使用できます。この例では、SPLIT関数を使用して、複数の値を分割し、値をカウントします。\n\n```\nROW words=\"foo;bar;baz;qux;quux;foo\"\n| STATS word_count = COUNT(SPLIT(words, \";\"))\n```\n ", + "languageDocumentationPopover.documentationESQL.date_diff": "DATE_DIFF", + "languageDocumentationPopover.documentationESQL.date_diff.markdown": "\n\n ### DATE_DIFF\n startTimestampをendTimestampから減算し、unitの乗数の差を返します。\n startTimestampがendTimestampより後の場合は、負の値が返されます。\n\n ```\n ROW date1 = TO_DATETIME(\"2023-12-02T11:00:00.000Z\"), date2 = TO_DATETIME(\"2023-12-02T11:00:00.001Z\")\n | EVAL dd_ms = DATE_DIFF(\"microseconds\", date1, date2)\n ```\n ", + "languageDocumentationPopover.documentationESQL.date_extract": "DATE_EXTRACT", + "languageDocumentationPopover.documentationESQL.date_extract.markdown": "\n\n ### DATE_EXTRACT\n 年、月、日、時間など、日付の一部を抽出します。\n\n ```\n ROW date = DATE_PARSE(\"yyyy-MM-dd\", \"2022-05-06\")\n | EVAL year = DATE_EXTRACT(\"year\", date)\n ```\n ", + "languageDocumentationPopover.documentationESQL.date_format": "DATE_FORMAT", + "languageDocumentationPopover.documentationESQL.date_format.markdown": "\n\n ### DATE_FORMAT\n 指定した書式の日付の文字列表現を返します。\n\n ```\n FROM employees\n | KEEP first_name, last_name, hire_date\n | EVAL hired = DATE_FORMAT(\"YYYY-MM-dd\", hire_date)\n ```\n ", + "languageDocumentationPopover.documentationESQL.date_parse": "DATE_PARSE", + "languageDocumentationPopover.documentationESQL.date_parse.markdown": "\n\n ### DATE_PARSE\n 最初の引数で指定した形式を使用して、2番目の引数を解析することで、日付を返します。\n\n ```\n ROW date_string = \"2022-05-06\"\n | EVAL date = DATE_PARSE(\"yyyy-MM-dd\", date_string)\n ```\n ", + "languageDocumentationPopover.documentationESQL.date_trunc": "DATE_TRUNC", + "languageDocumentationPopover.documentationESQL.date_trunc.markdown": "\n\n ### DATE_TRUNC\n 最も近い区間まで日付を切り捨てます。\n\n ```\n FROM employees\n | KEEP first_name, last_name, hire_date\n | EVAL year_hired = DATE_TRUNC(1 year, hire_date)\n ```\n ", + "languageDocumentationPopover.documentationESQL.dissect": "DISSECT", + "languageDocumentationPopover.documentationESQL.dissect.markdown": "### DISSECT\nDISSECTは文字列から構造化データを取り出すことができます。DISSECTは文字列を区切り文字ベースのパターンと照合し、指定されたキーを列として抽出します。\n\ndissectパターンの構文については、[dissectプロセッサードキュメント](https://www.elastic.co/guide/en/elasticsearch/reference/current/dissect-processor.html)を参照してください。\n\n```\nROW a = \"1953-01-23T12:15:00Z - some text - 127.0.0.1\"\n| DISSECT a \"%'{Y}-%{M}-%{D}T%{h}:%{m}:%{s}Z - %{msg} - %{ip}'\"\n``` ", + "languageDocumentationPopover.documentationESQL.drop": "DROP", + "languageDocumentationPopover.documentationESQL.drop.markdown": "### DROP\nテーブルから列を削除するには、DROPを使用します。\n \n```\nFROM employees\n| DROP height\n```\n\n各列を名前で指定するのではなく、ワイルドカードを使って、パターンと一致する名前の列をすべて削除することができます。\n\n```\nFROM employees\n| DROP height*\n```\n ", + "languageDocumentationPopover.documentationESQL.e": "E", + "languageDocumentationPopover.documentationESQL.e.markdown": "\n\n ### E\n オイラー数を返します。\n\n ```\n ROW E()\n ```\n ", + "languageDocumentationPopover.documentationESQL.ends_with": "ENDS_WITH", + "languageDocumentationPopover.documentationESQL.ends_with.markdown": "\n\n ### ENDS_WITH\n キーワード文字列が他の文字列で終わるかどうかを示すブール値を返します。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL ln_E = ENDS_WITH(last_name, \"d\")\n ```\n ", + "languageDocumentationPopover.documentationESQL.enrich": "ENRICH", + "languageDocumentationPopover.documentationESQL.enrich.markdown": "### ENRICH\nENRICH`を使用すると、既存のインデックスのデータを受信レコードに追加することができます。[インジェストエンリッチ](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html)と似ていますが、クエリー時に動作します。\n\n```\nROW language_code = \"1\"\n| ENRICH languages_policy\n```\n\nENRICHでは、[エンリッチポリシー](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html#enrich-policy)を実行する必要があります。エンリッチポリシーは、一致フィールド (キーフィールド) とエンリッチフィールドのセットを定義します。\n\nENRICHは、一致フィールド値に基づいて、[エンリッチインデックス](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html#enrich-index)のレコードを検索します。入力データセットの一致するキーは、ON を使用して定義できます。指定しない場合は、エンリッチポリシーで定義された一致フィールドと同じ名前のフィールドで一致が実行されます。\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a\n```\n\nWITH , ...構文を使用して、結果に追加される属性(ポリシーでエンリッチフィールドとして定義された属性の間)を指定できます。\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a WITH language_name\n```\n\n属性の名前は、WITH new_name=を使用して変更できます。\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a WITH name = language_name\n```\n\nデフォルトでは、(WITHが定義されていない場合)、ENRICHはエンリッチポリシーで定義されたすべてのエンリッチフィールドを結果に追加します。\n\n名前の競合が発生した場合、新しく作成されたフィールドが既存のフィールドを上書きします。\n ", + "languageDocumentationPopover.documentationESQL.eval": "EVAL", + "languageDocumentationPopover.documentationESQL.eval.markdown": "### EVAL\nEVALでは、新しい列を追加できます。\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| EVAL height_feet = height * 3.281, height_cm = height * 100\n```\n\n指定した列がすでに存在する場合、既存の列は削除され、新しい列がテーブルに追加されます。\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| EVAL height = height * 3.281\n```\n\n#### 関数\nEVALは値を計算するためのさまざまな関数をサポートしています。関数をクリックすると詳細が表示されます。\n ", + "languageDocumentationPopover.documentationESQL.floor": "FLOOR", + "languageDocumentationPopover.documentationESQL.floor.markdown": "\n\n ### FLOOR\n 最も近い整数に数値を切り捨てます。\n\n ```\n ROW a=1.8\n | EVAL a=FLOOR(a)\n ```\n 注:これはlong(符号なしを含む)とintegerのnoopです。\n doubleの場合、Math.floorと同様に、整数に最も近いdoubleの値を選びます。\n \n ", + "languageDocumentationPopover.documentationESQL.from": "FROM", + "languageDocumentationPopover.documentationESQL.from_base64": "FROM_BASE64", + "languageDocumentationPopover.documentationESQL.from_base64.markdown": "\n\n ### FROM_BASE64\n base64文字列をデコードします。\n\n ```\n row a = \"ZWxhc3RpYw==\" \n | eval d = from_base64(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.from.markdown": "### FROM\nソースコマンドFROMは、データストリーム、インデックス、またはエイリアスから、最大10,000ドキュメントを含むテーブルを返します。結果のテーブルの各行はドキュメントを表します。各列はフィールドに対応し、そのフィールドの名前でアクセスできます。\n\n```\nFROM employees\n```\n\n[日付演算](https://www.elastic.co/guide/en/elasticsearch/reference/current/api-conventions.html#api-date-math-index-names) を使用して、インデックス、エイリアス、データストリームを参照できます。これは時系列データの場合に便利です。\n\nカンマ区切りのリストまたはワイルドカードを使用して、複数のデータストリーム、インデックス、またはエイリアスをクエリーします。\n\n```\nFROM employees-00001,employees-*\n```\n\n#### メタデータ\n\nES|QLは以下のメタデータフィールドにアクセスできます。\n\n* `_index`:ドキュメントが属するインデックス。このフィールドはkeyword型です。\n* `_id`:ソースドキュメントのID。このフィールドはkeyword型です。### `_version`:ソースドキュメントのバージョン。フィールドの型はlongです。\n\nメタデータフィールドを有効にするには、METADATAディレクティブを使います。\n\n```\nFROM index [METADATA _index, _id]\n```\n\nメタデータフィールドは、データのソースがインデックスである場合にのみ使用できます。その結果、FROMはMETADATAディレクティブをサポートする唯一のソースコマンドです。\n\nこのフィールドが有効になると、他のインデックスフィールドと同様に、後続の処理コマンドで利用できるようになります。\n\n```\nFROM ul_logs, apps [METADATA _index, _version]\n| WHERE id IN (13, 14) AND _version == 1\n| EVAL key = CONCAT(_index, \"_\", TO_STR(id))\n| SORT id, _index\n| KEEP id, _index, _version, key\n```\n\nまた、インデックス・フィールドと同様に、一度集約が実行されると、グループ化フィールドとして使用されないかぎり、メタデータフィールドは後続のコマンドからはアクセスできなくなります。\n\n```\nFROM employees [METADATA _index, _id]\n| STATS max = MAX(emp_no) BY _index\n```\n ", + "languageDocumentationPopover.documentationESQL.greatest": "GREATEST", + "languageDocumentationPopover.documentationESQL.greatest.markdown": "\n\n ### GREATEST\n 多数の列から最大値を返します。これはMV_MAX\n と似ていますが、一度に複数の列に対して実行します。\n\n ```\n ROW a = 10, b = 20\n | EVAL g = GREATEST(a, b)\n ```\n 注:keywordまたはtextフィールドに対して実行すると、アルファベット順の最後の文字列を返します。boolean列に対して実行すると、値がtrueの場合にtrueを返します。\n ", + "languageDocumentationPopover.documentationESQL.grok": "GROK", + "languageDocumentationPopover.documentationESQL.grok.markdown": "### GROK\nGROKを使うと、文字列から構造化データを抽出できます。GROKは正規表現に基づいて文字列をパターンと一致させ、指定されたパターンを列として抽出します。\n\ngrokパターンの構文については、 [grokプロセッサードキュメント](https://www.elastic.co/guide/en/elasticsearch/reference/current/grok-processor.html)を参照してください。\n\n```\nROW a = \"12 15.5 15.6 true\"\n| GROK a \"%'{NUMBER:b:int}' %'{NUMBER:c:float}' %'{NUMBER:d:double}' %'{WORD:e:boolean}'\"\n```\n ", + "languageDocumentationPopover.documentationESQL.inOperator": "IN", + "languageDocumentationPopover.documentationESQL.inOperator.markdown": "### IN\nIN演算子は、フィールドや式がリテラル、フィールド、式のリストの要素と等しいかどうかをテストすることができます。\n\n```\nROW a = 1, b = 4, c = 3\n| WHERE c-a IN (3, b / 2, a)\n```\n ", + "languageDocumentationPopover.documentationESQL.ip_prefix": "IP_PREFIX", + "languageDocumentationPopover.documentationESQL.ip_prefix.markdown": "\n\n ### IP_PREFIX\n IPを特定のプレフィックス長に切り詰めます。\n\n ```\n row ip4 = to_ip(\"1.2.3.4\"), ip6 = to_ip(\"fe80::cae2:65ff:fece:feb9\")\n | eval ip4_prefix = ip_prefix(ip4, 24, 0), ip6_prefix = ip_prefix(ip6, 0, 112);\n ```\n ", + "languageDocumentationPopover.documentationESQL.keep": "KEEP", + "languageDocumentationPopover.documentationESQL.keep.markdown": "### KEEP\nKEEPコマンドは、返される列と、列が返される順序を指定することができます。\n\n返される列を制限するには、カンマで区切りの列名リストを使用します。列は指定された順序で返されます。\n \n```\nFROM employees\n| KEEP first_name, last_name, height\n```\n\n各列を名前で指定するのではなく、ワイルドカードを使って、パターンと一致する名前の列をすべて返すことができます。\n\n```\nFROM employees\n| KEEP h*\n```\n\nアスタリスクワイルドカード(*)は単独で、他の引数と一致しないすべての列に変換されます。このクエリーは、最初にhで始まる名前の列をすべて返し、その後にその他の列をすべて返します。\n\n```\nFROM employees\n| KEEP h*, *\n```\n ", + "languageDocumentationPopover.documentationESQL.least": "LEAST", + "languageDocumentationPopover.documentationESQL.least.markdown": "\n\n ### LEAST\n 多数の列から最小値を返します。これはMV_MINと似ていますが、一度に複数の列に対して実行します。\n\n ```\n ROW a = 10, b = 20\n | EVAL l = LEAST(a, b)\n ```\n ", + "languageDocumentationPopover.documentationESQL.left": "LEFT", + "languageDocumentationPopover.documentationESQL.left.markdown": "\n\n ### LEFT\n stringから左から順にlength文字を抜き出したサブ文字列を返します。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL left = LEFT(last_name, 3)\n | SORT last_name ASC\n | LIMIT 5\n ```\n ", + "languageDocumentationPopover.documentationESQL.length": "LENGTH", + "languageDocumentationPopover.documentationESQL.length.markdown": "\n\n ### LENGTH\n 文字列の文字数を返します。\n\n ```\n FROM employees\n | KEEP first_name, last_name\n | EVAL fn_length = LENGTH(first_name)\n ```\n ", + "languageDocumentationPopover.documentationESQL.limit": "LIMIT", + "languageDocumentationPopover.documentationESQL.limit.markdown": "### LIMIT\nLIMIT`処理コマンドは行数を制限することができます。\n \n```\nFROM employees\n| LIMIT 5\n```\n ", + "languageDocumentationPopover.documentationESQL.locate": "LOCATE", + "languageDocumentationPopover.documentationESQL.locate.markdown": "\n\n ### LOCATE\n 別の文字列内のキーワードサブ文字列の位置を示す整数を返します。\n\n ```\n row a = \"hello\"\n | eval a_ll = locate(a, \"ll\")\n ```\n ", + "languageDocumentationPopover.documentationESQL.log": "LOG", + "languageDocumentationPopover.documentationESQL.log.markdown": "\n\n ### LOG\n 基数に対する値の対数を返します。入力は任意の数値で、戻り値は常にdoubleです。\n\n ゼロの対数、負数、1の基数はnullと警告を返します。\n\n ```\n ROW base = 2.0, value = 8.0\n | EVAL s = LOG(base, value)\n ```\n ", + "languageDocumentationPopover.documentationESQL.log10": "LOG10", + "languageDocumentationPopover.documentationESQL.log10.markdown": "\n\n ### LOG10\n 基数10に対する値の対数を返します。入力は任意の数値で、戻り値は常にdoubleです。\n\n 0の対数および負数はnullと警告を返します。\n\n ```\n ROW d = 1000.0 \n | EVAL s = LOG10(d)\n ```\n ", + "languageDocumentationPopover.documentationESQL.ltrim": "LTRIM", + "languageDocumentationPopover.documentationESQL.ltrim.markdown": "\n\n ### LTRIM\n 文字列から先頭の空白を取り除きます。\n\n ```\n ROW message = \" some text \", color = \" red \"\n | EVAL message = LTRIM(message)\n | EVAL color = LTRIM(color)\n | EVAL message = CONCAT(\"'\", message, \"'\")\n | EVAL color = CONCAT(\"'\", color, \"'\")\n ```\n ", + "languageDocumentationPopover.documentationESQL.markdown": "## ES|QL\n\nES|QL(Elasticsearch クエリー言語)クエリーは、パイプ文字の|で区切られた一連のコマンドで構成されます。各クエリーは**ソースコマンド**で始まり、通常はElasticsearchのデータを使ってテーブルを生成します。\n\nソースコマンドには、1つ以上の**処理コマンド**を続けることができます。処理コマンドは、行や列を追加、削除、変更することで、前のコマンドの出力テーブルを変更することができます。\n\n```\nsource-command\n| processing-command1\n| processing-command2\n```\n\nクエリーの結果は、最終的な処理コマンドによって生成されるテーブルです。 \n ", + "languageDocumentationPopover.documentationESQL.maxFunction": "MAX", + "languageDocumentationPopover.documentationESQL.maxFunction.markdown": "### MAX\n数値式の最大値を返します。\n\n```\nFROM employees\n| STATS MAX(languages)\n```\n\n式はインライン関数を使用できます。たとえば、複数値列の平均に対して最大値を計算するには、まず、MV_AVGを使用して行ごとに複数の値の平均を求め、その結果にMAX関数を適用します。\n\n```\nFROM employees\n| STATS max_avg_salary_change = MAX(MV_AVG(salary_change))\n```\n ", + "languageDocumentationPopover.documentationESQL.medianAbsoluteDeviationFunction": "MEDIAN_ABSOLUTE_DEVIATION", + "languageDocumentationPopover.documentationESQL.medianAbsoluteDeviationFunction.markdown": "### MEDIAN_ABSOLUTE_DEVIATION\n絶対偏差の中央値で、ばらつきを表す指標を返します。これはロバスト統計量であり、外れ値があったり、正規分布していない可能性があるデータを説明するのに有用です。このようなデータでは、標準偏差よりもわかりやすくなります。\n\nこれは、サンプル全体の中央値からの各データポイントの偏差の中央値として計算されます。つまり、確率変数Xに対して、絶対偏差の中央値はmedian(|median(X) - X|)です。\n\n```\nFROM employees\n| STATS MEDIAN(salary), MEDIAN_ABSOLUTE_DEVIATION(salary)\n```\n\n注:PERCENTILEと同様に、通常、MEDIAN_ABSOLUTE_DEVIATIONはTDigestアルゴリズムに基づく近似値です。MEDIAN_ABSOLUTE_DEVIATIONも非決定論的です。つまり、同じデータでも微妙に異なる結果が得られる可能性があります。\n\n式はインライン関数を使用できます。たとえば、複数値列の最大値の中央絶対偏差を計算するには、まず、MV_MAXを使用して行ごとの最大値を取得し、その結果に対してMEDIAN_ABSOLUTE_DEVIATION関数を使用します。\n\n```\nFROM employees\n| STATS m_a_d_max_salary_change = MEDIAN_ABSOLUTE_DEVIATION(MV_MAX(salary_change))\n```\n\n", + "languageDocumentationPopover.documentationESQL.medianFunction": "MEDIAN", + "languageDocumentationPopover.documentationESQL.medianFunction.markdown": "### MEDIAN\n全数値の半分より大きく、全数値の半分より小さい値で、50%パーセンタイルとも呼ばれる値を返します。\n\n**注:**PERCENTILEと同様に、通常MEDIANはTDigestアルゴリズムに基づく近似値です。\n\n**警告:** MEDIANは[非決定性](https://en.wikipedia.org/wiki/Nondeterministic_algorithm)です。つまり、同じデータでも微妙に異なる結果が得られる可能性があります。\n\n例:\n\n```\nFROM employees\n| STATS MEDIAN(salary), PERCENTILE(salary, 50)\n```\n\n式はインライン関数を使用できます。たとえば、複数値列の最大値の中央値を計算するには、まず、MV_MAXを使用して行ごとに最大値を求め、その結果にMEDIAN関数を適用します。\n\n```\nFROM employees\n| STATS median_max_salary_change = MEDIAN(MV_MAX(salary_change))\n```\n ", + "languageDocumentationPopover.documentationESQL.minFunction": "MIN", + "languageDocumentationPopover.documentationESQL.minFunction.markdown": "### MIN\n数値フィールドの最小値を返します。\n\n```\nFROM employees\n| STATS MIN(languages)\n```\n\n式はインライン関数を使用できます。たとえば、複数値列の平均に対して最小値を計算するには、まず、MV_AVGを使用して行ごとに複数の値の平均を求め、その結果にMIN関数を適用します。\n\n```\nFROM employees\n| STATS min_avg_salary_change = MIN(MV_AVG(salary_change))\n```\n ", + "languageDocumentationPopover.documentationESQL.mv_append": "MV_APPEND", + "languageDocumentationPopover.documentationESQL.mv_append.markdown": "\n\n ### MV_APPEND\n 2つの複数値フィールドの値を連結します\n\n ", + "languageDocumentationPopover.documentationESQL.mv_avg": "MV_AVG", + "languageDocumentationPopover.documentationESQL.mv_avg.markdown": "\n\n ### MV_AVG\n 複数値フィールドを、すべての値の平均を含む単一値フィールドに変換します。\n\n ```\n ROW a=[3, 5, 1, 6]\n | EVAL avg_a = MV_AVG(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.mv_concat": "MV_CONCAT", + "languageDocumentationPopover.documentationESQL.mv_concat.markdown": "\n\n ### MV_CONCAT\n 複数値文字列式を、区切り文字で区切られたすべての値を連結した単一値列に変換します。\n\n ```\n ROW a=[\"foo\", \"zoo\", \"bar\"]\n | EVAL j = MV_CONCAT(a, \", \")\n ```\n ", + "languageDocumentationPopover.documentationESQL.mv_count": "MV_COUNT", + "languageDocumentationPopover.documentationESQL.mv_count.markdown": "\n\n ### MV_COUNT\n 複数値式を、値の数をカウントする単一値列に変換します。\n\n ```\n ROW a=[\"foo\", \"zoo\", \"bar\"]\n | EVAL count_a = MV_COUNT(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.mv_dedupe": "MV_DEDUPE", + "languageDocumentationPopover.documentationESQL.mv_dedupe.markdown": "\n\n ### MV_DEDUPE\n 複数値フィールドから重複する値を削除します。\n\n ```\n ROW a=[\"foo\", \"foo\", \"bar\", \"foo\"]\n | EVAL dedupe_a = MV_DEDUPE(a)\n ```\n 注:MV_DEDUPEは列の値をソートすることがありますが、常にソートするわけではありません。\n ", + "languageDocumentationPopover.documentationESQL.mv_first": "MV_FIRST", + "languageDocumentationPopover.documentationESQL.mv_first.markdown": "\n\n ### MV_FIRST\n \n 複数値式を、最初の値を含む単一値列に変換します。これは、SPLITなどの既知の順序で複数値列を発行する関数から読み取るときに役立ちます。\n \n\n 複数値フィールドが基本ストレージから読み取られる順序は保証されません。\n \n 通常は昇順ですが、必ずしもそうであるわけではありません。最小値が必要な場合は、MV_FIRSTの代わりに、MV_MINを使用します。\n MV_MINは、ソートされた値向けに最適化されているため、\n MV_FIRSTにパフォーマンスの利点はありません。\n\n ```\n ROW a=\"foo;bar;baz\"\n | EVAL first_a = MV_FIRST(SPLIT(a, \";\"))\n ```\n ", + "languageDocumentationPopover.documentationESQL.mv_last": "MV_LAST", + "languageDocumentationPopover.documentationESQL.mv_last.markdown": "\n\n ### MV_LAST\n \n 複数値式を、最後の値を含む単一値列に変換します。これは、SPLITなどの既知の順序で複数値列を発行する関数から読み取るときに役立ちます。\n \n\n 複数値フィールドが基本ストレージから読み取られる順序は保証されません。\n \n 通常は昇順ですが、必ずしもそうであるわけではありません。最大値が必要な場合は、MV_LASTの代わりに、MV_MAXを使用します。\n MV_MAXは、ソートされた値向けに最適化されているため、\n MV_LASTにパフォーマンスの利点はありません。\n\n ```\n ROW a=\"foo;bar;baz\"\n | EVAL last_a = MV_LAST(SPLIT(a, \";\"))\n ```\n ", + "languageDocumentationPopover.documentationESQL.mv_max": "MV_MAX", + "languageDocumentationPopover.documentationESQL.mv_max.markdown": "\n\n ### MV_MAX\n 複数値フィールドを、最大値を含む単一値フィールドに変換します。\n\n ```\n ROW a=[3, 5, 1]\n | EVAL max_a = MV_MAX(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.mv_median": "MV_MEDIAN", + "languageDocumentationPopover.documentationESQL.mv_median.markdown": "\n\n ### MV_MEDIAN\n 複数値フィールドを、中央値を含む単一値フィールドに変換します。\n\n ```\n ROW a=[3, 5, 1]\n | EVAL median_a = MV_MEDIAN(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.mv_min": "MV_MIN", + "languageDocumentationPopover.documentationESQL.mv_min.markdown": "\n\n ### MV_MIN\n 複数値フィールドを、最小値を含む単一値フィールドに変換します。\n\n ```\n ROW a=[2, 1]\n | EVAL min_a = MV_MIN(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.mv_slice": "MV_SLICE", + "languageDocumentationPopover.documentationESQL.mv_slice.markdown": "\n\n ### MV_SLICE\n 開始インデックス値と終了インデックス値を使用して、複数値フィールドのサブセットを返します。\n\n ```\n row a = [1, 2, 2, 3]\n | eval a1 = mv_slice(a, 1), a2 = mv_slice(a, 2, 3)\n ```\n ", + "languageDocumentationPopover.documentationESQL.mv_sort": "MV_SORT", + "languageDocumentationPopover.documentationESQL.mv_sort.markdown": "\n\n ### MV_SORT\n 辞書の順序で複数値フィールドを並べ替えます。\n\n ```\n ROW a = [4, 2, -3, 2]\n | EVAL sa = mv_sort(a), sd = mv_sort(a, \"DESC\")\n ```\n ", + "languageDocumentationPopover.documentationESQL.mv_sum": "MV_SUM", + "languageDocumentationPopover.documentationESQL.mv_sum.markdown": "\n\n ### MV_SUM\n 複数値フィールドを、すべての値の合計を含む単一値フィールドに変換します。\n\n ```\n ROW a=[3, 5, 6]\n | EVAL sum_a = MV_SUM(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.mv_zip": "MV_ZIP", + "languageDocumentationPopover.documentationESQL.mv_zip.markdown": "\n\n ### MV_ZIP\n 値を結合する区切り文字を使用して、2つの複数値フィールドの値を結合します。\n\n ```\n ROW a = [\"x\", \"y\", \"z\"], b = [\"1\", \"2\"]\n | EVAL c = mv_zip(a, b, \"-\")\n | KEEP a, b, c\n ```\n ", + "languageDocumentationPopover.documentationESQL.mvExpand": "MV_EXPAND", + "languageDocumentationPopover.documentationESQL.mvExpand.markdown": "### MV_EXPAND\nMV_EXPAND処理コマンドは、複数値フィールドを値ごとに1行に展開し、他のフィールドを複製します。 \n```\nROW a=[1,2,3], b=\"b\", j=[\"a\",\"b\"]\n| MV_EXPAND a\n```\n ", + "languageDocumentationPopover.documentationESQL.now": "NOW", + "languageDocumentationPopover.documentationESQL.now.markdown": "\n\n ### NOW\n 現在の日付と時刻を返します。\n\n ```\n ROW current_date = NOW()\n ```\n ", + "languageDocumentationPopover.documentationESQL.percentileFunction": "PERCENTILE", + "languageDocumentationPopover.documentationESQL.percentileFunction.markdown": "### PERCENTILE\n観測値の特定の割合で発生する値。たとえば、95パーセンタイルは観測値の95%より大きい値で、50パーセンタイルはMEDIAN`です。\n\n```\nFROM employees\n| STATS p0 = PERCENTILE(salary, 0)\n , p50 = PERCENTILE(salary, 50)\n , p99 = PERCENTILE(salary, 99)\n```\n\n**注**:PERCENTILEは通常TDigestアルゴリズムに基づく近似値です。\n\n**警告:**PERCENTILEは[非決定性](https://en.wikipedia.org/wiki/Nondeterministic_algorithm)です。つまり、同じデータでも微妙に異なる結果が得られる可能性があります。\n\n式はインライン関数を使用できます。たとえば、複数値列の最大値のパーセンタイルを計算するには、まず、MV_MAXを使用して行ごとの最大値を取得し、その結果に対してMEDIAN_ABSOLUTE_DEVIATION関数を使用します。\n\n```\nFROM employees\n| STATS p80_max_salary_change = PERCENTILE(MV_MAX(salary_change), 80)\n```\n ", + "languageDocumentationPopover.documentationESQL.pi": "PI", + "languageDocumentationPopover.documentationESQL.pi.markdown": "\n\n ### PI\n 円の円周と直径の比率であるPiを返します。\n\n ```\n ROW PI()\n ```\n ", + "languageDocumentationPopover.documentationESQL.pow": "POW", + "languageDocumentationPopover.documentationESQL.pow.markdown": "\n\n ### POW\n exponentのべき乗にしたbaseの値を返します。\n\n ```\n ROW base = 2.0, exponent = 2\n | EVAL result = POW(base, exponent)\n ```\n 注:ここでは、倍精度浮動小数点数の結果でもオーバーフローする可能性があります。その場合は、NULLが返されます。\n ", + "languageDocumentationPopover.documentationESQL.predicates": "NULL値", + "languageDocumentationPopover.documentationESQL.predicates.markdown": "### NULL値\nNULLの比較には、IS NULLとIS NOT NULL述語を使います。\n\n```\nFROM employees\n| WHERE birth_date IS NULL\n| KEEP first_name, last_name\n| SORT first_name\n| LIMIT 3\n```\n\n```\nFROM employees\n| WHERE is_rehired IS NOT NULL\n| STATS count(emp_no)\n```\n ", + "languageDocumentationPopover.documentationESQL.rename": "RENAME", + "languageDocumentationPopover.documentationESQL.rename.markdown": "### RENAME\nRENAMEを使用して、次の構文で列の名前を変更します。\n\n```\nRENAME AS \n```\n\n例:\n\n```\nFROM employees\n| KEEP first_name, last_name, still_hired\n| RENAME still_hired AS employed\n```\n\n新しい名前の列がすでに存在する場合、その列は新しい列に置き換えられます。\n\n複数の列の名前を1つのRENAMEコマンドで変更することができます。\n\n```\nFROM employees\n| KEEP first_name, last_name\n| RENAME first_name AS fn, last_name AS ln\n```\n ", + "languageDocumentationPopover.documentationESQL.repeat": "REPEAT", + "languageDocumentationPopover.documentationESQL.repeat.markdown": "\n\n ### REPEAT\n 指定したnumberの回数、文字列stringとそれ自身を連結して構成された文字列を返します。\n\n ```\n ROW a = \"Hello!\"\n | EVAL triple_a = REPEAT(a, 3);\n ```\n ", + "languageDocumentationPopover.documentationESQL.replace": "REPLACE", + "languageDocumentationPopover.documentationESQL.replace.markdown": "\n\n ### REPLACE\n \n この関数は、正規表現regexと置換文字列newStrの任意の一致を文字列strに代入します。\n\n ```\n ROW str = \"Hello World\"\n | EVAL str = REPLACE(str, \"World\", \"Universe\")\n | KEEP str\n ```\n ", + "languageDocumentationPopover.documentationESQL.right": "RIGHT", + "languageDocumentationPopover.documentationESQL.right.markdown": "\n\n ### RIGHT\n strのうち右から数えてlength文字までのサブ文字列を返します。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL right = RIGHT(last_name, 3)\n | SORT last_name ASC\n | LIMIT 5\n ```\n ", + "languageDocumentationPopover.documentationESQL.round": "ROUND", + "languageDocumentationPopover.documentationESQL.round.markdown": "\n\n ### ROUND\n 数値を指定した小数点以下の桁数に丸めます。\n デフォルトは0で、最も近い整数を返します。\n 精度が負の場合、小数点以下の桁数に丸めます。\n \n\n ```\n FROM employees\n | KEEP first_name, last_name, height\n | EVAL height_ft = ROUND(height * 3.281, 1)\n ```\n ", + "languageDocumentationPopover.documentationESQL.row": "ROW", + "languageDocumentationPopover.documentationESQL.row.markdown": "### ROW\nROWソースコマンドは、指定した値の列を1つ以上含む行を作成します。これはテストの場合に便利です。\n \n```\nROW a = 1, b = \"two\", c = null\n```\n\n複数の値を含む列を作成するには角括弧を使用します。\n\n```\nROW a = [2, 1]\n```\n\nROWは関数の使用をサポートしています。\n\n```\nROW a = ROUND(1.23, 0)\n```\n ", + "languageDocumentationPopover.documentationESQL.rtrim": "RTRIM", + "languageDocumentationPopover.documentationESQL.rtrim.markdown": "\n\n ### RTRIM\n 文字列から末尾の空白を取り除きます。\n\n ```\n ROW message = \" some text \", color = \" red \"\n | EVAL message = RTRIM(message)\n | EVAL color = RTRIM(color)\n | EVAL message = CONCAT(\"'\", message, \"'\")\n | EVAL color = CONCAT(\"'\", color, \"'\")\n ```\n ", + "languageDocumentationPopover.documentationESQL.show": "SHOW", + "languageDocumentationPopover.documentationESQL.show.markdown": "### SHOW\nSHOW ソースコマンドはデプロイとその能力に関する情報を返します。\n\n* デプロイのバージョン、ビルド日、ハッシュを返すには、SHOW INFOを使用します。\n* SHOW FUNCTIONSを使用すると、サポートされているすべての関数のリストと各関数の概要を返します。\n ", + "languageDocumentationPopover.documentationESQL.signum": "SIGNUM", + "languageDocumentationPopover.documentationESQL.signum.markdown": "\n\n ### SIGNUM\n 任意の数値の符号を返します。\n 負の数値の場合は-1を返します。0の場合は0を返します。正の数値の場合は1を返します。\n\n ```\n ROW d = 100.0\n | EVAL s = SIGNUM(d)\n ```\n ", + "languageDocumentationPopover.documentationESQL.sin": "SIN", + "languageDocumentationPopover.documentationESQL.sin.markdown": "\n\n ### SIN\n 角度の正弦三角関数を返します。\n\n ```\n ROW a=1.8 \n | EVAL sin=SIN(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.sinh": "SINH", + "languageDocumentationPopover.documentationESQL.sinh.markdown": "\n\n ### SINH\n 角度の双曲線正弦を返します。\n\n ```\n ROW a=1.8 \n | EVAL sinh=SINH(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.sort": "SORT", + "languageDocumentationPopover.documentationESQL.sort.markdown": "### SORT\nSORTコマンドを使用すると、1つ以上のフィールドで行をソートすることができます。\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height\n```\n\nデフォルトのソート順は昇順です。ASCまたはDESCを使って明示的なソート順を設定します。\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height DESC\n```\n\n2つの行のソートキーが同じ場合、元の順序が保持されます。タイブレーカーとなるソート式を追加で指定できます。\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height DESC, first_name ASC\n```\n\n#### null値\nデフォルトでは、null値は他のどの値よりも大きい値として扱われます。昇順のソートではnull値は最後にソートされ、降順のソートではnull値は最初にソートされます。NULLS FIRSTまたはNULLS LASTを指定することで変更できます。\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT first_name ASC NULLS FIRST\n```\n ", + "languageDocumentationPopover.documentationESQL.split": "SPLIT", + "languageDocumentationPopover.documentationESQL.split.markdown": "\n\n ### SPLIT\n 単一の値の文字列を複数の文字列に分割します。\n\n ```\n ROW words=\"foo;bar;baz;qux;quux;corge\"\n | EVAL word = SPLIT(words, \";\")\n ```\n ", + "languageDocumentationPopover.documentationESQL.sqrt": "SQRT", + "languageDocumentationPopover.documentationESQL.sqrt.markdown": "\n\n ### SQRT\n 数値の平方根を返します。入力は任意の数値で、戻り値は常にdoubleです。\n 負数と無限大の平方根はnullです。\n\n ```\n ROW d = 100.0\n | EVAL s = SQRT(d)\n ```\n ", + "languageDocumentationPopover.documentationESQL.st_contains": "ST_CONTAINS", + "languageDocumentationPopover.documentationESQL.st_contains.markdown": "\n\n ### ST_CONTAINS\n 最初のジオメトリに2番目のジオメトリが含まれるかどうかを返します。\n これはST_WITHIN関数の逆関数です。\n\n ```\n FROM airport_city_boundaries\n | WHERE ST_CONTAINS(city_boundary, TO_GEOSHAPE(\"POLYGON((109.35 18.3, 109.45 18.3, 109.45 18.4, 109.35 18.4, 109.35 18.3))\"))\n | KEEP abbrev, airport, region, city, city_location\n ```\n ", + "languageDocumentationPopover.documentationESQL.st_disjoint": "ST_DISJOINT", + "languageDocumentationPopover.documentationESQL.st_disjoint.markdown": "\n\n ### ST_DISJOINT\n 2つのジオメトリまたはジオメトリ列が結合解除されているかどうかを返します。\n これはST_INTERSECTS関数の逆関数です。\n 数学的には次のようになります。ST_Disjoint(A, B) ⇔ A ⋂ B = ∅\n\n ```\n FROM airport_city_boundaries\n | WHERE ST_DISJOINT(city_boundary, TO_GEOSHAPE(\"POLYGON((-10 -60, 120 -60, 120 60, -10 60, -10 -60))\"))\n | KEEP abbrev, airport, region, city, city_location\n ```\n ", + "languageDocumentationPopover.documentationESQL.st_distance": "ST_DISTANCE", + "languageDocumentationPopover.documentationESQL.st_distance.markdown": "\n\n ### ST_DISTANCE\n 2点間の距離を計算します。\n デカルト幾何学の場合、これは元の座標と同じ単位でのピタゴラス距離です。\n 地理的幾何学では、これはメートル単位での円に沿った円周距離です。\n\n ```\n FROM airports\n | WHERE abbrev == \"CPH\"\n | EVAL distance = ST_DISTANCE(location, city_location)\n | KEEP abbrev, name, location, city_location, distance\n ```\n ", + "languageDocumentationPopover.documentationESQL.st_intersects": "ST_INTERSECTS", + "languageDocumentationPopover.documentationESQL.st_intersects.markdown": "\n\n ### ST_INTERSECTS\n 2つのジオメトリが交差している場合はTrueを返します。\n 内部点を含め、共通の点がある場合は交差しています\n (線に沿った点または多角形内の点)。\n これはST_DISJOINT関数の逆関数です。\n 数学的には次のようになります。ST_Intersects(A, B) ⇔ A ⋂ B ≠ ∅\n\n ```\n FROM airports\n | WHERE ST_INTERSECTS(location, TO_GEOSHAPE(\"POLYGON((42 14, 43 14, 43 15, 42 15, 42 14))\"))\n ```\n ", + "languageDocumentationPopover.documentationESQL.st_within": "ST_WITHIN", + "languageDocumentationPopover.documentationESQL.st_within.markdown": "\n\n ### ST_WITHIN\n 最初のジオメトリが2番目のジオメトリ内にあるかどうかを返します。\n これはST_CONTAINS関数の逆関数です。\n\n ```\n FROM airport_city_boundaries\n | WHERE ST_WITHIN(city_boundary, TO_GEOSHAPE(\"POLYGON((109.1 18.15, 109.6 18.15, 109.6 18.65, 109.1 18.65, 109.1 18.15))\"))\n | KEEP abbrev, airport, region, city, city_location\n ```\n ", + "languageDocumentationPopover.documentationESQL.st_x": "ST_X", + "languageDocumentationPopover.documentationESQL.st_x.markdown": "\n\n ### ST_X\n 指定された点からx座標を抽出します。\n この点がgeo_pointタイプの場合は、longitude値を抽出するのと同じ結果になります。\n\n ```\n ROW point = TO_GEOPOINT(\"POINT(42.97109629958868 14.7552534006536)\")\n | EVAL x = ST_X(point), y = ST_Y(point)\n ```\n ", + "languageDocumentationPopover.documentationESQL.st_y": "ST_Y", + "languageDocumentationPopover.documentationESQL.st_y.markdown": "\n\n ### ST_Y\n 指定された点からy座標を抽出します。\n この点がgeo_pointタイプの場合は、latitude値を抽出するのと同じ結果になります。\n\n ```\n ROW point = TO_GEOPOINT(\"POINT(42.97109629958868 14.7552534006536)\")\n | EVAL x = ST_X(point), y = ST_Y(point)\n ```\n ", + "languageDocumentationPopover.documentationESQL.starts_with": "STARTS_WITH", + "languageDocumentationPopover.documentationESQL.starts_with.markdown": "\n\n ### STARTS_WITH\n キーワード文字列が他の文字列で始まるかどうかを示すブール値を返します。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL ln_S = STARTS_WITH(last_name, \"B\")\n ```\n ", + "languageDocumentationPopover.documentationESQL.statsby": "STATS ...BY", + "languageDocumentationPopover.documentationESQL.statsby.markdown": "### STATS ...BY\nSTATS ...BYを使用すると、共通の値に従って行をグループ化し、グループ化された行に対する1つ以上の集約値を計算します。\n\n**例**:\n\n```\nFROM employees\n| STATS count = COUNT(emp_no) BY languages\n| SORT languages\n```\n\nBYが省略された場合、出力テーブルには、データセット全体に適用された集約が正確に1行だけ含まれます。\n\n```\nFROM employees\n| STATS avg_lang = AVG(languages)\n```\n\n複数の値を計算することができます。\n\n```\nFROM employees\n| STATS avg_lang = AVG(languages), max_lang = MAX(languages)\n```\n\n複数の値でグループ化することも可能です(longおよびkeywordファミリーフィールドでのみサポート)。\n\n```\nFROM employees\n| EVAL hired = DATE_FORMAT(hire_date, \"YYYY\")\n| STATS avg_salary = AVG(salary) BY hired, languages.long\n| EVAL avg_salary = ROUND(avg_salary)\n| SORT hired, languages.long\n```\n\nSTATS ...BYで使用できる関数の一覧については、**集計関数**を参照してください。\n\n集計関数とグループ式の両方で他の関数を使用できます。これは、複数値列でSTATS...BYを使用するときに有用です。たとえば、平均給与変動を計算するには、まず、MV_AVGを使用して従業員ごとに複数の値の平均を求め、その結果にAVG関数を適用します。\n\n```\nFROM employees\n| STATS avg_salary_change = AVG(MV_AVG(salary_change))\n```\n\n式によるグループ化の例は、姓の最初の文字で従業員をグループ化することです。\n\n```\nFROM employees\n| STATS my_count = COUNT() BY LEFT(last_name, 1)\n| SORT `LEFT(last_name, 1)`\n```\n\n出力列名の指定は任意です。指定しない場合は、新しい列名が式と等しくなります。次のクエリーは列\"AVG(salary)\"を返します。\n\n```\nFROM employees\n| STATS AVG(salary)\n```\n\nこの名前には特殊文字が含まれているため、後続のコマンドで使用するときには、バッククオート(`)で囲む必要があります。\n\n```\nFROM employees\n| STATS AVG(salary)\n| EVAL avg_salary_rounded = ROUND(`AVG(salary)`)\n```\n\n**注**:グループなしのSTATSは、グループを追加するよりも大幅に高速です。\n\n**注**:単一式でのグループは、現在、複数式でのグループよりも大幅に最適化されています。\n ", + "languageDocumentationPopover.documentationESQL.stCentroidFunction": "ST_CENTROID_AGG", + "languageDocumentationPopover.documentationESQL.stCentroidFunction.markdown": "### ST_CENTROID_AGG\n**警告:この機能はテクニカルプレビュー中であり、将来のリリースでは変更されたり削除されたりする場合があります。Elasticはすべての問題の修正に努めますが、テクニカルプレビュー中の機能には正式なGA機能のサポートSLAが適用されません。**\n\n空間点ジオメトリタイプのフィールドで、空間中心を計算します。\n\n```\nFROM airports\n| STATS centroid=ST_CENTROID_AGG(location)\n```\n ", + "languageDocumentationPopover.documentationESQL.stringOperators": "LIKEおよびRLIKE", + "languageDocumentationPopover.documentationESQL.stringOperators.markdown": "### LIKEおよびRLIKE\nワイルドカードや正規表現を使った文字列比較にはLIKEまたはRLIKEを使います。\n\nワイルドカードを使って文字列を一致させるにはLIKEを使います。次のワイルドカード文字がサポートされています。\n\n* `*`は0文字以上と一致します。\n* `?`は1文字と一致します。\n\n```\nFROM employees\n| WHERE first_name LIKE \"?b*\"\n| KEEP first_name, last_name\n```\n\n正規表現を使って文字列を一致させるには、RLIKEを使います。\n\n```\nFROM employees\n| WHERE first_name RLIKE \".leja.*\"\n| KEEP first_name, last_name\n```\n ", + "languageDocumentationPopover.documentationESQL.substring": "SUBSTRING", + "languageDocumentationPopover.documentationESQL.substring.markdown": "\n\n ### SUBSTRING\n 文字列のサブ文字列を、開始位置とオプションの長さで指定して返します。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL ln_sub = SUBSTRING(last_name, 1, 3)\n ```\n ", + "languageDocumentationPopover.documentationESQL.sumFunction": "SUM", + "languageDocumentationPopover.documentationESQL.sumFunction.markdown": "### SUM\n数値フィールドの合計を返します。\n\n```\nFROM employees\n| STATS SUM(languages)\n```\n\n式はインライン関数を使用できます。たとえば、各従業員の最大給与変動の総計を計算するには、MV_MAX関数を各行に適用してから、その結果にSUMを適用します。\n\n```\nFROM employees\n| STATS total_salary_changes = SUM(MV_MAX(salary_change))\n```\n ", + "languageDocumentationPopover.documentationESQL.tan": "TAN", + "languageDocumentationPopover.documentationESQL.tan.markdown": "\n\n ### TAN\n 角度の正接三角関数を返します。\n\n ```\n ROW a=1.8 \n | EVAL tan=TAN(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.tanh": "TANH", + "languageDocumentationPopover.documentationESQL.tanh.markdown": "\n\n ### TANH\n 角度の正接双曲線関数を返します。\n\n ```\n ROW a=1.8 \n | EVAL tanh=TANH(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.tau": "TAU", + "languageDocumentationPopover.documentationESQL.tau.markdown": "\n\n ### TAU\n 円の円周と半径の比率を返します。\n\n ```\n ROW TAU()\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_base64": "TO_BASE64", + "languageDocumentationPopover.documentationESQL.to_base64.markdown": "\n\n ### TO_BASE64\n 文字列をbase64文字列にエンコードします。\n\n ```\n row a = \"elastic\" \n | eval e = to_base64(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_boolean": "TO_BOOLEAN", + "languageDocumentationPopover.documentationESQL.to_boolean.markdown": "\n\n ### TO_BOOLEAN\n 入力値をブール値に変換します。\n 文字列値*true*は、大文字小文字を区別せずにブール値*true*に変換されます。\n 空文字列を含むそれ以外の値に対しては、この関数は*false*を返します。\n 数値*0*は*false*に変換され、それ以外は*true*に変換されます。\n\n ```\n ROW str = [\"true\", \"TRuE\", \"false\", \"\", \"yes\", \"1\"]\n | EVAL bool = TO_BOOLEAN(str)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_cartesianpoint": "TO_CARTESIANPOINT", + "languageDocumentationPopover.documentationESQL.to_cartesianpoint.markdown": "\n\n ### TO_CARTESIANPOINT\n 入力値をcartesian_point値に変換します。\n 文字列は、WKT Point形式に従っている場合にのみ、正常に変換されます。\n\n ```\n ROW wkt = [\"POINT(4297.11 -1475.53)\", \"POINT(7580.93 2272.77)\"]\n | MV_EXPAND wkt\n | EVAL pt = TO_CARTESIANPOINT(wkt)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_cartesianshape": "TO_CARTESIANSHAPE", + "languageDocumentationPopover.documentationESQL.to_cartesianshape.markdown": "\n\n ### TO_CARTESIANSHAPE\n 入力値をcartesian_shape値に変換します。\n 文字列は、WKT形式に従っている場合にのみ、正常に変換されます。\n\n ```\n ROW wkt = [\"POINT(4297.11 -1475.53)\", \"POLYGON ((3339584.72 1118889.97, 4452779.63 4865942.27, 2226389.81 4865942.27, 1113194.90 2273030.92, 3339584.72 1118889.97))\"]\n | MV_EXPAND wkt\n | EVAL geom = TO_CARTESIANSHAPE(wkt)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_datetime": "TO_DATETIME", + "languageDocumentationPopover.documentationESQL.to_datetime.markdown": "\n\n ### TO_DATETIME\n 入力値を日付値に変換します。\n 文字列は、yyyy-MM-dd'T'HH:mm:ss.SSS'Z'の書式に従っている場合のみ変換が成功します。\n 日付を他の形式に変換するには、DATE_PARSEを使用します。\n\n ```\n ROW string = [\"1953-09-02T00:00:00.000Z\", \"1964-06-02T00:00:00.000Z\", \"1964-06-02 00:00:00\"]\n | EVAL datetime = TO_DATETIME(string)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_degrees": "TO_DEGREES", + "languageDocumentationPopover.documentationESQL.to_degrees.markdown": "\n\n ### TO_DEGREES\n ラジアンの数値を度数に変換します。\n\n ```\n ROW rad = [1.57, 3.14, 4.71]\n | EVAL deg = TO_DEGREES(rad)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_double": "TO_DOUBLE", + "languageDocumentationPopover.documentationESQL.to_double.markdown": "\n\n ### TO_DOUBLE\n 入力値をdouble値に変換します。入力パラメーターが日付型の場合、その値はUnixのエポックからのミリ秒として解釈され、doubleに変換されます。\n \n ブール値の*true*はdouble値の*1.0*に、*false*は*0.0*に変換されます。\n\n ```\n ROW str1 = \"5.20128E11\", str2 = \"foo\"\n | EVAL dbl = TO_DOUBLE(\"520128000000\"), dbl1 = TO_DOUBLE(str1), dbl2 = TO_DOUBLE(str2)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_geopoint": "TO_GEOPOINT", + "languageDocumentationPopover.documentationESQL.to_geopoint.markdown": "\n\n ### TO_GEOPOINT\n 入力値をgeo_point値に変換します。\n 文字列は、WKT Point形式に従っている場合にのみ、正常に変換されます。\n\n ```\n ROW wkt = \"POINT(42.97109630194 14.7552534413725)\"\n | EVAL pt = TO_GEOPOINT(wkt)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_geoshape": "TO_GEOSHAPE", + "languageDocumentationPopover.documentationESQL.to_geoshape.markdown": "\n\n ### TO_GEOSHAPE\n 入力値をgeo_shape値に変換します。\n 文字列は、WKT形式に従っている場合にのみ、正常に変換されます。\n\n ```\n ROW wkt = \"POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))\"\n | EVAL geom = TO_GEOSHAPE(wkt)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_integer": "TO_INTEGER", + "languageDocumentationPopover.documentationESQL.to_integer.markdown": "\n\n ### TO_INTEGER\n 入力値を整数値に変換します。\n 入力パラメーターが日付型の場合、その値はUnixのエポックからのミリ秒として解釈され、整数に変換されます。\n \n ブール値*true*は整数*1*に、*false*は*0*に変換されます。\n\n ```\n ROW long = [5013792, 2147483647, 501379200000]\n | EVAL int = TO_INTEGER(long)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_ip": "TO_IP", + "languageDocumentationPopover.documentationESQL.to_ip.markdown": "\n\n ### TO_IP\n 入力文字列をIP値に変換します。\n\n ```\n ROW str1 = \"1.1.1.1\", str2 = \"foo\"\n | EVAL ip1 = TO_IP(str1), ip2 = TO_IP(str2)\n | WHERE CIDR_MATCH(ip1, \"1.0.0.0/8\")\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_long": "TO_LONG", + "languageDocumentationPopover.documentationESQL.to_long.markdown": "\n\n ### TO_LONG\n 入力値をlong値に変換します。入力パラメーターが日付型の場合、\n その値はUnixのエポックからのミリ秒として解釈され、longに変換されます。\n ブール値の*true*は*long*値の*1*に、*false*は*0*に変換されます。\n\n ```\n ROW str1 = \"2147483648\", str2 = \"2147483648.2\", str3 = \"foo\"\n | EVAL long1 = TO_LONG(str1), long2 = TO_LONG(str2), long3 = TO_LONG(str3)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_lower": "TO_LOWER", + "languageDocumentationPopover.documentationESQL.to_lower.markdown": "\n\n ### TO_LOWER\n 小文字に変換された入力文字列を表す新しい文字列を返します。\n\n ```\n ROW message = \"Some Text\"\n | EVAL message_lower = TO_LOWER(message)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_radians": "TO_RADIANS", + "languageDocumentationPopover.documentationESQL.to_radians.markdown": "\n\n ### TO_RADIANS\n 度数をラジアンに変換します。\n\n ```\n ROW deg = [90.0, 180.0, 270.0]\n | EVAL rad = TO_RADIANS(deg)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_string": "TO_STRING", + "languageDocumentationPopover.documentationESQL.to_string.markdown": "\n\n ### TO_STRING\n 入力値を文字列に変換します。\n\n ```\n ROW a=10\n | EVAL j = TO_STRING(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_unsigned_long": "TO_UNSIGNED_LONG", + "languageDocumentationPopover.documentationESQL.to_unsigned_long.markdown": "\n\n ### TO_UNSIGNED_LONG\n 入力値を符号なしlong値に変換します。入力パラメーターが日付型の場合、\n その値はUnixのエポックからのミリ秒として解釈され、符号なしlong値に変換されます。\n ブール値の*true*は符号なし*long*値の*1*に、*false*は*0*に変換されます。\n\n ```\n ROW str1 = \"2147483648\", str2 = \"2147483648.2\", str3 = \"foo\"\n | EVAL long1 = TO_UNSIGNED_LONG(str1), long2 = TO_ULONG(str2), long3 = TO_UL(str3)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_upper": "TO_UPPER", + "languageDocumentationPopover.documentationESQL.to_upper.markdown": "\n\n ### TO_UPPER\n 大文字に変換された入力文字列を表す新しい文字列を返します。\n\n ```\n ROW message = \"Some Text\"\n | EVAL message_upper = TO_UPPER(message)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_version": "TO_VERSION", + "languageDocumentationPopover.documentationESQL.to_version.markdown": "\n\n ### TO_VERSION\n 入力文字列をバージョン値に変換します。\n\n ```\n ROW v = TO_VERSION(\"1.2.3\")\n ```\n ", + "languageDocumentationPopover.documentationESQL.trim": "TRIM", + "languageDocumentationPopover.documentationESQL.trim.markdown": "\n\n ### TRIM\n 文字列から先頭と末尾の空白を削除します。\n\n ```\n ROW message = \" some text \", color = \" red \"\n | EVAL message = TRIM(message)\n | EVAL color = TRIM(color)\n ```\n ", + "languageDocumentationPopover.documentationESQL.valuesFunction": "VALUES", + "languageDocumentationPopover.documentationESQL.valuesFunction.markdown": "### 値\n\n**警告:本番環境ではVALUESを使用しないでください。この機能はテクニカルプレビュー中であり、将来のリリースでは変更されたり削除されたりする場合があります。Elasticはすべての問題の修正に努めますが、テクニカルプレビュー中の機能には正式なGA機能のサポートSLAが適用されません。**\n\nグループのすべての値を複数値フィールドとして返します。返された値の順序は保証されません。返された値を並べ替える必要がある場合はMV_SORTを使用します。\n\ngeo_point、cartesian_point、geo_shape、またはcartesian_shapeを除く任意のタイプの式を使用できます。\n\n\n例:\n\n```\n FROM employees\n| EVAL first_letter = SUBSTRING(first_name, 0, 1)\n| STATS first_name=MV_SORT(VALUES(first_name)) BY first_letter\n| SORT first_letter\n```\n\n> _**警告:** これはメモリの使用量が非常に大きくなるため、ES|QLはメモリを超えると、集約を拡大しません。このため、この集約は、収集する値がメモリに収まらなくなるまでは機能します。収集する値が多くなりすぎると、[回路ブレーカーエラー](https://www.elastic.co/guide/en/elasticsearch/reference/current/circuit-breaker-errors.html)でクエリが失敗します。_\n\n ", + "languageDocumentationPopover.documentationESQL.where": "WHERE", + "languageDocumentationPopover.documentationESQL.where.markdown": "### WHERE\nWHEREを使用すると、入力テーブルから、指定した条件がtrueと評価されるすべての行を含むテーブルを作成します。\n \n```\nFROM employees\n| KEEP first_name, last_name, still_hired\n| WHERE still_hired == true\n```\n\n#### 演算子\n\nサポートされている演算子の概要については、**演算子**を参照してください。\n\n#### 関数\nWHEREは値を計算するためのさまざまな関数をサポートしています。**関数**をクリックすると詳細が表示されます。\n ", "textBasedEditor.query.textBasedLanguagesEditor.EnableWordWrapLabel": "パイプの改行を追加", "textBasedEditor.query.textBasedLanguagesEditor.errorCount": "{count} {count, plural, other {# 件のエラー}}", "textBasedEditor.query.textBasedLanguagesEditor.errorsTitle": "エラー", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index f7a9f3797f9b58..535f180f6868ce 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -7210,253 +7210,253 @@ "textBasedEditor.query.textBasedLanguagesEditor.collapseLabel": "折叠", "textBasedEditor.query.textBasedLanguagesEditor.commandsDescription": "源命令会生成一个表,其中通常包含来自 Elasticsearch 的数据。ES|QL 支持以下源命令。", "textBasedEditor.query.textBasedLanguagesEditor.disableWordWrapLabel": "移除管道符上的换行符", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.abs": "ABS", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.abs.markdown": "\n\n ### ABS\n 返回绝对值。\n\n ```\n ROW number = -1.0 \n | EVAL abs_number = ABS(number)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.acos": "ACOS", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.acos.markdown": "\n\n ### ACOS\n 返回 `n` 的反余弦作为角度,以弧度表示。\n\n ```\n ROW a=.9\n | EVAL acos=ACOS(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.asin": "ASIN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.asin.markdown": "\n\n ### ASIN\n 返回输入数字表达式的反正弦\n 作为角度,以弧度表示。\n\n ```\n ROW a=.9\n | EVAL asin=ASIN(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.atan": "ATAN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.atan.markdown": "\n\n ### ATAN\n 返回输入数字表达式的反正切\n 作为角度,以弧度表示。\n\n ```\n ROW a=12.9\n | EVAL atan=ATAN(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.atan2": "ATAN2", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.atan2.markdown": "\n\n ### ATAN2\n 笛卡儿平面中正 x 轴\n 与从原点到点 (x , y) 构成的射线之间的角度,以弧度表示。\n\n ```\n ROW y=12.9, x=.6\n | EVAL atan2=ATAN2(y, x)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.autoBucketFunction": "BUCKET", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.autoBucketFunction.markdown": "### BUCKET\n用日期时间或数字输入创建值(存储桶)的分组。存储桶的大小可以直接提供,或基于建议的计数和值范围进行选择。\n\n`BUCKET` 以两种模式运行:\n\n1.在此模式下基于存储桶计数建议(四个参数)和范围计算存储桶的大小。\n2.在此模式下直接提供存储桶大小(两个参数)。\n\n使用存储桶的目标数量、起始范围和结束范围,`BUCKET` 将选取适当的存储桶大小以生成目标数量或更小数量的存储桶。\n\n例如,一年请求多达 20 个存储桶会按每月时间间隔组织数据:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT hire_date\n```\n\n**注意**:目标并不是提供存储桶的确切目标数量,而是选择一个范围,最多提供存储桶的目标数量。\n\n可以组合 `BUCKET` 与聚合以创建直方图:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_month = COUNT(*) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT month\n```\n\n**注意**:`BUCKET` 不会创建未匹配任何文档的存储桶。因此,上一示例缺少 `1985-03-01` 和其他日期。\n\n如果需要更多存储桶,可能导致更小的范围。例如,如果一年内最多请求 100 个存储桶,会导致周期为周的存储桶:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 100, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT week\n```\n\n**注意**:`AUTO_BUCKET` 不筛选任何行。它只会使用提供的范围来选取适当的存储桶大小。对于值超出范围的行,它会返回与超出范围的存储桶对应的存储桶值。组合 `BUCKET` 与 `WHERE` 可筛选行。\n\n如果提前已知所需存储桶大小,则只需提供它作为第二个参数,而忽略范围:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 1 week)\n| SORT week\n```\n\n**注意**:提供存储桶大小作为第二个参数时,它必须为持续时间或日期期间。\n\n`BUCKET` 还可对数字字段执行操作。例如,要创建工资直方图:\n\n```\nFROM employees\n| STATS COUNT(*) by bs = BUCKET(salary, 20, 25324, 74999)\n| SORT bs\n```\n\n与前面的有意筛选日期范围示例不同,您极少想要筛选数值范围。您必须分别查找最小值和最大值。ES|QL 尚未提供简便方法来自动执行此操作。\n\n如果提前已知所需存储桶大小,则可以忽略该范围。只需提供它作为第二个参数即可:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS c = COUNT(1) BY b = BUCKET(salary, 5000.)\n| SORT b\n```\n\n**注意**:提供存储桶大小作为第二个参数时,它必须为 **浮点类型**。\n\n这里提供了一个示例,用于为过去 24 小时创建小时存储桶,并计算每小时的事件数:\n\n```\nFROM sample_data\n| WHERE @timestamp >= NOW() - 1 day and @timestamp < NOW()\n| STATS COUNT(*) BY bucket = BUCKET(@timestamp, 25, NOW() - 1 day, NOW())\n```\n\n这里提供了一个示例,用于为 1985 年创建月度存储桶,并按聘用月份计算平均工资:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS AVG(salary) BY bucket = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT bucket\n```\n\n`BUCKET` 可用在 `STATS …​ BY …`​ 命令的聚合和分组部分, 前提是在聚合部分中,该函数 **由在分组部分中定义的别名引用**,或使用完全相同的表达式调用。\n\n例如:\n\n```\nFROM employees\n| STATS s1 = b1 + 1, s2 = BUCKET(salary / 1000 + 999, 50.) + 2 BY b1 = BUCKET(salary / 100 + 99, 50.), b2 = BUCKET(salary / 1000 + 999, 50.)\n| SORT b1, b2\n| KEEP s1, b1, s2, b2\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.avgFunction": "AVG", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.avgFunction.markdown": "### AVG\n返回数字字段的平均值。\n\n```\nFROM employees\n| STATS AVG(height)\n```\n\n此表达式可使用内联函数。例如,要计算一个多值列的平均值,应首先使用 `MV_AVG` 对每行的多个值求平均值,然后将结果用于 `AVG` 函数:\n\n```\nFROM employees\n| STATS avg_salary_change = AVG(MV_AVG(salary_change))\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.binaryOperators": "二进制运算符", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.binaryOperators.markdown": "### 二进制运算符\n支持这些二进制比较运算符:\n\n* 等于:`==`\n* 不等于:`!=`\n* 小于:`<`\n* 小于或等于:`<=`\n* 大于:`>`\n* 大于或等于:`>=`\n* 加:`+`\n* 减:`-`\n* 乘:`*`\n* 除:`/`\n* 取模:`%`\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.booleanOperators": "布尔运算符", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.booleanOperators.markdown": "### 布尔运算符\n支持以下布尔运算符:\n\n* `AND`\n* `OR`\n* `NOT`\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.bucket": "BUCKET", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.bucket.markdown": "\n\n ### BUCKET\n 用日期时间或数字输入创建值(存储桶)的分组。\n 存储桶的大小可以直接提供,或基于建议的计数和值范围进行选择。\n\n ```\n FROM employees\n | WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n | STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n | SORT hire_date\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.case": "CASE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.case.markdown": "\n\n ### CASE\n 接受成对的条件和值。此函数返回属于第一个\n 评估为 `true` 的条件的值。\n\n 如果参数数量为奇数,则最后一个参数为\n 在无条件匹配时返回的默认值。如果参数数量为偶数,且\n 无任何条件匹配,则此函数返回 `null`。\n\n ```\n FROM employees\n | EVAL type = CASE(\n languages <= 1, \"monolingual\",\n languages <= 2, \"bilingual\",\n \"polyglot\")\n | KEEP emp_no, languages, type\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.castOperator": "Cast (::)", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.castOperator.markdown": "### CAST (`::`)\n`::` 运算符为 `TO_` 类型转换函数提供了实用的替代语法。\n\n例如:\n```\nROW ver = CONCAT((\"0\"::INT + 1)::STRING, \".2.3\")::VERSION\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cbrt": "CBRT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cbrt.markdown": "\n\n ### CBRT\n 返回数字的立方根。输入可以为任何数字值,返回值始终为双精度值。\n 无穷大的立方根为 null。\n\n ```\n ROW d = 1000.0\n | EVAL c = cbrt(d)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ceil": "CEIL", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ceil.markdown": "\n\n ### CEIL\n 将数字四舍五入为最近的整数。\n\n ```\n ROW a=1.8\n | EVAL a=CEIL(a)\n ```\n 注意:对于 `long`(包括无符号值)和 `integer`,这相当于“无操作”。对于 `double`,这会提取最接近整数的 `double` 值,类似于 Math.ceil。\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cidr_match": "CIDR_MATCH", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cidr_match.markdown": "\n\n ### CIDR_MATCH\n 如果提供的 IP 包含在所提供的其中一个 CIDR 块中,则返回 true。\n\n ```\n FROM hosts \n | WHERE CIDR_MATCH(ip1, \"127.0.0.2/32\", \"127.0.0.3/32\") \n | KEEP card, host, ip0, ip1\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.coalesce": "COALESCE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.coalesce.markdown": "\n\n ### COALESCE\n 返回它的第一个不为 null 的参数。如果所有参数均为 null,则返回 `null`。\n\n ```\n ROW a=null, b=\"b\"\n | EVAL COALESCE(a, b)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.concat": "CONCAT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.concat.markdown": "\n\n ### CONCAT\n 串联两个或多个字符串。\n\n ```\n FROM employees\n | KEEP first_name, last_name\n | EVAL fullname = CONCAT(first_name, \" \", last_name)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cos": "COS", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cos.markdown": "\n\n ### COS\n 返回角度的余弦。\n\n ```\n ROW a=1.8 \n | EVAL cos=COS(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cosh": "COSH", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.cosh.markdown": "\n\n ### COSH\n 返回角度的双曲余弦。\n\n ```\n ROW a=1.8 \n | EVAL cosh=COSH(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.countDistinctFunction": "COUNT_DISTINCT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.countDistinctFunction.markdown": "### COUNT_DISTINCT\n对不同值的近似数进行计数。\n\n```\nFROM hosts\n| STATS COUNT_DISTINCT(ip0), COUNT_DISTINCT(ip1)\n```\n\n`COUNT_DISTINCT` 函数为基于 HyperLogLog++ 算法的近似计算。请参阅此[文档](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-cardinality-aggregation.html#_counts_are_approximate)了解更多信息。精确度可使用可选的第二个参数进行配置。支持的最大值为 40000。高于此数字的阈值与阈值 40000 的效果相同。默认值为 3000。\n\n```\nFROM hosts\n| STATS COUNT_DISTINCT(ip0, 80000), COUNT_DISTINCT(ip1, 5)\n```\n\n此表达式可使用内联函数。此示例会使用 `SPLIT` 函数将字符串拆分成多个值,并对唯一值进行计数:\n\n```\nROW words=\"foo;bar;baz;qux;quux;foo\"\n| STATS distinct_word_count = COUNT_DISTINCT(SPLIT(words, \";\"))\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.countFunction": "COUNT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.countFunction.markdown": "### COUNT\n返回输入值的总数(计数)。\n\n```\nFROM employees\n| STATS COUNT(height)\n```\n\n可接受任何字段类型作为输入。\n\n要计算行数,请使用 `COUNT()` 或 `COUNT(*)`:\n\n```\nFROM employees\n| STATS count = COUNT(*) BY languages\n| SORT languages DESC\n```\n\n此表达式可使用内联函数。此示例会使用 `SPLIT` 函数将字符串拆分成多个值,并对值进行计数:\n\n```\nROW words=\"foo;bar;baz;qux;quux;foo\"\n| STATS word_count = COUNT(SPLIT(words, \";\"))\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_diff": "DATE_DIFF", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_diff.markdown": "\n\n ### DATE_DIFF\n 从 `endTimestamp` 中减去 `startTimestamp`,并以倍数 `unit` 返回差异。\n 如果 `startTimestamp` 晚于 `endTimestamp`,则返回负值。\n\n ```\n ROW date1 = TO_DATETIME(\"2023-12-02T11:00:00.000Z\"), date2 = TO_DATETIME(\"2023-12-02T11:00:00.001Z\")\n | EVAL dd_ms = DATE_DIFF(\"microseconds\", date1, date2)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_extract": "DATE_EXTRACT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_extract.markdown": "\n\n ### DATE_EXTRACT\n 提取日期的某些部分,如年、月、日、小时。\n\n ```\n ROW date = DATE_PARSE(\"yyyy-MM-dd\", \"2022-05-06\")\n | EVAL year = DATE_EXTRACT(\"year\", date)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_format": "DATE_FORMAT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_format.markdown": "\n\n ### DATE_FORMAT\n 以提供的格式返回日期的字符串表示形式。\n\n ```\n FROM employees\n | KEEP first_name, last_name, hire_date\n | EVAL hired = DATE_FORMAT(\"YYYY-MM-dd\", hire_date)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_parse": "DATE_PARSE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_parse.markdown": "\n\n ### DATE_PARSE\n 通过使用在第一个参数中指定的格式来解析第二个参数,从而返回日期。\n\n ```\n ROW date_string = \"2022-05-06\"\n | EVAL date = DATE_PARSE(\"yyyy-MM-dd\", date_string)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_trunc": "DATE_TRUNC", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.date_trunc.markdown": "\n\n ### DATE_TRUNC\n 将日期向下舍入到最近的时间间隔。\n\n ```\n FROM employees\n | KEEP first_name, last_name, hire_date\n | EVAL year_hired = DATE_TRUNC(1 year, hire_date)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.dissect": "DISSECT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.dissect.markdown": "### DISSECT\n使用 `DISSECT`,您可以从字符串中提取结构化数据。`DISSECT` 将根据基于分隔符的模式来匹配字符串,并提取指定键作为列。\n\n请参阅[分解处理器文档](https://www.elastic.co/guide/en/elasticsearch/reference/current/dissect-processor.html)了解分解模式的语法。\n\n```\nROW a = \"1953-01-23T12:15:00Z - some text - 127.0.0.1\"\n| DISSECT a \"%'{Y}-%{M}-%{D}T%{h}:%{m}:%{s}Z - %{msg} - %{ip}'\"\n``` ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.drop": "DROP", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.drop.markdown": "### DROP\n使用 `DROP` 可从表中移除列:\n \n```\nFROM employees\n| DROP height\n```\n\n您不必按名称指定每个列,而可以使用通配符丢弃名称匹配某种模式的所有列:\n\n```\nFROM employees\n| DROP height*\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.e": "E", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.e.markdown": "\n\n ### E\n 返回 Euler 函数的编号。\n\n ```\n ROW E()\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ends_with": "ENDS_WITH", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ends_with.markdown": "\n\n ### ENDS_WITH\n 返回布尔值,指示关键字字符串是否以另一个字符串结尾。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL ln_E = ENDS_WITH(last_name, \"d\")\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.enrich": "ENRICH", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.enrich.markdown": "### ENRICH\n您可以使用 `ENRICH` 将来自现有索引的数据添加到传入记录中。它类似于[采集扩充](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html),但作用于查询时间。\n\n```\nROW language_code = \"1\"\n| ENRICH languages_policy\n```\n\n执行 `ENRICH` 需要[扩充策略](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html#enrich-policy)。扩充策略定义一个匹配字段(键字段)和一组扩充字段。\n\n`ENRICH` 将根据匹配字段值在[扩充索引](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html#enrich-index)中查找记录。输入数据集中的匹配键可以使用 `ON ` 来定义;如果未指定,将对字段名称与在扩充策略中定义的匹配字段相同的字段执行匹配。\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a\n```\n\n您可以使用 `WITH , ...` 语法指定必须将哪些属性(在那些在策略中定义为扩充字段的字段之间)添加到结果中。\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a WITH language_name\n```\n\n还可以使用 `WITH new_name=` 重命名属性\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a WITH name = language_name\n```\n\n默认情况下(如果未定义任何 `WITH`),`ENRICH` 会将在扩充策略中定义的所有扩充字段添加到结果中。\n\n如果出现名称冲突,新创建的字段将覆盖现有字段。\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.eval": "EVAL", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.eval.markdown": "### EVAL\n`EVAL` 允许您添加新列:\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| EVAL height_feet = height * 3.281, height_cm = height * 100\n```\n\n如果指定列已存在,将丢弃现有列,并将新列追加到表后面:\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| EVAL height = height * 3.281\n```\n\n#### 函数\n`EVAL` 支持各种用于计算值的函数。请参阅“函数”了解更多信息。\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.floor": "FLOOR", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.floor.markdown": "\n\n ### FLOOR\n 将数字向下舍入到最近的整数。\n\n ```\n ROW a=1.8\n | EVAL a=FLOOR(a)\n ```\n 注意:对于 `long`(包括无符号值)和 `integer`,这相当于“无操作”。\n 对于 `double`,这会提取最接近整数的 `double` 值,\n 类似于 Math.floor。\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.from": "FROM", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.from_base64": "FROM_BASE64", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.from_base64.markdown": "\n\n ### FROM_BASE64\n 解码 base64 字符串。\n\n ```\n row a = \"ZWxhc3RpYw==\" \n | eval d = from_base64(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.from.markdown": "### FROM\n`FROM` 源命令返回一个表,其中最多包含 10,000 个来自数据流、索引或别名的文档。生成的表中的每一行代表一个文档。每一列对应一个字段,并可以通过该字段的名称进行访问。\n\n```\nFROM employees\n```\n\n您可以使用[日期数学表达式](https://www.elastic.co/guide/en/elasticsearch/reference/current/api-conventions.html#api-date-math-index-names)来引用索引、别名和数据流。这可能对时间序列数据非常有用。\n\n使用逗号分隔列表或通配符可查询多个数据流、索引或别名:\n\n```\nFROM employees-00001,employees-*\n```\n\n#### 元数据\n\nES|QL 可访问以下元数据字段:\n\n* `_index`:文档所属的索引。字段类型为 `keyword`.\n* `_id`:源文档的 ID。字段类型为 `keyword`.\n* `_version`:源文档的版本。字段类型为 `long`。\n\n使用 `METADATA` 指令可启用元数据字段:\n\n```\nFROM index [METADATA _index, _id]\n```\n\n元数据字段仅在数据源为索引时可用。因此,`FROM` 是唯一支持 `METADATA` 指令的源命令。\n\n启用后,这些字段将可用于后续处理命令,就像其他索引字段一样:\n\n```\nFROM ul_logs, apps [METADATA _index, _version]\n| WHERE id IN (13, 14) AND _version == 1\n| EVAL key = CONCAT(_index, \"_\", TO_STR(id))\n| SORT id, _index\n| KEEP id, _index, _version, key\n```\n\n此外,与索引字段类似,一旦执行了聚合,后续命令将无法再访问元数据字段,除非它用作分组字段:\n\n```\nFROM employees [METADATA _index, _id]\n| STATS max = MAX(emp_no) BY _index\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.greatest": "GREATEST", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.greatest.markdown": "\n\n ### GREATEST\n 返回多个列中的最大值。除了可一次对多个列运行以外,\n 此函数与 `MV_MAX` 类似。\n\n ```\n ROW a = 10, b = 20\n | EVAL g = GREATEST(a, b)\n ```\n 注意:对 `keyword` 或 `text` 字段运行时,此函数将按字母顺序返回最后一个字符串。对 `boolean` 列运行时,如果任何值为 `true`,此函数将返回 `true`。\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.grok": "GROK", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.grok.markdown": "### GROK\n使用 `GROK`,您可以从字符串中提取结构化数据。`GROK` 将基于正则表达式根据模式来匹配字符串,并提取指定模式作为列。\n\n请参阅 [grok 处理器文档](https://www.elastic.co/guide/en/elasticsearch/reference/current/grok-processor.html)了解 grok 模式的语法。\n\n```\nROW a = \"12 15.5 15.6 true\"\n| GROK a \"%'{NUMBER:b:int}' %'{NUMBER:c:float}' %'{NUMBER:d:double}' %'{WORD:e:boolean}'\"\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.inOperator": "IN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.inOperator.markdown": "### IN\n`IN` 运算符允许测试字段或表达式是否等于文本、字段或表达式列表中的元素:\n\n```\nROW a = 1, b = 4, c = 3\n| WHERE c-a IN (3, b / 2, a)\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ip_prefix": "IP_PREFIX", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ip_prefix.markdown": "\n\n ### IP_PREFIX\n 截短 IP 至给定的前缀长度。\n\n ```\n row ip4 = to_ip(\"1.2.3.4\"), ip6 = to_ip(\"fe80::cae2:65ff:fece:feb9\")\n | eval ip4_prefix = ip_prefix(ip4, 24, 0), ip6_prefix = ip_prefix(ip6, 0, 112);\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.keep": "KEEP", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.keep.markdown": "### KEEP\n使用 `KEEP` 命令,您可以指定将返回哪些列以及返回这些列的顺序。\n\n要限制返回的列数,请使用列名的逗号分隔列表。将按指定顺序返回这些列:\n \n```\nFROM employees\n| KEEP first_name, last_name, height\n```\n\n您不必按名称指定每个列,而可以使用通配符返回名称匹配某种模式的所有列:\n\n```\nFROM employees\n| KEEP h*\n```\n\n星号通配符 (`*`) 自身将转换为不与其他参数匹配的所有列。此查询将首先返回所有名称以 h 开头的所有列,随后返回所有其他列:\n\n```\nFROM employees\n| KEEP h*, *\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.least": "LEAST", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.least.markdown": "\n\n ### LEAST\n 返回多个列中的最小值。除了可一次对多个列运行以外,此函数与 `MV_MIN` 类似。\n\n ```\n ROW a = 10, b = 20\n | EVAL l = LEAST(a, b)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.left": "LEFT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.left.markdown": "\n\n ### LEFT\n 返回从“字符串”中提取“长度”字符的子字符串,从左侧开始。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL left = LEFT(last_name, 3)\n | SORT last_name ASC\n | LIMIT 5\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.length": "LENGTH", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.length.markdown": "\n\n ### LENGTH\n 返回字符串的字符长度。\n\n ```\n FROM employees\n | KEEP first_name, last_name\n | EVAL fn_length = LENGTH(first_name)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.limit": "LIMIT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.limit.markdown": "### LIMIT\n`LIMIT` 处理命令允许您限制行数:\n \n```\nFROM employees\n| LIMIT 5\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.locate": "LOCATE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.locate.markdown": "\n\n ### LOCATE\n 返回一个整数,指示关键字子字符串在另一字符串中的位置\n\n ```\n row a = \"hello\"\n | eval a_ll = locate(a, \"ll\")\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.log": "LOG", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.log.markdown": "\n\n ### LOG\n 以某底数返回值的对数。输入可以为任何数字值,返回值始终为双精度值。\n\n 求零、负数的对数,以及底数为一时将返回 `null`,并显示警告。\n\n ```\n ROW base = 2.0, value = 8.0\n | EVAL s = LOG(base, value)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.log10": "LOG10", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.log10.markdown": "\n\n ### LOG10\n 以底数 10 返回值的对数。输入可以为任何数字值,返回值始终为双精度值。\n\n 求 0 和负数的对数时将返回 `null`,并显示警告。\n\n ```\n ROW d = 1000.0 \n | EVAL s = LOG10(d)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ltrim": "LTRIM", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.ltrim.markdown": "\n\n ### LTRIM\n 从字符串中移除前导空格。\n\n ```\n ROW message = \" some text \", color = \" red \"\n | EVAL message = LTRIM(message)\n | EVAL color = LTRIM(color)\n | EVAL message = CONCAT(\"'\", message, \"'\")\n | EVAL color = CONCAT(\"'\", color, \"'\")\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.markdown": "## ES|QL\n\nES|QL(Elasticsearch 查询语言)查询包含一系列命令,它们用管道字符分隔:`|`。每个查询以**源命令**开头,它会生成一个表,其中通常包含来自 Elasticsearch 的数据。\n\n源命令可后接一个或多个**处理命令**。处理命令可通过添加、移除以及更改行和列来更改前一个命令的输出表。\n\n```\nsource-command\n| processing-command1\n| processing-command2\n```\n\n查询的结果为由最后的处理命令生成的表。 \n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.maxFunction": "MAX", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.maxFunction.markdown": "### MAX\n返回数字表达式的最大值。\n\n```\nFROM employees\n| STATS MAX(languages)\n```\n\n此表达式可使用内联函数。例如,要计算一个多值列的平均值的最大值,应首先使用 `MV_AVG` 对每行的多个值求平均值,然后将结果用于 `MAX` 函数:\n\n```\nFROM employees\n| STATS max_avg_salary_change = MAX(MV_AVG(salary_change))\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.medianAbsoluteDeviationFunction": "MEDIAN_ABSOLUTE_DEVIATION", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.medianAbsoluteDeviationFunction.markdown": "### MEDIAN_ABSOLUTE_DEVIATION\n返回中位数绝对偏差,衡量可变性。这是一种稳健统计,意味着它可用于描述可能包含离群值,或可能不是正态分布的数据。对于此类数据,它比标准偏差更具描述性。\n\n它计算为每个数据点的中位数与整个样例的中位数的偏差。也就是说,对于随机变量 X,中位数绝对偏差为 `median(|median(X) - X|)`。\n\n```\nFROM employees\n| STATS MEDIAN(salary), MEDIAN_ABSOLUTE_DEVIATION(salary)\n```\n\n注意:与 `PERCENTILE` 一样,`MEDIAN_ABSOLUTE_DEVIATION` 通常为基于 TDigest 算法的近似计算。`MEDIAN_ABSOLUTE_DEVIATION` 也具有非确定性。这意味着,即使使用相同的数据,但您得到的结果可能会略有不同。\n\n此表达式可使用内联函数。例如,要计算一个多值列的最大值的中位数绝对偏差,应首先使用 `MV_MAX` 获取每行的最大值,然后将结果用于 `MEDIAN_ABSOLUTE_DEVIATION` 函数:\n\n```\nFROM employees\n| STATS m_a_d_max_salary_change = MEDIAN_ABSOLUTE_DEVIATION(MV_MAX(salary_change))\n```\n\n", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.medianFunction": "MEDIAN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.medianFunction.markdown": "### MEDIAN\n返回大于所有值的一半且小于所有值的一半的值,也称为 50% `PERCENTILE`。\n\n**注意:**与 `PERCENTILE` 一样,`MEDIAN` 通常为基于 TDigest 算法的近似计算。\n\n**警告:** `MEDIAN` 也具有[非确定性](https://en.wikipedia.org/wiki/Nondeterministic_algorithm)。这意味着,即使使用相同的数据,但您得到的结果可能会略有不同。\n\n例如:\n\n```\nFROM employees\n| STATS MEDIAN(salary), PERCENTILE(salary, 50)\n```\n\n此表达式可使用内联函数。例如,要计算一个多值列的最大值的中位数,应首先使用 `MV_MAX` 获取每行的最大值,然后将结果用于 `MEDIAN` 函数:\n\n```\nFROM employees\n| STATS median_max_salary_change = MEDIAN(MV_MAX(salary_change))\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.minFunction": "MIN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.minFunction.markdown": "### MIN\n返回数字字段的最小值。\n\n```\nFROM employees\n| STATS MIN(languages)\n```\n\n此表达式可使用内联函数。例如,要计算一个多值列的平均值的最小值,应首先使用 `MV_AVG` 对每行的多个值求平均值,然后将结果用于 `MIN` 函数:\n\n```\nFROM employees\n| STATS min_avg_salary_change = MIN(MV_AVG(salary_change))\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_append": "MV_APPEND", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_append.markdown": "\n\n ### MV_APPEND\n 串联两个多值字段的值。\n\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_avg": "MV_AVG", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_avg.markdown": "\n\n ### MV_AVG\n 将多值字段转换为包含所有值的平均值的单值字段。\n\n ```\n ROW a=[3, 5, 1, 6]\n | EVAL avg_a = MV_AVG(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_concat": "MV_CONCAT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_concat.markdown": "\n\n ### MV_CONCAT\n 将多值字符串表达式转换为单值列,其中包含由分隔符分隔的所有值的串联形式。\n\n ```\n ROW a=[\"foo\", \"zoo\", \"bar\"]\n | EVAL j = MV_CONCAT(a, \", \")\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_count": "MV_COUNT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_count.markdown": "\n\n ### MV_COUNT\n 将多值表达式转换为包含值计数的单值列。\n\n ```\n ROW a=[\"foo\", \"zoo\", \"bar\"]\n | EVAL count_a = MV_COUNT(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_dedupe": "MV_DEDUPE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_dedupe.markdown": "\n\n ### MV_DEDUPE\n 移除多值字段中的重复值。\n\n ```\n ROW a=[\"foo\", \"foo\", \"bar\", \"foo\"]\n | EVAL dedupe_a = MV_DEDUPE(a)\n ```\n 注意:`MV_DEDUPE` 可能但不会始终对列中的值进行排序。\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_first": "MV_FIRST", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_first.markdown": "\n\n ### MV_FIRST\n 将多值表达式转换为包含第一个值的\n 单值列。这在从按已知顺序发出多值列的\n 函数(如 `SPLIT`)中读取数据时尤其有用。\n\n 无法保证从底层存储\n 读取多值字段的顺序。它 *通常* 为升序,但不应\n 依赖于此。如果需要最小值,请使用 `MV_MIN` 而不是\n `MV_FIRST`。`MV_MIN` 针对排序值进行了优化,因此\n 对 `MV_FIRST` 没有性能优势。\n\n ```\n ROW a=\"foo;bar;baz\"\n | EVAL first_a = MV_FIRST(SPLIT(a, \";\"))\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_last": "MV_LAST", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_last.markdown": "\n\n ### MV_LAST\n 将多值表达式转换为包含最后一个值的单值\n 列。这在从按已知顺序发出多值列的函数\n (如 `SPLIT`)中读取数据时尤其有用。\n\n 无法保证从底层存储\n 读取多值字段的顺序。它 *通常* 为升序,但不应\n 依赖于此。如果需要最大值,请使用 `MV_MAX` 而不是\n `MV_LAST`。`MV_MAX` 针对排序值进行了优化,因此\n 对 `MV_LAST` 没有性能优势。\n\n ```\n ROW a=\"foo;bar;baz\"\n | EVAL last_a = MV_LAST(SPLIT(a, \";\"))\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_max": "MV_MAX", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_max.markdown": "\n\n ### MV_MAX\n 将多值表达式转换为包含最大值的单值列。\n\n ```\n ROW a=[3, 5, 1]\n | EVAL max_a = MV_MAX(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_median": "MV_MEDIAN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_median.markdown": "\n\n ### MV_MEDIAN\n 将多值字段转换为包含中位数值的单值字段。\n\n ```\n ROW a=[3, 5, 1]\n | EVAL median_a = MV_MEDIAN(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_min": "MV_MIN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_min.markdown": "\n\n ### MV_MIN\n 将多值表达式转换为包含最小值的单值列。\n\n ```\n ROW a=[2, 1]\n | EVAL min_a = MV_MIN(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_slice": "MV_SLICE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_slice.markdown": "\n\n ### MV_SLICE\n 使用起始和结束索引值返回多值字段的子集。\n\n ```\n row a = [1, 2, 2, 3]\n | eval a1 = mv_slice(a, 1), a2 = mv_slice(a, 2, 3)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_sort": "MV_SORT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_sort.markdown": "\n\n ### MV_SORT\n 按字典顺序对多值字段排序。\n\n ```\n ROW a = [4, 2, -3, 2]\n | EVAL sa = mv_sort(a), sd = mv_sort(a, \"DESC\")\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_sum": "MV_SUM", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_sum.markdown": "\n\n ### MV_SUM\n 将多值字段转换为包含所有值的总和的单值字段。\n\n ```\n ROW a=[3, 5, 6]\n | EVAL sum_a = MV_SUM(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_zip": "MV_ZIP", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mv_zip.markdown": "\n\n ### MV_ZIP\n 组合两个使用分隔符联接在一起的多值字段中的值。\n\n ```\n ROW a = [\"x\", \"y\", \"z\"], b = [\"1\", \"2\"]\n | EVAL c = mv_zip(a, b, \"-\")\n | KEEP a, b, c\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mvExpand": "MV_EXPAND", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.mvExpand.markdown": "### MV_EXPAND\n`MV_EXPAND` 处理命令将多值字段扩展成每个值一行,从而复制其他字段: \n```\nROW a=[1,2,3], b=\"b\", j=[\"a\",\"b\"]\n| MV_EXPAND a\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.now": "NOW", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.now.markdown": "\n\n ### NOW\n 返回当前日期和时间。\n\n ```\n ROW current_date = NOW()\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.percentileFunction": "PERCENTILE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.percentileFunction.markdown": "### PERCENTILE\n出现某个百分比的观察值时的值。例如,第 95 个百分位是大于 95% 的观察值的值,第 50 个百分位是 `MEDIAN`。\n\n```\nFROM employees\n| STATS p0 = PERCENTILE(salary, 0)\n , p50 = PERCENTILE(salary, 50)\n , p99 = PERCENTILE(salary, 99)\n```\n\n**注意:** `PERCENTILE` 通常为基于 TDigest 算法的近似计算。\n\n**警告:** `PERCENTILE` 也具有[非确定性](https://en.wikipedia.org/wiki/Nondeterministic_algorithm)。这意味着,即使使用相同的数据,但您得到的结果可能会略有不同。\n\n此表达式可使用内联函数。例如,要计算一个多值列的最大值的百分位数,应首先使用 `MV_MAX` 获取每行的最大值,然后将结果用于 `PERCENTILE` 函数:\n\n```\nFROM employees\n| STATS p80_max_salary_change = PERCENTILE(MV_MAX(salary_change), 80)\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.pi": "PI", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.pi.markdown": "\n\n ### PI\n 返回 Pi,即圆的周长与其直径的比率。\n\n ```\n ROW PI()\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.pow": "POW", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.pow.markdown": "\n\n ### POW\n 返回提升为 `exponent` 幂的 `base` 的值。\n\n ```\n ROW base = 2.0, exponent = 2\n | EVAL result = POW(base, exponent)\n ```\n 注意:此处仍可能使双精度结果溢出;在该情况下,将返回 null。\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.predicates": "Null 值", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.predicates.markdown": "### NULL 值\n对于 NULL 比较,请使用 `IS NULL` 和 `IS NOT NULL` 谓词:\n\n```\nFROM employees\n| WHERE birth_date IS NULL\n| KEEP first_name, last_name\n| SORT first_name\n| LIMIT 3\n```\n\n```\nFROM employees\n| WHERE is_rehired IS NOT NULL\n| STATS count(emp_no)\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.rename": "RENAME", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.rename.markdown": "### RENAME\n请使用 `RENAME` 通过以下语法对列重命名:\n\n```\nRENAME AS \n```\n\n例如:\n\n```\nFROM employees\n| KEEP first_name, last_name, still_hired\n| RENAME still_hired AS employed\n```\n\n如果使用新名称的列已存在,将用新列替换该列。\n\n可以使用单个 `RENAME` 命令对多个列重命名:\n\n```\nFROM employees\n| KEEP first_name, last_name\n| RENAME first_name AS fn, last_name AS ln\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.repeat": "REPEAT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.repeat.markdown": "\n\n ### REPEAT\n 返回通过串联 `string` 自身与指定次数 `number` 构造而成的字符串。\n\n ```\n ROW a = \"Hello!\"\n | EVAL triple_a = REPEAT(a, 3);\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.replace": "REPLACE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.replace.markdown": "\n\n ### REPLACE\n 此函数将字符串 `str` 中正则表达式 `regex` 的任何匹配项\n 替换为替代字符串 `newStr`。\n\n ```\n ROW str = \"Hello World\"\n | EVAL str = REPLACE(str, \"World\", \"Universe\")\n | KEEP str\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.right": "RIGHT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.right.markdown": "\n\n ### RIGHT\n 返回从“字符串”中提取“长度”字符的子字符串,从右侧开始。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL right = RIGHT(last_name, 3)\n | SORT last_name ASC\n | LIMIT 5\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.round": "ROUND", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.round.markdown": "\n\n ### ROUND\n 将数字舍入到指定小数位数。\n 默认值为 0,即返回最近的整数。如果\n 精确度为负数,则将数字舍入到\n 小数点左侧的位数。\n\n ```\n FROM employees\n | KEEP first_name, last_name, height\n | EVAL height_ft = ROUND(height * 3.281, 1)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.row": "ROW", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.row.markdown": "### ROW\n`ROW` 源命令会生成一个行,其中包含一个或多个含有您指定的值的列。这可以用于测试。\n \n```\nROW a = 1, b = \"two\", c = null\n```\n\n请使用方括号创建多值列:\n\n```\nROW a = [2, 1]\n```\n\nROW 支持使用函数:\n\n```\nROW a = ROUND(1.23, 0)\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.rtrim": "RTRIM", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.rtrim.markdown": "\n\n ### RTRIM\n 从字符串中移除尾随空格。\n\n ```\n ROW message = \" some text \", color = \" red \"\n | EVAL message = RTRIM(message)\n | EVAL color = RTRIM(color)\n | EVAL message = CONCAT(\"'\", message, \"'\")\n | EVAL color = CONCAT(\"'\", color, \"'\")\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.show": "SHOW", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.show.markdown": "### SHOW\n`SHOW ` 源命令返回有关部署及其功能的信息:\n\n* 使用 `SHOW INFO` 可返回部署的版本、构建日期和哈希。\n* 使用 `SHOW FUNCTIONS` 可返回所有受支持函数的列表和每个函数的概要。\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.signum": "SIGNUM", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.signum.markdown": "\n\n ### SIGNUM\n 返回给定数字的符号。\n 它对负数返回 `-1`,对 `0` 返回 `0`,对正数返回 `1`。\n\n ```\n ROW d = 100.0\n | EVAL s = SIGNUM(d)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sin": "SIN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sin.markdown": "\n\n ### SIN\n 返回角度的正弦三角函数。\n\n ```\n ROW a=1.8 \n | EVAL sin=SIN(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sinh": "SINH", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sinh.markdown": "\n\n ### SINH\n 返回角度的双曲正弦。\n\n ```\n ROW a=1.8 \n | EVAL sinh=SINH(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sort": "SORT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sort.markdown": "### SORT\n使用 `SORT` 命令可对一个或多个字段上的行排序:\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height\n```\n\n默认排序顺序为升序。请使用 `ASC` 或 `DESC` 设置显式排序顺序:\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height DESC\n```\n\n如果两个行具有相同的排序键,则保留原始顺序。您可以提供其他排序表达式充当连接断路器:\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height DESC, first_name ASC\n```\n\n#### `null` 值\n默认情况下,会将 `null` 值视为大于任何其他值。使用升序排序顺序时,会最后对 `null` 值排序,而使用降序排序顺序时,会首先对 `null` 值排序。您可以通过提供 `NULLS FIRST` 或 `NULLS LAST` 来更改该排序:\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT first_name ASC NULLS FIRST\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.split": "SPLIT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.split.markdown": "\n\n ### SPLIT\n 将单值字符串拆分成多个字符串。\n\n ```\n ROW words=\"foo;bar;baz;qux;quux;corge\"\n | EVAL word = SPLIT(words, \";\")\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sqrt": "SQRT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sqrt.markdown": "\n\n ### SQRT\n 返回数字的平方根。输入可以为任何数字值,返回值始终为双精度值。\n 负数和无穷大的平方根为 null。\n\n ```\n ROW d = 100.0\n | EVAL s = SQRT(d)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_contains": "ST_CONTAINS", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_contains.markdown": "\n\n ### ST_CONTAINS\n 返回第一个几何形状是否包含第二个几何形状。\n 这是 `ST_WITHIN` 函数的反向函数。\n\n ```\n FROM airport_city_boundaries\n | WHERE ST_CONTAINS(city_boundary, TO_GEOSHAPE(\"POLYGON((109.35 18.3, 109.45 18.3, 109.45 18.4, 109.35 18.4, 109.35 18.3))\"))\n | KEEP abbrev, airport, region, city, city_location\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_disjoint": "ST_DISJOINT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_disjoint.markdown": "\n\n ### ST_DISJOINT\n 返回两个几何图形或几何图形列是否不相交。\n 这是 `ST_INTERSECTS` 函数的反向函数。\n 从数学上讲:ST_Disjoint(A, B) ⇔ A ⋂ B = ∅\n\n ```\n FROM airport_city_boundaries\n | WHERE ST_DISJOINT(city_boundary, TO_GEOSHAPE(\"POLYGON((-10 -60, 120 -60, 120 60, -10 60, -10 -60))\"))\n | KEEP abbrev, airport, region, city, city_location\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_distance": "ST_DISTANCE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_distance.markdown": "\n\n ### ST_DISTANCE\n 计算两点之间的距离。\n 对于笛卡尔几何形状,这是以相同单位作为原始坐标时的毕达哥拉斯距离。\n 对于地理几何形状而言,这是沿着地球大圆的圆周距离(以米为单位)。\n\n ```\n FROM airports\n | WHERE abbrev == \"CPH\"\n | EVAL distance = ST_DISTANCE(location, city_location)\n | KEEP abbrev, name, location, city_location, distance\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_intersects": "ST_INTERSECTS", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_intersects.markdown": "\n\n ### ST_INTERSECTS\n 如果两个几何形状相交,则返回 true。\n 如果它们有任何共同点,包括其内点\n (沿线的点或多边形内的点),则表示它们相交。\n 这是 `ST_DISJOINT` 函数的反向函数。\n 从数学上讲:ST_Intersects(A, B) ⇔ A ⋂ B ≠ ∅\n\n ```\n FROM airports\n | WHERE ST_INTERSECTS(location, TO_GEOSHAPE(\"POLYGON((42 14, 43 14, 43 15, 42 15, 42 14))\"))\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_within": "ST_WITHIN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_within.markdown": "\n\n ### ST_WITHIN\n 返回第一个几何形状是否在第二个几何形状内。\n 这是 `ST_CONTAINS` 函数的反向函数。\n\n ```\n FROM airport_city_boundaries\n | WHERE ST_WITHIN(city_boundary, TO_GEOSHAPE(\"POLYGON((109.1 18.15, 109.6 18.15, 109.6 18.65, 109.1 18.65, 109.1 18.15))\"))\n | KEEP abbrev, airport, region, city, city_location\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_x": "ST_X", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_x.markdown": "\n\n ### ST_X\n 从提供的点中提取 `x` 坐标。\n 如果点的类型为 `geo_point`,则这等同于提取 `longitude` 值。\n\n ```\n ROW point = TO_GEOPOINT(\"POINT(42.97109629958868 14.7552534006536)\")\n | EVAL x = ST_X(point), y = ST_Y(point)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_y": "ST_Y", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.st_y.markdown": "\n\n ### ST_Y\n 从提供的点中提取 `y` 坐标。\n 如果点的类型为 `geo_point`,则这等同于提取 `latitude` 值。\n\n ```\n ROW point = TO_GEOPOINT(\"POINT(42.97109629958868 14.7552534006536)\")\n | EVAL x = ST_X(point), y = ST_Y(point)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.starts_with": "STARTS_WITH", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.starts_with.markdown": "\n\n ### STARTS_WITH\n 返回指示关键字字符串是否以另一个字符串开头的布尔值。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL ln_S = STARTS_WITH(last_name, \"B\")\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.statsby": "STATS ...BY", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.statsby.markdown": "### STATS ...BY\n使用 `STATS ...BY` 可根据公共值对行分组,并计算已分组行中的一个或多个聚合值。\n\n**示例**:\n\n```\nFROM employees\n| STATS count = COUNT(emp_no) BY languages\n| SORT languages\n```\n\n如果省略 `BY`,输出表实际将包含一行,其中为应用于整个数据集的聚合:\n\n```\nFROM employees\n| STATS avg_lang = AVG(languages)\n```\n\n可以计算多个值:\n\n```\nFROM employees\n| STATS avg_lang = AVG(languages), max_lang = MAX(languages)\n```\n\n也可以按多个值分组(仅长整型和关键字家族字段支持):\n\n```\nFROM employees\n| EVAL hired = DATE_FORMAT(hire_date, \"YYYY\")\n| STATS avg_salary = AVG(salary) BY hired, languages.long\n| EVAL avg_salary = ROUND(avg_salary)\n| SORT hired, languages.long\n```\n\n请参阅**聚合函数**获取可与 `STATS ...BY` 搭配使用的函数列表。\n\n聚合函数和分组表达式均接受其他函数。这在对多值列使用 `STATS...BY` 时有用。例如,要计算平均工资变动,可以首先使用 `MV_AVG` 对每名员工的多个值求平均值,然后将结果用于 `AVG` 函数:\n\n```\nFROM employees\n| STATS avg_salary_change = AVG(MV_AVG(salary_change))\n```\n\n按表达式分组的示例为根据员工姓氏的第一个字母对其进行分组:\n\n```\nFROM employees\n| STATS my_count = COUNT() BY LEFT(last_name, 1)\n| SORT `LEFT(last_name, 1)`\n```\n\n指定输出列名称为可选操作。如果未指定,新列名称等于该表达式。以下查询将返回名为 `AVG(salary)` 的列:\n\n```\nFROM employees\n| STATS AVG(salary)\n```\n\n由于此名称包含特殊字符,在后续命令中使用该名称时,需要用反撇号 (`) 引用它:\n\n```\nFROM employees\n| STATS AVG(salary)\n| EVAL avg_salary_rounded = ROUND(`AVG(salary)`)\n```\n\n**注意**:不包含任何组的 `STATS` 比添加组更快。\n\n**注意**:当前,根据单一表达式进行分组比根据许多表达式进行分组更为优化。\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.stCentroidFunction": "ST_CENTROID_AGG", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.stCentroidFunction.markdown": "### ST_CENTROID_AGG\n**警告:此功能处于技术预览状态,在未来版本中可能会更改或移除。Elastic 将努力修复任何问题,但处于技术预览状态的功能不受正式 GA 功能支持 SLA 的约束。**\n\n对包含空间点几何图形类型的字段计算空间重心。\n\n```\nFROM airports\n| STATS centroid=ST_CENTROID_AGG(location)\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.stringOperators": "LIKE 和 RLIKE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.stringOperators.markdown": "### LIKE 和 RLIKE\n使用通配符或正则表达式比较字符串时,请使用 `LIKE` 或 `RLIKE`:\n\n使用 `LIKE` 时,可使用通配符来匹配字符串。支持以下通配符字符:\n\n* `*` 匹配零个或更多字符。\n* `?` 匹配一个字符。\n\n```\nFROM employees\n| WHERE first_name LIKE \"?b*\"\n| KEEP first_name, last_name\n```\n\n使用 `RLIKE` 时,可使用正则表达式来匹配字符串:\n\n```\nFROM employees\n| WHERE first_name RLIKE \".leja.*\"\n| KEEP first_name, last_name\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.substring": "SUBSTRING", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.substring.markdown": "\n\n ### SUBSTRING\n 返回字符串的子字符串,用起始位置和可选长度指定\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL ln_sub = SUBSTRING(last_name, 1, 3)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sumFunction": "SUM", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.sumFunction.markdown": "### SUM\n返回数字字段的总和。\n\n```\nFROM employees\n| STATS SUM(languages)\n```\n\n此表达式可使用内联函数。例如,要计算每名员工的最大工资变动的总和,请对每行应用 `MV_MAX` 函数,然后对结果使用 `SUM`:\n\n```\nFROM employees\n| STATS total_salary_changes = SUM(MV_MAX(salary_change))\n```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.tan": "TAN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.tan.markdown": "\n\n ### TAN\n 返回角度的正切三角函数。\n\n ```\n ROW a=1.8 \n | EVAL tan=TAN(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.tanh": "TANH", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.tanh.markdown": "\n\n ### TANH\n 返回角度的双曲正切函数。\n\n ```\n ROW a=1.8 \n | EVAL tanh=TANH(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.tau": "TAU", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.tau.markdown": "\n\n ### TAU\n 返回圆的圆周长与其半径的比率。\n\n ```\n ROW TAU()\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_base64": "TO_BASE64", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_base64.markdown": "\n\n ### TO_BASE64\n 将字符串编码为 base64 字符串。\n\n ```\n row a = \"elastic\" \n | eval e = to_base64(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_boolean": "TO_BOOLEAN", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_boolean.markdown": "\n\n ### TO_BOOLEAN\n 将输入值转换为布尔值。\n 字符串值 *true* 将不区分大小写并被转换为布尔值 *true*。\n 对于任何其他值,包括空字符串,此函数将返回 *false*。\n 数字值 *0* 将转换为 *false*,任何其他值将转换为 *true*。\n\n ```\n ROW str = [\"true\", \"TRuE\", \"false\", \"\", \"yes\", \"1\"]\n | EVAL bool = TO_BOOLEAN(str)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_cartesianpoint": "TO_CARTESIANPOINT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_cartesianpoint.markdown": "\n\n ### TO_CARTESIANPOINT\n 将输入值转换为 `cartesian_point` 值。\n 字符串只有符合 WKT 点格式时,才能成功转换。\n\n ```\n ROW wkt = [\"POINT(4297.11 -1475.53)\", \"POINT(7580.93 2272.77)\"]\n | MV_EXPAND wkt\n | EVAL pt = TO_CARTESIANPOINT(wkt)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_cartesianshape": "TO_CARTESIANSHAPE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_cartesianshape.markdown": "\n\n ### TO_CARTESIANSHAPE\n 将输入值转换为 `cartesian_shape` 值。\n 字符串只有符合 WKT 格式时,才能成功转换。\n\n ```\n ROW wkt = [\"POINT(4297.11 -1475.53)\", \"POLYGON ((3339584.72 1118889.97, 4452779.63 4865942.27, 2226389.81 4865942.27, 1113194.90 2273030.92, 3339584.72 1118889.97))\"]\n | MV_EXPAND wkt\n | EVAL geom = TO_CARTESIANSHAPE(wkt)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_datetime": "TO_DATETIME", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_datetime.markdown": "\n\n ### TO_DATETIME\n 将输入值转换为日期值。\n 仅当字符串采用 `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'` 格式时,才可进行成功转换。\n 要转换其他格式的日期,请使用 `DATE_PARSE`。\n\n ```\n ROW string = [\"1953-09-02T00:00:00.000Z\", \"1964-06-02T00:00:00.000Z\", \"1964-06-02 00:00:00\"]\n | EVAL datetime = TO_DATETIME(string)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_degrees": "TO_DEGREES", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_degrees.markdown": "\n\n ### TO_DEGREES\n 将弧度转换为度数。\n\n ```\n ROW rad = [1.57, 3.14, 4.71]\n | EVAL deg = TO_DEGREES(rad)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_double": "TO_DOUBLE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_double.markdown": "\n\n ### TO_DOUBLE\n 将输入值转换为双精度值。如果输入参数为日期类型,\n 会将其值解析为自 Unix epoch 以来的毫秒数,\n 并转换为双精度值。布尔值 *true* 将转换为双精度值 *1.0*,*false* 转换为 *0.0*。\n\n ```\n ROW str1 = \"5.20128E11\", str2 = \"foo\"\n | EVAL dbl = TO_DOUBLE(\"520128000000\"), dbl1 = TO_DOUBLE(str1), dbl2 = TO_DOUBLE(str2)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_geopoint": "TO_GEOPOINT", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_geopoint.markdown": "\n\n ### TO_GEOPOINT\n 将输入值转换为 `geo_point` 值。\n 字符串只有符合 WKT 点格式时,才能成功转换。\n\n ```\n ROW wkt = \"POINT(42.97109630194 14.7552534413725)\"\n | EVAL pt = TO_GEOPOINT(wkt)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_geoshape": "TO_GEOSHAPE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_geoshape.markdown": "\n\n ### TO_GEOSHAPE\n 将输入值转换为 `geo_shape` 值。\n 字符串只有符合 WKT 格式时,才能成功转换。\n\n ```\n ROW wkt = \"POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))\"\n | EVAL geom = TO_GEOSHAPE(wkt)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_integer": "TO_INTEGER", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_integer.markdown": "\n\n ### TO_INTEGER\n 将输入值转换为整数值。\n 如果输入参数为日期类型,会将其值解析为自 Unix epoch 以来\n 的毫秒数,并转换为整数。\n 布尔值 *true* 将转换为整数 *1*,*false* 转换为 *0*。\n\n ```\n ROW long = [5013792, 2147483647, 501379200000]\n | EVAL int = TO_INTEGER(long)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_ip": "TO_IP", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_ip.markdown": "\n\n ### TO_IP\n 将输入字符串转换为 IP 值。\n\n ```\n ROW str1 = \"1.1.1.1\", str2 = \"foo\"\n | EVAL ip1 = TO_IP(str1), ip2 = TO_IP(str2)\n | WHERE CIDR_MATCH(ip1, \"1.0.0.0/8\")\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_long": "TO_LONG", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_long.markdown": "\n\n ### TO_LONG\n 将输入值转换为长整型值。如果输入参数为日期类型,\n 会将其值解析为自 Unix epoch 以来的毫秒数,并转换为长整型值。\n 布尔值 *true* 将转换为长整型值 *1*,*false* 转换为 *0*。\n\n ```\n ROW str1 = \"2147483648\", str2 = \"2147483648.2\", str3 = \"foo\"\n | EVAL long1 = TO_LONG(str1), long2 = TO_LONG(str2), long3 = TO_LONG(str3)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_lower": "TO_LOWER", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_lower.markdown": "\n\n ### TO_LOWER\n 返回一个新字符串,表示已将输入字符串转为小写。\n\n ```\n ROW message = \"Some Text\"\n | EVAL message_lower = TO_LOWER(message)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_radians": "TO_RADIANS", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_radians.markdown": "\n\n ### TO_RADIANS\n 将度数转换为弧度。\n\n ```\n ROW deg = [90.0, 180.0, 270.0]\n | EVAL rad = TO_RADIANS(deg)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_string": "TO_STRING", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_string.markdown": "\n\n ### TO_STRING\n 将输入值转换为字符串。\n\n ```\n ROW a=10\n | EVAL j = TO_STRING(a)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_unsigned_long": "TO_UNSIGNED_LONG", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_unsigned_long.markdown": "\n\n ### TO_UNSIGNED_LONG\n 将输入值转换为无符号长整型值。如果输入参数为日期类型,\n 会将其值解析为自 Unix epoch 以来的毫秒数,并转换为无符号长整型值。\n 布尔值 *true* 将转换为无符号长整型值 *1*,*false* 转换为 *0*。\n\n ```\n ROW str1 = \"2147483648\", str2 = \"2147483648.2\", str3 = \"foo\"\n | EVAL long1 = TO_UNSIGNED_LONG(str1), long2 = TO_ULONG(str2), long3 = TO_UL(str3)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_upper": "TO_UPPER", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_upper.markdown": "\n\n ### TO_UPPER\n 返回一个新字符串,表示已将输入字符串转为大写。\n\n ```\n ROW message = \"Some Text\"\n | EVAL message_upper = TO_UPPER(message)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_version": "TO_VERSION", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.to_version.markdown": "\n\n ### TO_VERSION\n 将输入字符串转换为版本值。\n\n ```\n ROW v = TO_VERSION(\"1.2.3\")\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.trim": "TRIM", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.trim.markdown": "\n\n ### TRIM\n 从字符串中移除前导和尾随空格。\n\n ```\n ROW message = \" some text \", color = \" red \"\n | EVAL message = TRIM(message)\n | EVAL color = TRIM(color)\n ```\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.valuesFunction": "VALUES", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.valuesFunction.markdown": "### VALUES\n\n**警告:请勿在生产环境中使用 `VALUES`。此功能处于技术预览状态,在未来版本中可能会更改或移除。Elastic 将努力修复任何问题,但处于技术预览状态的功能不受正式 GA 功能支持 SLA 的约束。**\n\n以多值字段的形式返回组中的所有值。无法保证返回值的顺序。如果需要按顺序返回值,请使用 `MV_SORT`。\n\n接受任何类型的表达式,但 `geo_point`、`cartesian_point`、`geo_shape` 或 `cartesian_shape` 除外。\n\n\n例如:\n\n```\n FROM employees\n| EVAL first_letter = SUBSTRING(first_name, 0, 1)\n| STATS first_name=MV_SORT(VALUES(first_name)) BY first_letter\n| SORT first_letter\n```\n\n> _**警告:**这可能会占用大量内存,但除内存以外,ES|QL 尚不会增长聚合。因此,此聚合会正常工作,直到将其用于收集的值超出内存装载量。一旦收集的值过多,查询将会失败,并出现[断路器错误](https://www.elastic.co/guide/en/elasticsearch/reference/current/circuit-breaker-errors.html)。_\n\n ", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.where": "WHERE", - "textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.where.markdown": "### WHERE\n使用 `WHERE` 可生成一个表,其中包含输入表中所提供的条件评估为 `true` 的所有行:\n \n```\nFROM employees\n| KEEP first_name, last_name, still_hired\n| WHERE still_hired == true\n```\n\n#### 运算符\n\n请参阅**运算符**了解所支持的运算符的概览。\n\n#### 函数\n`WHERE` 支持各种用于计算值的函数。请参阅**函数**了解更多信息。\n ", + "languageDocumentationPopover.documentationESQL.abs": "ABS", + "languageDocumentationPopover.documentationESQL.abs.markdown": "\n\n ### ABS\n 返回绝对值。\n\n ```\n ROW number = -1.0 \n | EVAL abs_number = ABS(number)\n ```\n ", + "languageDocumentationPopover.documentationESQL.acos": "ACOS", + "languageDocumentationPopover.documentationESQL.acos.markdown": "\n\n ### ACOS\n 返回 `n` 的反余弦作为角度,以弧度表示。\n\n ```\n ROW a=.9\n | EVAL acos=ACOS(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.asin": "ASIN", + "languageDocumentationPopover.documentationESQL.asin.markdown": "\n\n ### ASIN\n 返回输入数字表达式的反正弦\n 作为角度,以弧度表示。\n\n ```\n ROW a=.9\n | EVAL asin=ASIN(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.atan": "ATAN", + "languageDocumentationPopover.documentationESQL.atan.markdown": "\n\n ### ATAN\n 返回输入数字表达式的反正切\n 作为角度,以弧度表示。\n\n ```\n ROW a=12.9\n | EVAL atan=ATAN(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.atan2": "ATAN2", + "languageDocumentationPopover.documentationESQL.atan2.markdown": "\n\n ### ATAN2\n 笛卡儿平面中正 x 轴\n 与从原点到点 (x , y) 构成的射线之间的角度,以弧度表示。\n\n ```\n ROW y=12.9, x=.6\n | EVAL atan2=ATAN2(y, x)\n ```\n ", + "languageDocumentationPopover.documentationESQL.autoBucketFunction": "BUCKET", + "languageDocumentationPopover.documentationESQL.autoBucketFunction.markdown": "### BUCKET\n用日期时间或数字输入创建值(存储桶)的分组。存储桶的大小可以直接提供,或基于建议的计数和值范围进行选择。\n\n`BUCKET` 以两种模式运行:\n\n1.在此模式下基于存储桶计数建议(四个参数)和范围计算存储桶的大小。\n2.在此模式下直接提供存储桶大小(两个参数)。\n\n使用存储桶的目标数量、起始范围和结束范围,`BUCKET` 将选取适当的存储桶大小以生成目标数量或更小数量的存储桶。\n\n例如,一年请求多达 20 个存储桶会按每月时间间隔组织数据:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT hire_date\n```\n\n**注意**:目标并不是提供存储桶的确切目标数量,而是选择一个范围,最多提供存储桶的目标数量。\n\n可以组合 `BUCKET` 与聚合以创建直方图:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_month = COUNT(*) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT month\n```\n\n**注意**:`BUCKET` 不会创建未匹配任何文档的存储桶。因此,上一示例缺少 `1985-03-01` 和其他日期。\n\n如果需要更多存储桶,可能导致更小的范围。例如,如果一年内最多请求 100 个存储桶,会导致周期为周的存储桶:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 100, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT week\n```\n\n**注意**:`AUTO_BUCKET` 不筛选任何行。它只会使用提供的范围来选取适当的存储桶大小。对于值超出范围的行,它会返回与超出范围的存储桶对应的存储桶值。组合 `BUCKET` 与 `WHERE` 可筛选行。\n\n如果提前已知所需存储桶大小,则只需提供它作为第二个参数,而忽略范围:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 1 week)\n| SORT week\n```\n\n**注意**:提供存储桶大小作为第二个参数时,它必须为持续时间或日期期间。\n\n`BUCKET` 还可对数字字段执行操作。例如,要创建工资直方图:\n\n```\nFROM employees\n| STATS COUNT(*) by bs = BUCKET(salary, 20, 25324, 74999)\n| SORT bs\n```\n\n与前面的有意筛选日期范围示例不同,您极少想要筛选数值范围。您必须分别查找最小值和最大值。ES|QL 尚未提供简便方法来自动执行此操作。\n\n如果提前已知所需存储桶大小,则可以忽略该范围。只需提供它作为第二个参数即可:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS c = COUNT(1) BY b = BUCKET(salary, 5000.)\n| SORT b\n```\n\n**注意**:提供存储桶大小作为第二个参数时,它必须为 **浮点类型**。\n\n这里提供了一个示例,用于为过去 24 小时创建小时存储桶,并计算每小时的事件数:\n\n```\nFROM sample_data\n| WHERE @timestamp >= NOW() - 1 day and @timestamp < NOW()\n| STATS COUNT(*) BY bucket = BUCKET(@timestamp, 25, NOW() - 1 day, NOW())\n```\n\n这里提供了一个示例,用于为 1985 年创建月度存储桶,并按聘用月份计算平均工资:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS AVG(salary) BY bucket = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT bucket\n```\n\n`BUCKET` 可用在 `STATS …​ BY …`​ 命令的聚合和分组部分, 前提是在聚合部分中,该函数 **由在分组部分中定义的别名引用**,或使用完全相同的表达式调用。\n\n例如:\n\n```\nFROM employees\n| STATS s1 = b1 + 1, s2 = BUCKET(salary / 1000 + 999, 50.) + 2 BY b1 = BUCKET(salary / 100 + 99, 50.), b2 = BUCKET(salary / 1000 + 999, 50.)\n| SORT b1, b2\n| KEEP s1, b1, s2, b2\n```\n ", + "languageDocumentationPopover.documentationESQL.avgFunction": "AVG", + "languageDocumentationPopover.documentationESQL.avgFunction.markdown": "### AVG\n返回数字字段的平均值。\n\n```\nFROM employees\n| STATS AVG(height)\n```\n\n此表达式可使用内联函数。例如,要计算一个多值列的平均值,应首先使用 `MV_AVG` 对每行的多个值求平均值,然后将结果用于 `AVG` 函数:\n\n```\nFROM employees\n| STATS avg_salary_change = AVG(MV_AVG(salary_change))\n```\n ", + "languageDocumentationPopover.documentationESQL.binaryOperators": "二进制运算符", + "languageDocumentationPopover.documentationESQL.binaryOperators.markdown": "### 二进制运算符\n支持这些二进制比较运算符:\n\n* 等于:`==`\n* 不等于:`!=`\n* 小于:`<`\n* 小于或等于:`<=`\n* 大于:`>`\n* 大于或等于:`>=`\n* 加:`+`\n* 减:`-`\n* 乘:`*`\n* 除:`/`\n* 取模:`%`\n ", + "languageDocumentationPopover.documentationESQL.booleanOperators": "布尔运算符", + "languageDocumentationPopover.documentationESQL.booleanOperators.markdown": "### 布尔运算符\n支持以下布尔运算符:\n\n* `AND`\n* `OR`\n* `NOT`\n ", + "languageDocumentationPopover.documentationESQL.bucket": "BUCKET", + "languageDocumentationPopover.documentationESQL.bucket.markdown": "\n\n ### BUCKET\n 用日期时间或数字输入创建值(存储桶)的分组。\n 存储桶的大小可以直接提供,或基于建议的计数和值范围进行选择。\n\n ```\n FROM employees\n | WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n | STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n | SORT hire_date\n ```\n ", + "languageDocumentationPopover.documentationESQL.case": "CASE", + "languageDocumentationPopover.documentationESQL.case.markdown": "\n\n ### CASE\n 接受成对的条件和值。此函数返回属于第一个\n 评估为 `true` 的条件的值。\n\n 如果参数数量为奇数,则最后一个参数为\n 在无条件匹配时返回的默认值。如果参数数量为偶数,且\n 无任何条件匹配,则此函数返回 `null`。\n\n ```\n FROM employees\n | EVAL type = CASE(\n languages <= 1, \"monolingual\",\n languages <= 2, \"bilingual\",\n \"polyglot\")\n | KEEP emp_no, languages, type\n ```\n ", + "languageDocumentationPopover.documentationESQL.castOperator": "Cast (::)", + "languageDocumentationPopover.documentationESQL.castOperator.markdown": "### CAST (`::`)\n`::` 运算符为 `TO_` 类型转换函数提供了实用的替代语法。\n\n例如:\n```\nROW ver = CONCAT((\"0\"::INT + 1)::STRING, \".2.3\")::VERSION\n```\n ", + "languageDocumentationPopover.documentationESQL.cbrt": "CBRT", + "languageDocumentationPopover.documentationESQL.cbrt.markdown": "\n\n ### CBRT\n 返回数字的立方根。输入可以为任何数字值,返回值始终为双精度值。\n 无穷大的立方根为 null。\n\n ```\n ROW d = 1000.0\n | EVAL c = cbrt(d)\n ```\n ", + "languageDocumentationPopover.documentationESQL.ceil": "CEIL", + "languageDocumentationPopover.documentationESQL.ceil.markdown": "\n\n ### CEIL\n 将数字四舍五入为最近的整数。\n\n ```\n ROW a=1.8\n | EVAL a=CEIL(a)\n ```\n 注意:对于 `long`(包括无符号值)和 `integer`,这相当于“无操作”。对于 `double`,这会提取最接近整数的 `double` 值,类似于 Math.ceil。\n ", + "languageDocumentationPopover.documentationESQL.cidr_match": "CIDR_MATCH", + "languageDocumentationPopover.documentationESQL.cidr_match.markdown": "\n\n ### CIDR_MATCH\n 如果提供的 IP 包含在所提供的其中一个 CIDR 块中,则返回 true。\n\n ```\n FROM hosts \n | WHERE CIDR_MATCH(ip1, \"127.0.0.2/32\", \"127.0.0.3/32\") \n | KEEP card, host, ip0, ip1\n ```\n ", + "languageDocumentationPopover.documentationESQL.coalesce": "COALESCE", + "languageDocumentationPopover.documentationESQL.coalesce.markdown": "\n\n ### COALESCE\n 返回它的第一个不为 null 的参数。如果所有参数均为 null,则返回 `null`。\n\n ```\n ROW a=null, b=\"b\"\n | EVAL COALESCE(a, b)\n ```\n ", + "languageDocumentationPopover.documentationESQL.concat": "CONCAT", + "languageDocumentationPopover.documentationESQL.concat.markdown": "\n\n ### CONCAT\n 串联两个或多个字符串。\n\n ```\n FROM employees\n | KEEP first_name, last_name\n | EVAL fullname = CONCAT(first_name, \" \", last_name)\n ```\n ", + "languageDocumentationPopover.documentationESQL.cos": "COS", + "languageDocumentationPopover.documentationESQL.cos.markdown": "\n\n ### COS\n 返回角度的余弦。\n\n ```\n ROW a=1.8 \n | EVAL cos=COS(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.cosh": "COSH", + "languageDocumentationPopover.documentationESQL.cosh.markdown": "\n\n ### COSH\n 返回角度的双曲余弦。\n\n ```\n ROW a=1.8 \n | EVAL cosh=COSH(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.countDistinctFunction": "COUNT_DISTINCT", + "languageDocumentationPopover.documentationESQL.countDistinctFunction.markdown": "### COUNT_DISTINCT\n对不同值的近似数进行计数。\n\n```\nFROM hosts\n| STATS COUNT_DISTINCT(ip0), COUNT_DISTINCT(ip1)\n```\n\n`COUNT_DISTINCT` 函数为基于 HyperLogLog++ 算法的近似计算。请参阅此[文档](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-cardinality-aggregation.html#_counts_are_approximate)了解更多信息。精确度可使用可选的第二个参数进行配置。支持的最大值为 40000。高于此数字的阈值与阈值 40000 的效果相同。默认值为 3000。\n\n```\nFROM hosts\n| STATS COUNT_DISTINCT(ip0, 80000), COUNT_DISTINCT(ip1, 5)\n```\n\n此表达式可使用内联函数。此示例会使用 `SPLIT` 函数将字符串拆分成多个值,并对唯一值进行计数:\n\n```\nROW words=\"foo;bar;baz;qux;quux;foo\"\n| STATS distinct_word_count = COUNT_DISTINCT(SPLIT(words, \";\"))\n```\n ", + "languageDocumentationPopover.documentationESQL.countFunction": "COUNT", + "languageDocumentationPopover.documentationESQL.countFunction.markdown": "### COUNT\n返回输入值的总数(计数)。\n\n```\nFROM employees\n| STATS COUNT(height)\n```\n\n可接受任何字段类型作为输入。\n\n要计算行数,请使用 `COUNT()` 或 `COUNT(*)`:\n\n```\nFROM employees\n| STATS count = COUNT(*) BY languages\n| SORT languages DESC\n```\n\n此表达式可使用内联函数。此示例会使用 `SPLIT` 函数将字符串拆分成多个值,并对值进行计数:\n\n```\nROW words=\"foo;bar;baz;qux;quux;foo\"\n| STATS word_count = COUNT(SPLIT(words, \";\"))\n```\n ", + "languageDocumentationPopover.documentationESQL.date_diff": "DATE_DIFF", + "languageDocumentationPopover.documentationESQL.date_diff.markdown": "\n\n ### DATE_DIFF\n 从 `endTimestamp` 中减去 `startTimestamp`,并以倍数 `unit` 返回差异。\n 如果 `startTimestamp` 晚于 `endTimestamp`,则返回负值。\n\n ```\n ROW date1 = TO_DATETIME(\"2023-12-02T11:00:00.000Z\"), date2 = TO_DATETIME(\"2023-12-02T11:00:00.001Z\")\n | EVAL dd_ms = DATE_DIFF(\"microseconds\", date1, date2)\n ```\n ", + "languageDocumentationPopover.documentationESQL.date_extract": "DATE_EXTRACT", + "languageDocumentationPopover.documentationESQL.date_extract.markdown": "\n\n ### DATE_EXTRACT\n 提取日期的某些部分,如年、月、日、小时。\n\n ```\n ROW date = DATE_PARSE(\"yyyy-MM-dd\", \"2022-05-06\")\n | EVAL year = DATE_EXTRACT(\"year\", date)\n ```\n ", + "languageDocumentationPopover.documentationESQL.date_format": "DATE_FORMAT", + "languageDocumentationPopover.documentationESQL.date_format.markdown": "\n\n ### DATE_FORMAT\n 以提供的格式返回日期的字符串表示形式。\n\n ```\n FROM employees\n | KEEP first_name, last_name, hire_date\n | EVAL hired = DATE_FORMAT(\"YYYY-MM-dd\", hire_date)\n ```\n ", + "languageDocumentationPopover.documentationESQL.date_parse": "DATE_PARSE", + "languageDocumentationPopover.documentationESQL.date_parse.markdown": "\n\n ### DATE_PARSE\n 通过使用在第一个参数中指定的格式来解析第二个参数,从而返回日期。\n\n ```\n ROW date_string = \"2022-05-06\"\n | EVAL date = DATE_PARSE(\"yyyy-MM-dd\", date_string)\n ```\n ", + "languageDocumentationPopover.documentationESQL.date_trunc": "DATE_TRUNC", + "languageDocumentationPopover.documentationESQL.date_trunc.markdown": "\n\n ### DATE_TRUNC\n 将日期向下舍入到最近的时间间隔。\n\n ```\n FROM employees\n | KEEP first_name, last_name, hire_date\n | EVAL year_hired = DATE_TRUNC(1 year, hire_date)\n ```\n ", + "languageDocumentationPopover.documentationESQL.dissect": "DISSECT", + "languageDocumentationPopover.documentationESQL.dissect.markdown": "### DISSECT\n使用 `DISSECT`,您可以从字符串中提取结构化数据。`DISSECT` 将根据基于分隔符的模式来匹配字符串,并提取指定键作为列。\n\n请参阅[分解处理器文档](https://www.elastic.co/guide/en/elasticsearch/reference/current/dissect-processor.html)了解分解模式的语法。\n\n```\nROW a = \"1953-01-23T12:15:00Z - some text - 127.0.0.1\"\n| DISSECT a \"%'{Y}-%{M}-%{D}T%{h}:%{m}:%{s}Z - %{msg} - %{ip}'\"\n``` ", + "languageDocumentationPopover.documentationESQL.drop": "DROP", + "languageDocumentationPopover.documentationESQL.drop.markdown": "### DROP\n使用 `DROP` 可从表中移除列:\n \n```\nFROM employees\n| DROP height\n```\n\n您不必按名称指定每个列,而可以使用通配符丢弃名称匹配某种模式的所有列:\n\n```\nFROM employees\n| DROP height*\n```\n ", + "languageDocumentationPopover.documentationESQL.e": "E", + "languageDocumentationPopover.documentationESQL.e.markdown": "\n\n ### E\n 返回 Euler 函数的编号。\n\n ```\n ROW E()\n ```\n ", + "languageDocumentationPopover.documentationESQL.ends_with": "ENDS_WITH", + "languageDocumentationPopover.documentationESQL.ends_with.markdown": "\n\n ### ENDS_WITH\n 返回布尔值,指示关键字字符串是否以另一个字符串结尾。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL ln_E = ENDS_WITH(last_name, \"d\")\n ```\n ", + "languageDocumentationPopover.documentationESQL.enrich": "ENRICH", + "languageDocumentationPopover.documentationESQL.enrich.markdown": "### ENRICH\n您可以使用 `ENRICH` 将来自现有索引的数据添加到传入记录中。它类似于[采集扩充](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html),但作用于查询时间。\n\n```\nROW language_code = \"1\"\n| ENRICH languages_policy\n```\n\n执行 `ENRICH` 需要[扩充策略](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html#enrich-policy)。扩充策略定义一个匹配字段(键字段)和一组扩充字段。\n\n`ENRICH` 将根据匹配字段值在[扩充索引](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html#enrich-index)中查找记录。输入数据集中的匹配键可以使用 `ON ` 来定义;如果未指定,将对字段名称与在扩充策略中定义的匹配字段相同的字段执行匹配。\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a\n```\n\n您可以使用 `WITH , ...` 语法指定必须将哪些属性(在那些在策略中定义为扩充字段的字段之间)添加到结果中。\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a WITH language_name\n```\n\n还可以使用 `WITH new_name=` 重命名属性\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a WITH name = language_name\n```\n\n默认情况下(如果未定义任何 `WITH`),`ENRICH` 会将在扩充策略中定义的所有扩充字段添加到结果中。\n\n如果出现名称冲突,新创建的字段将覆盖现有字段。\n ", + "languageDocumentationPopover.documentationESQL.eval": "EVAL", + "languageDocumentationPopover.documentationESQL.eval.markdown": "### EVAL\n`EVAL` 允许您添加新列:\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| EVAL height_feet = height * 3.281, height_cm = height * 100\n```\n\n如果指定列已存在,将丢弃现有列,并将新列追加到表后面:\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| EVAL height = height * 3.281\n```\n\n#### 函数\n`EVAL` 支持各种用于计算值的函数。请参阅“函数”了解更多信息。\n ", + "languageDocumentationPopover.documentationESQL.floor": "FLOOR", + "languageDocumentationPopover.documentationESQL.floor.markdown": "\n\n ### FLOOR\n 将数字向下舍入到最近的整数。\n\n ```\n ROW a=1.8\n | EVAL a=FLOOR(a)\n ```\n 注意:对于 `long`(包括无符号值)和 `integer`,这相当于“无操作”。\n 对于 `double`,这会提取最接近整数的 `double` 值,\n 类似于 Math.floor。\n ", + "languageDocumentationPopover.documentationESQL.from": "FROM", + "languageDocumentationPopover.documentationESQL.from_base64": "FROM_BASE64", + "languageDocumentationPopover.documentationESQL.from_base64.markdown": "\n\n ### FROM_BASE64\n 解码 base64 字符串。\n\n ```\n row a = \"ZWxhc3RpYw==\" \n | eval d = from_base64(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.from.markdown": "### FROM\n`FROM` 源命令返回一个表,其中最多包含 10,000 个来自数据流、索引或别名的文档。生成的表中的每一行代表一个文档。每一列对应一个字段,并可以通过该字段的名称进行访问。\n\n```\nFROM employees\n```\n\n您可以使用[日期数学表达式](https://www.elastic.co/guide/en/elasticsearch/reference/current/api-conventions.html#api-date-math-index-names)来引用索引、别名和数据流。这可能对时间序列数据非常有用。\n\n使用逗号分隔列表或通配符可查询多个数据流、索引或别名:\n\n```\nFROM employees-00001,employees-*\n```\n\n#### 元数据\n\nES|QL 可访问以下元数据字段:\n\n* `_index`:文档所属的索引。字段类型为 `keyword`.\n* `_id`:源文档的 ID。字段类型为 `keyword`.\n* `_version`:源文档的版本。字段类型为 `long`。\n\n使用 `METADATA` 指令可启用元数据字段:\n\n```\nFROM index [METADATA _index, _id]\n```\n\n元数据字段仅在数据源为索引时可用。因此,`FROM` 是唯一支持 `METADATA` 指令的源命令。\n\n启用后,这些字段将可用于后续处理命令,就像其他索引字段一样:\n\n```\nFROM ul_logs, apps [METADATA _index, _version]\n| WHERE id IN (13, 14) AND _version == 1\n| EVAL key = CONCAT(_index, \"_\", TO_STR(id))\n| SORT id, _index\n| KEEP id, _index, _version, key\n```\n\n此外,与索引字段类似,一旦执行了聚合,后续命令将无法再访问元数据字段,除非它用作分组字段:\n\n```\nFROM employees [METADATA _index, _id]\n| STATS max = MAX(emp_no) BY _index\n```\n ", + "languageDocumentationPopover.documentationESQL.greatest": "GREATEST", + "languageDocumentationPopover.documentationESQL.greatest.markdown": "\n\n ### GREATEST\n 返回多个列中的最大值。除了可一次对多个列运行以外,\n 此函数与 `MV_MAX` 类似。\n\n ```\n ROW a = 10, b = 20\n | EVAL g = GREATEST(a, b)\n ```\n 注意:对 `keyword` 或 `text` 字段运行时,此函数将按字母顺序返回最后一个字符串。对 `boolean` 列运行时,如果任何值为 `true`,此函数将返回 `true`。\n ", + "languageDocumentationPopover.documentationESQL.grok": "GROK", + "languageDocumentationPopover.documentationESQL.grok.markdown": "### GROK\n使用 `GROK`,您可以从字符串中提取结构化数据。`GROK` 将基于正则表达式根据模式来匹配字符串,并提取指定模式作为列。\n\n请参阅 [grok 处理器文档](https://www.elastic.co/guide/en/elasticsearch/reference/current/grok-processor.html)了解 grok 模式的语法。\n\n```\nROW a = \"12 15.5 15.6 true\"\n| GROK a \"%'{NUMBER:b:int}' %'{NUMBER:c:float}' %'{NUMBER:d:double}' %'{WORD:e:boolean}'\"\n```\n ", + "languageDocumentationPopover.documentationESQL.inOperator": "IN", + "languageDocumentationPopover.documentationESQL.inOperator.markdown": "### IN\n`IN` 运算符允许测试字段或表达式是否等于文本、字段或表达式列表中的元素:\n\n```\nROW a = 1, b = 4, c = 3\n| WHERE c-a IN (3, b / 2, a)\n```\n ", + "languageDocumentationPopover.documentationESQL.ip_prefix": "IP_PREFIX", + "languageDocumentationPopover.documentationESQL.ip_prefix.markdown": "\n\n ### IP_PREFIX\n 截短 IP 至给定的前缀长度。\n\n ```\n row ip4 = to_ip(\"1.2.3.4\"), ip6 = to_ip(\"fe80::cae2:65ff:fece:feb9\")\n | eval ip4_prefix = ip_prefix(ip4, 24, 0), ip6_prefix = ip_prefix(ip6, 0, 112);\n ```\n ", + "languageDocumentationPopover.documentationESQL.keep": "KEEP", + "languageDocumentationPopover.documentationESQL.keep.markdown": "### KEEP\n使用 `KEEP` 命令,您可以指定将返回哪些列以及返回这些列的顺序。\n\n要限制返回的列数,请使用列名的逗号分隔列表。将按指定顺序返回这些列:\n \n```\nFROM employees\n| KEEP first_name, last_name, height\n```\n\n您不必按名称指定每个列,而可以使用通配符返回名称匹配某种模式的所有列:\n\n```\nFROM employees\n| KEEP h*\n```\n\n星号通配符 (`*`) 自身将转换为不与其他参数匹配的所有列。此查询将首先返回所有名称以 h 开头的所有列,随后返回所有其他列:\n\n```\nFROM employees\n| KEEP h*, *\n```\n ", + "languageDocumentationPopover.documentationESQL.least": "LEAST", + "languageDocumentationPopover.documentationESQL.least.markdown": "\n\n ### LEAST\n 返回多个列中的最小值。除了可一次对多个列运行以外,此函数与 `MV_MIN` 类似。\n\n ```\n ROW a = 10, b = 20\n | EVAL l = LEAST(a, b)\n ```\n ", + "languageDocumentationPopover.documentationESQL.left": "LEFT", + "languageDocumentationPopover.documentationESQL.left.markdown": "\n\n ### LEFT\n 返回从“字符串”中提取“长度”字符的子字符串,从左侧开始。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL left = LEFT(last_name, 3)\n | SORT last_name ASC\n | LIMIT 5\n ```\n ", + "languageDocumentationPopover.documentationESQL.length": "LENGTH", + "languageDocumentationPopover.documentationESQL.length.markdown": "\n\n ### LENGTH\n 返回字符串的字符长度。\n\n ```\n FROM employees\n | KEEP first_name, last_name\n | EVAL fn_length = LENGTH(first_name)\n ```\n ", + "languageDocumentationPopover.documentationESQL.limit": "LIMIT", + "languageDocumentationPopover.documentationESQL.limit.markdown": "### LIMIT\n`LIMIT` 处理命令允许您限制行数:\n \n```\nFROM employees\n| LIMIT 5\n```\n ", + "languageDocumentationPopover.documentationESQL.locate": "LOCATE", + "languageDocumentationPopover.documentationESQL.locate.markdown": "\n\n ### LOCATE\n 返回一个整数,指示关键字子字符串在另一字符串中的位置\n\n ```\n row a = \"hello\"\n | eval a_ll = locate(a, \"ll\")\n ```\n ", + "languageDocumentationPopover.documentationESQL.log": "LOG", + "languageDocumentationPopover.documentationESQL.log.markdown": "\n\n ### LOG\n 以某底数返回值的对数。输入可以为任何数字值,返回值始终为双精度值。\n\n 求零、负数的对数,以及底数为一时将返回 `null`,并显示警告。\n\n ```\n ROW base = 2.0, value = 8.0\n | EVAL s = LOG(base, value)\n ```\n ", + "languageDocumentationPopover.documentationESQL.log10": "LOG10", + "languageDocumentationPopover.documentationESQL.log10.markdown": "\n\n ### LOG10\n 以底数 10 返回值的对数。输入可以为任何数字值,返回值始终为双精度值。\n\n 求 0 和负数的对数时将返回 `null`,并显示警告。\n\n ```\n ROW d = 1000.0 \n | EVAL s = LOG10(d)\n ```\n ", + "languageDocumentationPopover.documentationESQL.ltrim": "LTRIM", + "languageDocumentationPopover.documentationESQL.ltrim.markdown": "\n\n ### LTRIM\n 从字符串中移除前导空格。\n\n ```\n ROW message = \" some text \", color = \" red \"\n | EVAL message = LTRIM(message)\n | EVAL color = LTRIM(color)\n | EVAL message = CONCAT(\"'\", message, \"'\")\n | EVAL color = CONCAT(\"'\", color, \"'\")\n ```\n ", + "languageDocumentationPopover.documentationESQL.markdown": "## ES|QL\n\nES|QL(Elasticsearch 查询语言)查询包含一系列命令,它们用管道字符分隔:`|`。每个查询以**源命令**开头,它会生成一个表,其中通常包含来自 Elasticsearch 的数据。\n\n源命令可后接一个或多个**处理命令**。处理命令可通过添加、移除以及更改行和列来更改前一个命令的输出表。\n\n```\nsource-command\n| processing-command1\n| processing-command2\n```\n\n查询的结果为由最后的处理命令生成的表。 \n ", + "languageDocumentationPopover.documentationESQL.maxFunction": "MAX", + "languageDocumentationPopover.documentationESQL.maxFunction.markdown": "### MAX\n返回数字表达式的最大值。\n\n```\nFROM employees\n| STATS MAX(languages)\n```\n\n此表达式可使用内联函数。例如,要计算一个多值列的平均值的最大值,应首先使用 `MV_AVG` 对每行的多个值求平均值,然后将结果用于 `MAX` 函数:\n\n```\nFROM employees\n| STATS max_avg_salary_change = MAX(MV_AVG(salary_change))\n```\n ", + "languageDocumentationPopover.documentationESQL.medianAbsoluteDeviationFunction": "MEDIAN_ABSOLUTE_DEVIATION", + "languageDocumentationPopover.documentationESQL.medianAbsoluteDeviationFunction.markdown": "### MEDIAN_ABSOLUTE_DEVIATION\n返回中位数绝对偏差,衡量可变性。这是一种稳健统计,意味着它可用于描述可能包含离群值,或可能不是正态分布的数据。对于此类数据,它比标准偏差更具描述性。\n\n它计算为每个数据点的中位数与整个样例的中位数的偏差。也就是说,对于随机变量 X,中位数绝对偏差为 `median(|median(X) - X|)`。\n\n```\nFROM employees\n| STATS MEDIAN(salary), MEDIAN_ABSOLUTE_DEVIATION(salary)\n```\n\n注意:与 `PERCENTILE` 一样,`MEDIAN_ABSOLUTE_DEVIATION` 通常为基于 TDigest 算法的近似计算。`MEDIAN_ABSOLUTE_DEVIATION` 也具有非确定性。这意味着,即使使用相同的数据,但您得到的结果可能会略有不同。\n\n此表达式可使用内联函数。例如,要计算一个多值列的最大值的中位数绝对偏差,应首先使用 `MV_MAX` 获取每行的最大值,然后将结果用于 `MEDIAN_ABSOLUTE_DEVIATION` 函数:\n\n```\nFROM employees\n| STATS m_a_d_max_salary_change = MEDIAN_ABSOLUTE_DEVIATION(MV_MAX(salary_change))\n```\n\n", + "languageDocumentationPopover.documentationESQL.medianFunction": "MEDIAN", + "languageDocumentationPopover.documentationESQL.medianFunction.markdown": "### MEDIAN\n返回大于所有值的一半且小于所有值的一半的值,也称为 50% `PERCENTILE`。\n\n**注意:**与 `PERCENTILE` 一样,`MEDIAN` 通常为基于 TDigest 算法的近似计算。\n\n**警告:** `MEDIAN` 也具有[非确定性](https://en.wikipedia.org/wiki/Nondeterministic_algorithm)。这意味着,即使使用相同的数据,但您得到的结果可能会略有不同。\n\n例如:\n\n```\nFROM employees\n| STATS MEDIAN(salary), PERCENTILE(salary, 50)\n```\n\n此表达式可使用内联函数。例如,要计算一个多值列的最大值的中位数,应首先使用 `MV_MAX` 获取每行的最大值,然后将结果用于 `MEDIAN` 函数:\n\n```\nFROM employees\n| STATS median_max_salary_change = MEDIAN(MV_MAX(salary_change))\n```\n ", + "languageDocumentationPopover.documentationESQL.minFunction": "MIN", + "languageDocumentationPopover.documentationESQL.minFunction.markdown": "### MIN\n返回数字字段的最小值。\n\n```\nFROM employees\n| STATS MIN(languages)\n```\n\n此表达式可使用内联函数。例如,要计算一个多值列的平均值的最小值,应首先使用 `MV_AVG` 对每行的多个值求平均值,然后将结果用于 `MIN` 函数:\n\n```\nFROM employees\n| STATS min_avg_salary_change = MIN(MV_AVG(salary_change))\n```\n ", + "languageDocumentationPopover.documentationESQL.mv_append": "MV_APPEND", + "languageDocumentationPopover.documentationESQL.mv_append.markdown": "\n\n ### MV_APPEND\n 串联两个多值字段的值。\n\n ", + "languageDocumentationPopover.documentationESQL.mv_avg": "MV_AVG", + "languageDocumentationPopover.documentationESQL.mv_avg.markdown": "\n\n ### MV_AVG\n 将多值字段转换为包含所有值的平均值的单值字段。\n\n ```\n ROW a=[3, 5, 1, 6]\n | EVAL avg_a = MV_AVG(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.mv_concat": "MV_CONCAT", + "languageDocumentationPopover.documentationESQL.mv_concat.markdown": "\n\n ### MV_CONCAT\n 将多值字符串表达式转换为单值列,其中包含由分隔符分隔的所有值的串联形式。\n\n ```\n ROW a=[\"foo\", \"zoo\", \"bar\"]\n | EVAL j = MV_CONCAT(a, \", \")\n ```\n ", + "languageDocumentationPopover.documentationESQL.mv_count": "MV_COUNT", + "languageDocumentationPopover.documentationESQL.mv_count.markdown": "\n\n ### MV_COUNT\n 将多值表达式转换为包含值计数的单值列。\n\n ```\n ROW a=[\"foo\", \"zoo\", \"bar\"]\n | EVAL count_a = MV_COUNT(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.mv_dedupe": "MV_DEDUPE", + "languageDocumentationPopover.documentationESQL.mv_dedupe.markdown": "\n\n ### MV_DEDUPE\n 移除多值字段中的重复值。\n\n ```\n ROW a=[\"foo\", \"foo\", \"bar\", \"foo\"]\n | EVAL dedupe_a = MV_DEDUPE(a)\n ```\n 注意:`MV_DEDUPE` 可能但不会始终对列中的值进行排序。\n ", + "languageDocumentationPopover.documentationESQL.mv_first": "MV_FIRST", + "languageDocumentationPopover.documentationESQL.mv_first.markdown": "\n\n ### MV_FIRST\n 将多值表达式转换为包含第一个值的\n 单值列。这在从按已知顺序发出多值列的\n 函数(如 `SPLIT`)中读取数据时尤其有用。\n\n 无法保证从底层存储\n 读取多值字段的顺序。它 *通常* 为升序,但不应\n 依赖于此。如果需要最小值,请使用 `MV_MIN` 而不是\n `MV_FIRST`。`MV_MIN` 针对排序值进行了优化,因此\n 对 `MV_FIRST` 没有性能优势。\n\n ```\n ROW a=\"foo;bar;baz\"\n | EVAL first_a = MV_FIRST(SPLIT(a, \";\"))\n ```\n ", + "languageDocumentationPopover.documentationESQL.mv_last": "MV_LAST", + "languageDocumentationPopover.documentationESQL.mv_last.markdown": "\n\n ### MV_LAST\n 将多值表达式转换为包含最后一个值的单值\n 列。这在从按已知顺序发出多值列的函数\n (如 `SPLIT`)中读取数据时尤其有用。\n\n 无法保证从底层存储\n 读取多值字段的顺序。它 *通常* 为升序,但不应\n 依赖于此。如果需要最大值,请使用 `MV_MAX` 而不是\n `MV_LAST`。`MV_MAX` 针对排序值进行了优化,因此\n 对 `MV_LAST` 没有性能优势。\n\n ```\n ROW a=\"foo;bar;baz\"\n | EVAL last_a = MV_LAST(SPLIT(a, \";\"))\n ```\n ", + "languageDocumentationPopover.documentationESQL.mv_max": "MV_MAX", + "languageDocumentationPopover.documentationESQL.mv_max.markdown": "\n\n ### MV_MAX\n 将多值表达式转换为包含最大值的单值列。\n\n ```\n ROW a=[3, 5, 1]\n | EVAL max_a = MV_MAX(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.mv_median": "MV_MEDIAN", + "languageDocumentationPopover.documentationESQL.mv_median.markdown": "\n\n ### MV_MEDIAN\n 将多值字段转换为包含中位数值的单值字段。\n\n ```\n ROW a=[3, 5, 1]\n | EVAL median_a = MV_MEDIAN(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.mv_min": "MV_MIN", + "languageDocumentationPopover.documentationESQL.mv_min.markdown": "\n\n ### MV_MIN\n 将多值表达式转换为包含最小值的单值列。\n\n ```\n ROW a=[2, 1]\n | EVAL min_a = MV_MIN(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.mv_slice": "MV_SLICE", + "languageDocumentationPopover.documentationESQL.mv_slice.markdown": "\n\n ### MV_SLICE\n 使用起始和结束索引值返回多值字段的子集。\n\n ```\n row a = [1, 2, 2, 3]\n | eval a1 = mv_slice(a, 1), a2 = mv_slice(a, 2, 3)\n ```\n ", + "languageDocumentationPopover.documentationESQL.mv_sort": "MV_SORT", + "languageDocumentationPopover.documentationESQL.mv_sort.markdown": "\n\n ### MV_SORT\n 按字典顺序对多值字段排序。\n\n ```\n ROW a = [4, 2, -3, 2]\n | EVAL sa = mv_sort(a), sd = mv_sort(a, \"DESC\")\n ```\n ", + "languageDocumentationPopover.documentationESQL.mv_sum": "MV_SUM", + "languageDocumentationPopover.documentationESQL.mv_sum.markdown": "\n\n ### MV_SUM\n 将多值字段转换为包含所有值的总和的单值字段。\n\n ```\n ROW a=[3, 5, 6]\n | EVAL sum_a = MV_SUM(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.mv_zip": "MV_ZIP", + "languageDocumentationPopover.documentationESQL.mv_zip.markdown": "\n\n ### MV_ZIP\n 组合两个使用分隔符联接在一起的多值字段中的值。\n\n ```\n ROW a = [\"x\", \"y\", \"z\"], b = [\"1\", \"2\"]\n | EVAL c = mv_zip(a, b, \"-\")\n | KEEP a, b, c\n ```\n ", + "languageDocumentationPopover.documentationESQL.mvExpand": "MV_EXPAND", + "languageDocumentationPopover.documentationESQL.mvExpand.markdown": "### MV_EXPAND\n`MV_EXPAND` 处理命令将多值字段扩展成每个值一行,从而复制其他字段: \n```\nROW a=[1,2,3], b=\"b\", j=[\"a\",\"b\"]\n| MV_EXPAND a\n```\n ", + "languageDocumentationPopover.documentationESQL.now": "NOW", + "languageDocumentationPopover.documentationESQL.now.markdown": "\n\n ### NOW\n 返回当前日期和时间。\n\n ```\n ROW current_date = NOW()\n ```\n ", + "languageDocumentationPopover.documentationESQL.percentileFunction": "PERCENTILE", + "languageDocumentationPopover.documentationESQL.percentileFunction.markdown": "### PERCENTILE\n出现某个百分比的观察值时的值。例如,第 95 个百分位是大于 95% 的观察值的值,第 50 个百分位是 `MEDIAN`。\n\n```\nFROM employees\n| STATS p0 = PERCENTILE(salary, 0)\n , p50 = PERCENTILE(salary, 50)\n , p99 = PERCENTILE(salary, 99)\n```\n\n**注意:** `PERCENTILE` 通常为基于 TDigest 算法的近似计算。\n\n**警告:** `PERCENTILE` 也具有[非确定性](https://en.wikipedia.org/wiki/Nondeterministic_algorithm)。这意味着,即使使用相同的数据,但您得到的结果可能会略有不同。\n\n此表达式可使用内联函数。例如,要计算一个多值列的最大值的百分位数,应首先使用 `MV_MAX` 获取每行的最大值,然后将结果用于 `PERCENTILE` 函数:\n\n```\nFROM employees\n| STATS p80_max_salary_change = PERCENTILE(MV_MAX(salary_change), 80)\n```\n ", + "languageDocumentationPopover.documentationESQL.pi": "PI", + "languageDocumentationPopover.documentationESQL.pi.markdown": "\n\n ### PI\n 返回 Pi,即圆的周长与其直径的比率。\n\n ```\n ROW PI()\n ```\n ", + "languageDocumentationPopover.documentationESQL.pow": "POW", + "languageDocumentationPopover.documentationESQL.pow.markdown": "\n\n ### POW\n 返回提升为 `exponent` 幂的 `base` 的值。\n\n ```\n ROW base = 2.0, exponent = 2\n | EVAL result = POW(base, exponent)\n ```\n 注意:此处仍可能使双精度结果溢出;在该情况下,将返回 null。\n ", + "languageDocumentationPopover.documentationESQL.predicates": "Null 值", + "languageDocumentationPopover.documentationESQL.predicates.markdown": "### NULL 值\n对于 NULL 比较,请使用 `IS NULL` 和 `IS NOT NULL` 谓词:\n\n```\nFROM employees\n| WHERE birth_date IS NULL\n| KEEP first_name, last_name\n| SORT first_name\n| LIMIT 3\n```\n\n```\nFROM employees\n| WHERE is_rehired IS NOT NULL\n| STATS count(emp_no)\n```\n ", + "languageDocumentationPopover.documentationESQL.rename": "RENAME", + "languageDocumentationPopover.documentationESQL.rename.markdown": "### RENAME\n请使用 `RENAME` 通过以下语法对列重命名:\n\n```\nRENAME AS \n```\n\n例如:\n\n```\nFROM employees\n| KEEP first_name, last_name, still_hired\n| RENAME still_hired AS employed\n```\n\n如果使用新名称的列已存在,将用新列替换该列。\n\n可以使用单个 `RENAME` 命令对多个列重命名:\n\n```\nFROM employees\n| KEEP first_name, last_name\n| RENAME first_name AS fn, last_name AS ln\n```\n ", + "languageDocumentationPopover.documentationESQL.repeat": "REPEAT", + "languageDocumentationPopover.documentationESQL.repeat.markdown": "\n\n ### REPEAT\n 返回通过串联 `string` 自身与指定次数 `number` 构造而成的字符串。\n\n ```\n ROW a = \"Hello!\"\n | EVAL triple_a = REPEAT(a, 3);\n ```\n ", + "languageDocumentationPopover.documentationESQL.replace": "REPLACE", + "languageDocumentationPopover.documentationESQL.replace.markdown": "\n\n ### REPLACE\n 此函数将字符串 `str` 中正则表达式 `regex` 的任何匹配项\n 替换为替代字符串 `newStr`。\n\n ```\n ROW str = \"Hello World\"\n | EVAL str = REPLACE(str, \"World\", \"Universe\")\n | KEEP str\n ```\n ", + "languageDocumentationPopover.documentationESQL.right": "RIGHT", + "languageDocumentationPopover.documentationESQL.right.markdown": "\n\n ### RIGHT\n 返回从“字符串”中提取“长度”字符的子字符串,从右侧开始。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL right = RIGHT(last_name, 3)\n | SORT last_name ASC\n | LIMIT 5\n ```\n ", + "languageDocumentationPopover.documentationESQL.round": "ROUND", + "languageDocumentationPopover.documentationESQL.round.markdown": "\n\n ### ROUND\n 将数字舍入到指定小数位数。\n 默认值为 0,即返回最近的整数。如果\n 精确度为负数,则将数字舍入到\n 小数点左侧的位数。\n\n ```\n FROM employees\n | KEEP first_name, last_name, height\n | EVAL height_ft = ROUND(height * 3.281, 1)\n ```\n ", + "languageDocumentationPopover.documentationESQL.row": "ROW", + "languageDocumentationPopover.documentationESQL.row.markdown": "### ROW\n`ROW` 源命令会生成一个行,其中包含一个或多个含有您指定的值的列。这可以用于测试。\n \n```\nROW a = 1, b = \"two\", c = null\n```\n\n请使用方括号创建多值列:\n\n```\nROW a = [2, 1]\n```\n\nROW 支持使用函数:\n\n```\nROW a = ROUND(1.23, 0)\n```\n ", + "languageDocumentationPopover.documentationESQL.rtrim": "RTRIM", + "languageDocumentationPopover.documentationESQL.rtrim.markdown": "\n\n ### RTRIM\n 从字符串中移除尾随空格。\n\n ```\n ROW message = \" some text \", color = \" red \"\n | EVAL message = RTRIM(message)\n | EVAL color = RTRIM(color)\n | EVAL message = CONCAT(\"'\", message, \"'\")\n | EVAL color = CONCAT(\"'\", color, \"'\")\n ```\n ", + "languageDocumentationPopover.documentationESQL.show": "SHOW", + "languageDocumentationPopover.documentationESQL.show.markdown": "### SHOW\n`SHOW ` 源命令返回有关部署及其功能的信息:\n\n* 使用 `SHOW INFO` 可返回部署的版本、构建日期和哈希。\n* 使用 `SHOW FUNCTIONS` 可返回所有受支持函数的列表和每个函数的概要。\n ", + "languageDocumentationPopover.documentationESQL.signum": "SIGNUM", + "languageDocumentationPopover.documentationESQL.signum.markdown": "\n\n ### SIGNUM\n 返回给定数字的符号。\n 它对负数返回 `-1`,对 `0` 返回 `0`,对正数返回 `1`。\n\n ```\n ROW d = 100.0\n | EVAL s = SIGNUM(d)\n ```\n ", + "languageDocumentationPopover.documentationESQL.sin": "SIN", + "languageDocumentationPopover.documentationESQL.sin.markdown": "\n\n ### SIN\n 返回角度的正弦三角函数。\n\n ```\n ROW a=1.8 \n | EVAL sin=SIN(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.sinh": "SINH", + "languageDocumentationPopover.documentationESQL.sinh.markdown": "\n\n ### SINH\n 返回角度的双曲正弦。\n\n ```\n ROW a=1.8 \n | EVAL sinh=SINH(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.sort": "SORT", + "languageDocumentationPopover.documentationESQL.sort.markdown": "### SORT\n使用 `SORT` 命令可对一个或多个字段上的行排序:\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height\n```\n\n默认排序顺序为升序。请使用 `ASC` 或 `DESC` 设置显式排序顺序:\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height DESC\n```\n\n如果两个行具有相同的排序键,则保留原始顺序。您可以提供其他排序表达式充当连接断路器:\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height DESC, first_name ASC\n```\n\n#### `null` 值\n默认情况下,会将 `null` 值视为大于任何其他值。使用升序排序顺序时,会最后对 `null` 值排序,而使用降序排序顺序时,会首先对 `null` 值排序。您可以通过提供 `NULLS FIRST` 或 `NULLS LAST` 来更改该排序:\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT first_name ASC NULLS FIRST\n```\n ", + "languageDocumentationPopover.documentationESQL.split": "SPLIT", + "languageDocumentationPopover.documentationESQL.split.markdown": "\n\n ### SPLIT\n 将单值字符串拆分成多个字符串。\n\n ```\n ROW words=\"foo;bar;baz;qux;quux;corge\"\n | EVAL word = SPLIT(words, \";\")\n ```\n ", + "languageDocumentationPopover.documentationESQL.sqrt": "SQRT", + "languageDocumentationPopover.documentationESQL.sqrt.markdown": "\n\n ### SQRT\n 返回数字的平方根。输入可以为任何数字值,返回值始终为双精度值。\n 负数和无穷大的平方根为 null。\n\n ```\n ROW d = 100.0\n | EVAL s = SQRT(d)\n ```\n ", + "languageDocumentationPopover.documentationESQL.st_contains": "ST_CONTAINS", + "languageDocumentationPopover.documentationESQL.st_contains.markdown": "\n\n ### ST_CONTAINS\n 返回第一个几何形状是否包含第二个几何形状。\n 这是 `ST_WITHIN` 函数的反向函数。\n\n ```\n FROM airport_city_boundaries\n | WHERE ST_CONTAINS(city_boundary, TO_GEOSHAPE(\"POLYGON((109.35 18.3, 109.45 18.3, 109.45 18.4, 109.35 18.4, 109.35 18.3))\"))\n | KEEP abbrev, airport, region, city, city_location\n ```\n ", + "languageDocumentationPopover.documentationESQL.st_disjoint": "ST_DISJOINT", + "languageDocumentationPopover.documentationESQL.st_disjoint.markdown": "\n\n ### ST_DISJOINT\n 返回两个几何图形或几何图形列是否不相交。\n 这是 `ST_INTERSECTS` 函数的反向函数。\n 从数学上讲:ST_Disjoint(A, B) ⇔ A ⋂ B = ∅\n\n ```\n FROM airport_city_boundaries\n | WHERE ST_DISJOINT(city_boundary, TO_GEOSHAPE(\"POLYGON((-10 -60, 120 -60, 120 60, -10 60, -10 -60))\"))\n | KEEP abbrev, airport, region, city, city_location\n ```\n ", + "languageDocumentationPopover.documentationESQL.st_distance": "ST_DISTANCE", + "languageDocumentationPopover.documentationESQL.st_distance.markdown": "\n\n ### ST_DISTANCE\n 计算两点之间的距离。\n 对于笛卡尔几何形状,这是以相同单位作为原始坐标时的毕达哥拉斯距离。\n 对于地理几何形状而言,这是沿着地球大圆的圆周距离(以米为单位)。\n\n ```\n FROM airports\n | WHERE abbrev == \"CPH\"\n | EVAL distance = ST_DISTANCE(location, city_location)\n | KEEP abbrev, name, location, city_location, distance\n ```\n ", + "languageDocumentationPopover.documentationESQL.st_intersects": "ST_INTERSECTS", + "languageDocumentationPopover.documentationESQL.st_intersects.markdown": "\n\n ### ST_INTERSECTS\n 如果两个几何形状相交,则返回 true。\n 如果它们有任何共同点,包括其内点\n (沿线的点或多边形内的点),则表示它们相交。\n 这是 `ST_DISJOINT` 函数的反向函数。\n 从数学上讲:ST_Intersects(A, B) ⇔ A ⋂ B ≠ ∅\n\n ```\n FROM airports\n | WHERE ST_INTERSECTS(location, TO_GEOSHAPE(\"POLYGON((42 14, 43 14, 43 15, 42 15, 42 14))\"))\n ```\n ", + "languageDocumentationPopover.documentationESQL.st_within": "ST_WITHIN", + "languageDocumentationPopover.documentationESQL.st_within.markdown": "\n\n ### ST_WITHIN\n 返回第一个几何形状是否在第二个几何形状内。\n 这是 `ST_CONTAINS` 函数的反向函数。\n\n ```\n FROM airport_city_boundaries\n | WHERE ST_WITHIN(city_boundary, TO_GEOSHAPE(\"POLYGON((109.1 18.15, 109.6 18.15, 109.6 18.65, 109.1 18.65, 109.1 18.15))\"))\n | KEEP abbrev, airport, region, city, city_location\n ```\n ", + "languageDocumentationPopover.documentationESQL.st_x": "ST_X", + "languageDocumentationPopover.documentationESQL.st_x.markdown": "\n\n ### ST_X\n 从提供的点中提取 `x` 坐标。\n 如果点的类型为 `geo_point`,则这等同于提取 `longitude` 值。\n\n ```\n ROW point = TO_GEOPOINT(\"POINT(42.97109629958868 14.7552534006536)\")\n | EVAL x = ST_X(point), y = ST_Y(point)\n ```\n ", + "languageDocumentationPopover.documentationESQL.st_y": "ST_Y", + "languageDocumentationPopover.documentationESQL.st_y.markdown": "\n\n ### ST_Y\n 从提供的点中提取 `y` 坐标。\n 如果点的类型为 `geo_point`,则这等同于提取 `latitude` 值。\n\n ```\n ROW point = TO_GEOPOINT(\"POINT(42.97109629958868 14.7552534006536)\")\n | EVAL x = ST_X(point), y = ST_Y(point)\n ```\n ", + "languageDocumentationPopover.documentationESQL.starts_with": "STARTS_WITH", + "languageDocumentationPopover.documentationESQL.starts_with.markdown": "\n\n ### STARTS_WITH\n 返回指示关键字字符串是否以另一个字符串开头的布尔值。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL ln_S = STARTS_WITH(last_name, \"B\")\n ```\n ", + "languageDocumentationPopover.documentationESQL.statsby": "STATS ...BY", + "languageDocumentationPopover.documentationESQL.statsby.markdown": "### STATS ...BY\n使用 `STATS ...BY` 可根据公共值对行分组,并计算已分组行中的一个或多个聚合值。\n\n**示例**:\n\n```\nFROM employees\n| STATS count = COUNT(emp_no) BY languages\n| SORT languages\n```\n\n如果省略 `BY`,输出表实际将包含一行,其中为应用于整个数据集的聚合:\n\n```\nFROM employees\n| STATS avg_lang = AVG(languages)\n```\n\n可以计算多个值:\n\n```\nFROM employees\n| STATS avg_lang = AVG(languages), max_lang = MAX(languages)\n```\n\n也可以按多个值分组(仅长整型和关键字家族字段支持):\n\n```\nFROM employees\n| EVAL hired = DATE_FORMAT(hire_date, \"YYYY\")\n| STATS avg_salary = AVG(salary) BY hired, languages.long\n| EVAL avg_salary = ROUND(avg_salary)\n| SORT hired, languages.long\n```\n\n请参阅**聚合函数**获取可与 `STATS ...BY` 搭配使用的函数列表。\n\n聚合函数和分组表达式均接受其他函数。这在对多值列使用 `STATS...BY` 时有用。例如,要计算平均工资变动,可以首先使用 `MV_AVG` 对每名员工的多个值求平均值,然后将结果用于 `AVG` 函数:\n\n```\nFROM employees\n| STATS avg_salary_change = AVG(MV_AVG(salary_change))\n```\n\n按表达式分组的示例为根据员工姓氏的第一个字母对其进行分组:\n\n```\nFROM employees\n| STATS my_count = COUNT() BY LEFT(last_name, 1)\n| SORT `LEFT(last_name, 1)`\n```\n\n指定输出列名称为可选操作。如果未指定,新列名称等于该表达式。以下查询将返回名为 `AVG(salary)` 的列:\n\n```\nFROM employees\n| STATS AVG(salary)\n```\n\n由于此名称包含特殊字符,在后续命令中使用该名称时,需要用反撇号 (`) 引用它:\n\n```\nFROM employees\n| STATS AVG(salary)\n| EVAL avg_salary_rounded = ROUND(`AVG(salary)`)\n```\n\n**注意**:不包含任何组的 `STATS` 比添加组更快。\n\n**注意**:当前,根据单一表达式进行分组比根据许多表达式进行分组更为优化。\n ", + "languageDocumentationPopover.documentationESQL.stCentroidFunction": "ST_CENTROID_AGG", + "languageDocumentationPopover.documentationESQL.stCentroidFunction.markdown": "### ST_CENTROID_AGG\n**警告:此功能处于技术预览状态,在未来版本中可能会更改或移除。Elastic 将努力修复任何问题,但处于技术预览状态的功能不受正式 GA 功能支持 SLA 的约束。**\n\n对包含空间点几何图形类型的字段计算空间重心。\n\n```\nFROM airports\n| STATS centroid=ST_CENTROID_AGG(location)\n```\n ", + "languageDocumentationPopover.documentationESQL.stringOperators": "LIKE 和 RLIKE", + "languageDocumentationPopover.documentationESQL.stringOperators.markdown": "### LIKE 和 RLIKE\n使用通配符或正则表达式比较字符串时,请使用 `LIKE` 或 `RLIKE`:\n\n使用 `LIKE` 时,可使用通配符来匹配字符串。支持以下通配符字符:\n\n* `*` 匹配零个或更多字符。\n* `?` 匹配一个字符。\n\n```\nFROM employees\n| WHERE first_name LIKE \"?b*\"\n| KEEP first_name, last_name\n```\n\n使用 `RLIKE` 时,可使用正则表达式来匹配字符串:\n\n```\nFROM employees\n| WHERE first_name RLIKE \".leja.*\"\n| KEEP first_name, last_name\n```\n ", + "languageDocumentationPopover.documentationESQL.substring": "SUBSTRING", + "languageDocumentationPopover.documentationESQL.substring.markdown": "\n\n ### SUBSTRING\n 返回字符串的子字符串,用起始位置和可选长度指定\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL ln_sub = SUBSTRING(last_name, 1, 3)\n ```\n ", + "languageDocumentationPopover.documentationESQL.sumFunction": "SUM", + "languageDocumentationPopover.documentationESQL.sumFunction.markdown": "### SUM\n返回数字字段的总和。\n\n```\nFROM employees\n| STATS SUM(languages)\n```\n\n此表达式可使用内联函数。例如,要计算每名员工的最大工资变动的总和,请对每行应用 `MV_MAX` 函数,然后对结果使用 `SUM`:\n\n```\nFROM employees\n| STATS total_salary_changes = SUM(MV_MAX(salary_change))\n```\n ", + "languageDocumentationPopover.documentationESQL.tan": "TAN", + "languageDocumentationPopover.documentationESQL.tan.markdown": "\n\n ### TAN\n 返回角度的正切三角函数。\n\n ```\n ROW a=1.8 \n | EVAL tan=TAN(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.tanh": "TANH", + "languageDocumentationPopover.documentationESQL.tanh.markdown": "\n\n ### TANH\n 返回角度的双曲正切函数。\n\n ```\n ROW a=1.8 \n | EVAL tanh=TANH(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.tau": "TAU", + "languageDocumentationPopover.documentationESQL.tau.markdown": "\n\n ### TAU\n 返回圆的圆周长与其半径的比率。\n\n ```\n ROW TAU()\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_base64": "TO_BASE64", + "languageDocumentationPopover.documentationESQL.to_base64.markdown": "\n\n ### TO_BASE64\n 将字符串编码为 base64 字符串。\n\n ```\n row a = \"elastic\" \n | eval e = to_base64(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_boolean": "TO_BOOLEAN", + "languageDocumentationPopover.documentationESQL.to_boolean.markdown": "\n\n ### TO_BOOLEAN\n 将输入值转换为布尔值。\n 字符串值 *true* 将不区分大小写并被转换为布尔值 *true*。\n 对于任何其他值,包括空字符串,此函数将返回 *false*。\n 数字值 *0* 将转换为 *false*,任何其他值将转换为 *true*。\n\n ```\n ROW str = [\"true\", \"TRuE\", \"false\", \"\", \"yes\", \"1\"]\n | EVAL bool = TO_BOOLEAN(str)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_cartesianpoint": "TO_CARTESIANPOINT", + "languageDocumentationPopover.documentationESQL.to_cartesianpoint.markdown": "\n\n ### TO_CARTESIANPOINT\n 将输入值转换为 `cartesian_point` 值。\n 字符串只有符合 WKT 点格式时,才能成功转换。\n\n ```\n ROW wkt = [\"POINT(4297.11 -1475.53)\", \"POINT(7580.93 2272.77)\"]\n | MV_EXPAND wkt\n | EVAL pt = TO_CARTESIANPOINT(wkt)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_cartesianshape": "TO_CARTESIANSHAPE", + "languageDocumentationPopover.documentationESQL.to_cartesianshape.markdown": "\n\n ### TO_CARTESIANSHAPE\n 将输入值转换为 `cartesian_shape` 值。\n 字符串只有符合 WKT 格式时,才能成功转换。\n\n ```\n ROW wkt = [\"POINT(4297.11 -1475.53)\", \"POLYGON ((3339584.72 1118889.97, 4452779.63 4865942.27, 2226389.81 4865942.27, 1113194.90 2273030.92, 3339584.72 1118889.97))\"]\n | MV_EXPAND wkt\n | EVAL geom = TO_CARTESIANSHAPE(wkt)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_datetime": "TO_DATETIME", + "languageDocumentationPopover.documentationESQL.to_datetime.markdown": "\n\n ### TO_DATETIME\n 将输入值转换为日期值。\n 仅当字符串采用 `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'` 格式时,才可进行成功转换。\n 要转换其他格式的日期,请使用 `DATE_PARSE`。\n\n ```\n ROW string = [\"1953-09-02T00:00:00.000Z\", \"1964-06-02T00:00:00.000Z\", \"1964-06-02 00:00:00\"]\n | EVAL datetime = TO_DATETIME(string)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_degrees": "TO_DEGREES", + "languageDocumentationPopover.documentationESQL.to_degrees.markdown": "\n\n ### TO_DEGREES\n 将弧度转换为度数。\n\n ```\n ROW rad = [1.57, 3.14, 4.71]\n | EVAL deg = TO_DEGREES(rad)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_double": "TO_DOUBLE", + "languageDocumentationPopover.documentationESQL.to_double.markdown": "\n\n ### TO_DOUBLE\n 将输入值转换为双精度值。如果输入参数为日期类型,\n 会将其值解析为自 Unix epoch 以来的毫秒数,\n 并转换为双精度值。布尔值 *true* 将转换为双精度值 *1.0*,*false* 转换为 *0.0*。\n\n ```\n ROW str1 = \"5.20128E11\", str2 = \"foo\"\n | EVAL dbl = TO_DOUBLE(\"520128000000\"), dbl1 = TO_DOUBLE(str1), dbl2 = TO_DOUBLE(str2)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_geopoint": "TO_GEOPOINT", + "languageDocumentationPopover.documentationESQL.to_geopoint.markdown": "\n\n ### TO_GEOPOINT\n 将输入值转换为 `geo_point` 值。\n 字符串只有符合 WKT 点格式时,才能成功转换。\n\n ```\n ROW wkt = \"POINT(42.97109630194 14.7552534413725)\"\n | EVAL pt = TO_GEOPOINT(wkt)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_geoshape": "TO_GEOSHAPE", + "languageDocumentationPopover.documentationESQL.to_geoshape.markdown": "\n\n ### TO_GEOSHAPE\n 将输入值转换为 `geo_shape` 值。\n 字符串只有符合 WKT 格式时,才能成功转换。\n\n ```\n ROW wkt = \"POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))\"\n | EVAL geom = TO_GEOSHAPE(wkt)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_integer": "TO_INTEGER", + "languageDocumentationPopover.documentationESQL.to_integer.markdown": "\n\n ### TO_INTEGER\n 将输入值转换为整数值。\n 如果输入参数为日期类型,会将其值解析为自 Unix epoch 以来\n 的毫秒数,并转换为整数。\n 布尔值 *true* 将转换为整数 *1*,*false* 转换为 *0*。\n\n ```\n ROW long = [5013792, 2147483647, 501379200000]\n | EVAL int = TO_INTEGER(long)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_ip": "TO_IP", + "languageDocumentationPopover.documentationESQL.to_ip.markdown": "\n\n ### TO_IP\n 将输入字符串转换为 IP 值。\n\n ```\n ROW str1 = \"1.1.1.1\", str2 = \"foo\"\n | EVAL ip1 = TO_IP(str1), ip2 = TO_IP(str2)\n | WHERE CIDR_MATCH(ip1, \"1.0.0.0/8\")\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_long": "TO_LONG", + "languageDocumentationPopover.documentationESQL.to_long.markdown": "\n\n ### TO_LONG\n 将输入值转换为长整型值。如果输入参数为日期类型,\n 会将其值解析为自 Unix epoch 以来的毫秒数,并转换为长整型值。\n 布尔值 *true* 将转换为长整型值 *1*,*false* 转换为 *0*。\n\n ```\n ROW str1 = \"2147483648\", str2 = \"2147483648.2\", str3 = \"foo\"\n | EVAL long1 = TO_LONG(str1), long2 = TO_LONG(str2), long3 = TO_LONG(str3)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_lower": "TO_LOWER", + "languageDocumentationPopover.documentationESQL.to_lower.markdown": "\n\n ### TO_LOWER\n 返回一个新字符串,表示已将输入字符串转为小写。\n\n ```\n ROW message = \"Some Text\"\n | EVAL message_lower = TO_LOWER(message)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_radians": "TO_RADIANS", + "languageDocumentationPopover.documentationESQL.to_radians.markdown": "\n\n ### TO_RADIANS\n 将度数转换为弧度。\n\n ```\n ROW deg = [90.0, 180.0, 270.0]\n | EVAL rad = TO_RADIANS(deg)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_string": "TO_STRING", + "languageDocumentationPopover.documentationESQL.to_string.markdown": "\n\n ### TO_STRING\n 将输入值转换为字符串。\n\n ```\n ROW a=10\n | EVAL j = TO_STRING(a)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_unsigned_long": "TO_UNSIGNED_LONG", + "languageDocumentationPopover.documentationESQL.to_unsigned_long.markdown": "\n\n ### TO_UNSIGNED_LONG\n 将输入值转换为无符号长整型值。如果输入参数为日期类型,\n 会将其值解析为自 Unix epoch 以来的毫秒数,并转换为无符号长整型值。\n 布尔值 *true* 将转换为无符号长整型值 *1*,*false* 转换为 *0*。\n\n ```\n ROW str1 = \"2147483648\", str2 = \"2147483648.2\", str3 = \"foo\"\n | EVAL long1 = TO_UNSIGNED_LONG(str1), long2 = TO_ULONG(str2), long3 = TO_UL(str3)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_upper": "TO_UPPER", + "languageDocumentationPopover.documentationESQL.to_upper.markdown": "\n\n ### TO_UPPER\n 返回一个新字符串,表示已将输入字符串转为大写。\n\n ```\n ROW message = \"Some Text\"\n | EVAL message_upper = TO_UPPER(message)\n ```\n ", + "languageDocumentationPopover.documentationESQL.to_version": "TO_VERSION", + "languageDocumentationPopover.documentationESQL.to_version.markdown": "\n\n ### TO_VERSION\n 将输入字符串转换为版本值。\n\n ```\n ROW v = TO_VERSION(\"1.2.3\")\n ```\n ", + "languageDocumentationPopover.documentationESQL.trim": "TRIM", + "languageDocumentationPopover.documentationESQL.trim.markdown": "\n\n ### TRIM\n 从字符串中移除前导和尾随空格。\n\n ```\n ROW message = \" some text \", color = \" red \"\n | EVAL message = TRIM(message)\n | EVAL color = TRIM(color)\n ```\n ", + "languageDocumentationPopover.documentationESQL.valuesFunction": "VALUES", + "languageDocumentationPopover.documentationESQL.valuesFunction.markdown": "### VALUES\n\n**警告:请勿在生产环境中使用 `VALUES`。此功能处于技术预览状态,在未来版本中可能会更改或移除。Elastic 将努力修复任何问题,但处于技术预览状态的功能不受正式 GA 功能支持 SLA 的约束。**\n\n以多值字段的形式返回组中的所有值。无法保证返回值的顺序。如果需要按顺序返回值,请使用 `MV_SORT`。\n\n接受任何类型的表达式,但 `geo_point`、`cartesian_point`、`geo_shape` 或 `cartesian_shape` 除外。\n\n\n例如:\n\n```\n FROM employees\n| EVAL first_letter = SUBSTRING(first_name, 0, 1)\n| STATS first_name=MV_SORT(VALUES(first_name)) BY first_letter\n| SORT first_letter\n```\n\n> _**警告:**这可能会占用大量内存,但除内存以外,ES|QL 尚不会增长聚合。因此,此聚合会正常工作,直到将其用于收集的值超出内存装载量。一旦收集的值过多,查询将会失败,并出现[断路器错误](https://www.elastic.co/guide/en/elasticsearch/reference/current/circuit-breaker-errors.html)。_\n\n ", + "languageDocumentationPopover.documentationESQL.where": "WHERE", + "languageDocumentationPopover.documentationESQL.where.markdown": "### WHERE\n使用 `WHERE` 可生成一个表,其中包含输入表中所提供的条件评估为 `true` 的所有行:\n \n```\nFROM employees\n| KEEP first_name, last_name, still_hired\n| WHERE still_hired == true\n```\n\n#### 运算符\n\n请参阅**运算符**了解所支持的运算符的概览。\n\n#### 函数\n`WHERE` 支持各种用于计算值的函数。请参阅**函数**了解更多信息。\n ", "textBasedEditor.query.textBasedLanguagesEditor.EnableWordWrapLabel": "在管道符上添加换行符", "textBasedEditor.query.textBasedLanguagesEditor.errorCount": "{count} 个{count, plural, other {错误}}", "textBasedEditor.query.textBasedLanguagesEditor.errorsTitle": "错误", From ef10eb7a1b9d316145c2e1240772b93b14b60341 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Tue, 10 Sep 2024 13:21:26 +0200 Subject: [PATCH 20/31] More i18n fixes --- .../sections/esql_documentation_sections.tsx | 24 +++++++++---------- .../translations/translations/fr-FR.json | 24 +++++++++---------- .../translations/translations/ja-JP.json | 24 +++++++++---------- .../translations/translations/zh-CN.json | 24 +++++++++---------- 4 files changed, 48 insertions(+), 48 deletions(-) diff --git a/packages/kbn-language-documentation-popover/src/sections/esql_documentation_sections.tsx b/packages/kbn-language-documentation-popover/src/sections/esql_documentation_sections.tsx index da2e9b7a8667fc..1a16d8542c206c 100644 --- a/packages/kbn-language-documentation-popover/src/sections/esql_documentation_sections.tsx +++ b/packages/kbn-language-documentation-popover/src/sections/esql_documentation_sections.tsx @@ -36,11 +36,11 @@ The result of a query is the table produced by the final processing command. ); export const sourceCommands = { - label: i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.sourceCommands', { + label: i18n.translate('languageDocumentationPopover.documentationESQL.sourceCommands', { defaultMessage: 'Source commands', }), description: i18n.translate( - 'textBasedEditor.query.textBasedLanguagesEditor.commandsDescription', + 'languageDocumentationPopover.documentationESQL.commandsDescription', { defaultMessage: `A source command produces a table, typically with data from Elasticsearch. ES|QL supports the following source commands.`, } @@ -173,11 +173,11 @@ The \`SHOW \` source command returns information about the deployment and }; export const processingCommands = { - label: i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.processingCommands', { + label: i18n.translate('languageDocumentationPopover.documentationESQL.processingCommands', { defaultMessage: 'Processing commands', }), description: i18n.translate( - 'textBasedEditor.query.textBasedLanguagesEditor.processingCommandsDescription', + 'languageDocumentationPopover.documentationESQL.processingCommandsDescription', { defaultMessage: `Processing commands change an input table by adding, removing, or changing rows and columns. ES|QL supports the following processing commands.`, } @@ -661,11 +661,11 @@ Refer to **Operators** for an overview of the supported operators. // DO NOT RENAME! // managed by scripts/generate_esql_docs.ts export const functions = { - label: i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.functions', { + label: i18n.translate('languageDocumentationPopover.documentationESQL.functions', { defaultMessage: 'Functions', }), description: i18n.translate( - 'textBasedEditor.query.textBasedLanguagesEditor.functionsDocumentationESQLDescription', + 'languageDocumentationPopover.documentationESQL.functionsDocumentationESQLDescription', { defaultMessage: `Functions are supported by ROW, EVAL and WHERE.`, } @@ -3576,11 +3576,11 @@ export const functions = { }; export const aggregationFunctions = { - label: i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.aggregationFunctions', { + label: i18n.translate('languageDocumentationPopover.documentationESQL.aggregationFunctions', { defaultMessage: 'Aggregation functions', }), description: i18n.translate( - 'textBasedEditor.query.textBasedLanguagesEditor.aggregationFunctionsDocumentationESQLDescription', + 'languageDocumentationPopover.documentationESQL.aggregationFunctionsDocumentationESQLDescription', { defaultMessage: `These functions can by used with STATS...BY:`, } @@ -3976,11 +3976,11 @@ Example: }; export const groupingFunctions = { - label: i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.groupingFunctions', { + label: i18n.translate('languageDocumentationPopover.documentationESQL.groupingFunctions', { defaultMessage: 'Grouping functions', }), description: i18n.translate( - 'textBasedEditor.query.textBasedLanguagesEditor.groupingFunctionsDocumentationESQLDescription', + 'languageDocumentationPopover.documentationESQL.groupingFunctionsDocumentationESQLDescription', { defaultMessage: `These grouping functions can be used with \`STATS...BY\`:`, } @@ -4109,11 +4109,11 @@ FROM employees }; export const operators = { - label: i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.operators', { + label: i18n.translate('languageDocumentationPopover.documentationESQL.operators', { defaultMessage: 'Operators', }), description: i18n.translate( - 'textBasedEditor.query.textBasedLanguagesEditor.operatorsDocumentationESQLDescription', + 'languageDocumentationPopover.documentationESQL.operatorsDocumentationESQLDescription', { defaultMessage: `ES|QL supports the following operators:`, } diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 86e18b444a54d6..cff1628b3f6a74 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -7197,11 +7197,11 @@ "telemetry.usageCollectionConstant": "collecte de données d’utilisation", "telemetry.usageDataTitle": "Collecte de données d’utilisation", "textBasedEditor.query.textBasedLanguagesEditor.aborted": "La demande a été annulée", - "textBasedEditor.query.textBasedLanguagesEditor.aggregationFunctions": "Fonctions d'agrégation", - "textBasedEditor.query.textBasedLanguagesEditor.aggregationFunctionsDocumentationESQLDescription": "Ces fonctions peuvent être utilisées avec STATS...BY :", + "languageDocumentationPopover.documentationESQL.aggregationFunctions": "Fonctions d'agrégation", + "languageDocumentationPopover.documentationESQL.aggregationFunctionsDocumentationESQLDescription": "Ces fonctions peuvent être utilisées avec STATS...BY :", "textBasedEditor.query.textBasedLanguagesEditor.cancel": "Annuler", "textBasedEditor.query.textBasedLanguagesEditor.collapseLabel": "Réduire", - "textBasedEditor.query.textBasedLanguagesEditor.commandsDescription": "Une commande source produit un tableau, habituellement avec des données issues d'Elasticsearch. ES|QL est compatible avec les commandes sources suivantes.", + "languageDocumentationPopover.documentationESQL.commandsDescription": "Une commande source produit un tableau, habituellement avec des données issues d'Elasticsearch. ES|QL est compatible avec les commandes sources suivantes.", "textBasedEditor.query.textBasedLanguagesEditor.disableWordWrapLabel": "Supprimer les sauts de ligne des barres verticales", "languageDocumentationPopover.documentationESQL.abs": "ABS", "languageDocumentationPopover.documentationESQL.abs.markdown": "\n\n ### ABS\n Renvoie la valeur absolue.\n\n ````\n Numéro ROW = -1.0 \n | EVAL abs_number = ABS(number)\n ````\n ", @@ -7456,17 +7456,17 @@ "textBasedEditor.query.textBasedLanguagesEditor.esql": "ES|QL", "textBasedEditor.query.textBasedLanguagesEditor.expandLabel": "Développer", "textBasedEditor.query.textBasedLanguagesEditor.feedback": "Commentaires", - "textBasedEditor.query.textBasedLanguagesEditor.functions": "Fonctions", - "textBasedEditor.query.textBasedLanguagesEditor.functionsDocumentationESQLDescription": "Les fonctions sont compatibles avec \"ROW\" (Ligne), \"EVAL\" (Évaluation) et \"WHERE\" (Où).", - "textBasedEditor.query.textBasedLanguagesEditor.groupingFunctions": "Fonctions de groupage", - "textBasedEditor.query.textBasedLanguagesEditor.groupingFunctionsDocumentationESQLDescription": "Ces fonctions de regroupement peuvent être utilisées avec `STATS...BY` :", + "languageDocumentationPopover.documentationESQL.functions": "Fonctions", + "languageDocumentationPopover.documentationESQL.functionsDocumentationESQLDescription": "Les fonctions sont compatibles avec \"ROW\" (Ligne), \"EVAL\" (Évaluation) et \"WHERE\" (Où).", + "languageDocumentationPopover.documentationESQL.groupingFunctions": "Fonctions de groupage", + "languageDocumentationPopover.documentationESQL.groupingFunctionsDocumentationESQLDescription": "Ces fonctions de regroupement peuvent être utilisées avec `STATS...BY` :", "textBasedEditor.query.textBasedLanguagesEditor.hideQueriesLabel": "Masquer les recherches récentes", "textBasedEditor.query.textBasedLanguagesEditor.lineCount": "{count} {count, plural, one {ligne} other {lignes}}", "textBasedEditor.query.textBasedLanguagesEditor.lineNumber": "Ligne {lineNumber}", - "textBasedEditor.query.textBasedLanguagesEditor.operators": "Opérateurs", - "textBasedEditor.query.textBasedLanguagesEditor.operatorsDocumentationESQLDescription": "ES|QL est compatible avec les opérateurs suivants :", - "textBasedEditor.query.textBasedLanguagesEditor.processingCommands": "Traitement des commandes", - "textBasedEditor.query.textBasedLanguagesEditor.processingCommandsDescription": "Le traitement des commandes transforme un tableau des entrées par l'ajout, le retrait ou la modification des lignes et des colonnes. ES|QL est compatible avec le traitement des commandes suivant.", + "languageDocumentationPopover.documentationESQL.operators": "Opérateurs", + "languageDocumentationPopover.documentationESQL.operatorsDocumentationESQLDescription": "ES|QL est compatible avec les opérateurs suivants :", + "languageDocumentationPopover.documentationESQL.processingCommands": "Traitement des commandes", + "languageDocumentationPopover.documentationESQL.processingCommandsDescription": "Le traitement des commandes transforme un tableau des entrées par l'ajout, le retrait ou la modification des lignes et des colonnes. ES|QL est compatible avec le traitement des commandes suivant.", "textBasedEditor.query.textBasedLanguagesEditor.querieshistory.error": "La requête a échouée", "textBasedEditor.query.textBasedLanguagesEditor.querieshistory.success": "La requête a été exécuté avec succès", "textBasedEditor.query.textBasedLanguagesEditor.querieshistoryCopy": "Copier la requête dans le presse-papier", @@ -7475,7 +7475,7 @@ "textBasedEditor.query.textBasedLanguagesEditor.recentQueriesColumnLabel": "Recherches récentes", "textBasedEditor.query.textBasedLanguagesEditor.runQuery": "Exécuter la requête", "textBasedEditor.query.textBasedLanguagesEditor.showQueriesLabel": "Afficher les recherches récentes", - "textBasedEditor.query.textBasedLanguagesEditor.sourceCommands": "Commandes sources", + "languageDocumentationPopover.documentationESQL.sourceCommands": "Commandes sources", "textBasedEditor.query.textBasedLanguagesEditor.submitFeedback": "Soumettre un commentaire", "textBasedEditor.query.textBasedLanguagesEditor.timeRanColumnLabel": "Temps exécuté", "textBasedEditor.query.textBasedLanguagesEditor.timestampNotDetected": "@timestamp non trouvé", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index e9fe2b1d4d3fe4..7964e7ed2a4dc9 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -7191,11 +7191,11 @@ "telemetry.usageCollectionConstant": "使用状況の収集", "telemetry.usageDataTitle": "使用状況の収集", "textBasedEditor.query.textBasedLanguagesEditor.aborted": "リクエストが中断されました", - "textBasedEditor.query.textBasedLanguagesEditor.aggregationFunctions": "集約関数", - "textBasedEditor.query.textBasedLanguagesEditor.aggregationFunctionsDocumentationESQLDescription": "これらの関数はSTATS...BYで使用できます。", + "languageDocumentationPopover.documentationESQL.aggregationFunctions": "集約関数", + "languageDocumentationPopover.documentationESQL.aggregationFunctionsDocumentationESQLDescription": "これらの関数はSTATS...BYで使用できます。", "textBasedEditor.query.textBasedLanguagesEditor.cancel": "キャンセル", "textBasedEditor.query.textBasedLanguagesEditor.collapseLabel": "縮小", - "textBasedEditor.query.textBasedLanguagesEditor.commandsDescription": "通常、ソースコマンドはElasticsearchのデータを使ってテーブルを生成します。ES|QLは以下のソースコマンドをサポートしています。", + "languageDocumentationPopover.documentationESQL.commandsDescription": "通常、ソースコマンドはElasticsearchのデータを使ってテーブルを生成します。ES|QLは以下のソースコマンドをサポートしています。", "textBasedEditor.query.textBasedLanguagesEditor.disableWordWrapLabel": "パイプの改行を削除", "languageDocumentationPopover.documentationESQL.abs": "ABS", "languageDocumentationPopover.documentationESQL.abs.markdown": "\n\n ### ABS\n 絶対値を返します。\n\n ```\n ROW number = -1.0 \n | EVAL abs_number = ABS(number)\n ```\n ", @@ -7450,17 +7450,17 @@ "textBasedEditor.query.textBasedLanguagesEditor.esql": "ES|QL", "textBasedEditor.query.textBasedLanguagesEditor.expandLabel": "拡張", "textBasedEditor.query.textBasedLanguagesEditor.feedback": "フィードバック", - "textBasedEditor.query.textBasedLanguagesEditor.functions": "関数", - "textBasedEditor.query.textBasedLanguagesEditor.functionsDocumentationESQLDescription": "関数はROW、EVAL、WHEREでサポートされています。", - "textBasedEditor.query.textBasedLanguagesEditor.groupingFunctions": "グループ関数", - "textBasedEditor.query.textBasedLanguagesEditor.groupingFunctionsDocumentationESQLDescription": "これらのグループ関数はSTATS...BYで使用できます。", + "languageDocumentationPopover.documentationESQL.functions": "関数", + "languageDocumentationPopover.documentationESQL.functionsDocumentationESQLDescription": "関数はROW、EVAL、WHEREでサポートされています。", + "languageDocumentationPopover.documentationESQL.groupingFunctions": "グループ関数", + "languageDocumentationPopover.documentationESQL.groupingFunctionsDocumentationESQLDescription": "これらのグループ関数はSTATS...BYで使用できます。", "textBasedEditor.query.textBasedLanguagesEditor.hideQueriesLabel": "最近のクエリーを非表示", "textBasedEditor.query.textBasedLanguagesEditor.lineCount": "{count} {count, plural, other {行}}", "textBasedEditor.query.textBasedLanguagesEditor.lineNumber": "行{lineNumber}", - "textBasedEditor.query.textBasedLanguagesEditor.operators": "演算子", - "textBasedEditor.query.textBasedLanguagesEditor.operatorsDocumentationESQLDescription": "ES|QLは以下の演算子をサポートしています。", - "textBasedEditor.query.textBasedLanguagesEditor.processingCommands": "処理コマンド", - "textBasedEditor.query.textBasedLanguagesEditor.processingCommandsDescription": "処理コマンドは、行や列を追加、削除、変更することによって入力テーブルを変更します。ES|QLは以下の処理コマンドをサポートしています。", + "languageDocumentationPopover.documentationESQL.operators": "演算子", + "languageDocumentationPopover.documentationESQL.operatorsDocumentationESQLDescription": "ES|QLは以下の演算子をサポートしています。", + "languageDocumentationPopover.documentationESQL.processingCommands": "処理コマンド", + "languageDocumentationPopover.documentationESQL.processingCommandsDescription": "処理コマンドは、行や列を追加、削除、変更することによって入力テーブルを変更します。ES|QLは以下の処理コマンドをサポートしています。", "textBasedEditor.query.textBasedLanguagesEditor.querieshistory.error": "クエリ失敗", "textBasedEditor.query.textBasedLanguagesEditor.querieshistory.success": "クエリは正常に実行されました", "textBasedEditor.query.textBasedLanguagesEditor.querieshistoryCopy": "クエリをクリップボードにコピー", @@ -7469,7 +7469,7 @@ "textBasedEditor.query.textBasedLanguagesEditor.recentQueriesColumnLabel": "最近のクエリー", "textBasedEditor.query.textBasedLanguagesEditor.runQuery": "クエリーを実行", "textBasedEditor.query.textBasedLanguagesEditor.showQueriesLabel": "最近のクエリを表示", - "textBasedEditor.query.textBasedLanguagesEditor.sourceCommands": "ソースコマンド", + "languageDocumentationPopover.documentationESQL.sourceCommands": "ソースコマンド", "textBasedEditor.query.textBasedLanguagesEditor.submitFeedback": "フィードバックを送信", "textBasedEditor.query.textBasedLanguagesEditor.timeRanColumnLabel": "実行時間", "textBasedEditor.query.textBasedLanguagesEditor.timestampNotDetected": "@timestampが見つかりません", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 535f180f6868ce..d896a5b310b39d 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -7204,11 +7204,11 @@ "telemetry.usageCollectionConstant": "使用情况收集", "telemetry.usageDataTitle": "使用情况收集", "textBasedEditor.query.textBasedLanguagesEditor.aborted": "请求已中止", - "textBasedEditor.query.textBasedLanguagesEditor.aggregationFunctions": "聚合函数", - "textBasedEditor.query.textBasedLanguagesEditor.aggregationFunctionsDocumentationESQLDescription": "这些函数可以与 STATS...BY 搭配使用:", + "languageDocumentationPopover.documentationESQL.aggregationFunctions": "聚合函数", + "languageDocumentationPopover.documentationESQL.aggregationFunctionsDocumentationESQLDescription": "这些函数可以与 STATS...BY 搭配使用:", "textBasedEditor.query.textBasedLanguagesEditor.cancel": "取消", "textBasedEditor.query.textBasedLanguagesEditor.collapseLabel": "折叠", - "textBasedEditor.query.textBasedLanguagesEditor.commandsDescription": "源命令会生成一个表,其中通常包含来自 Elasticsearch 的数据。ES|QL 支持以下源命令。", + "languageDocumentationPopover.documentationESQL.commandsDescription": "源命令会生成一个表,其中通常包含来自 Elasticsearch 的数据。ES|QL 支持以下源命令。", "textBasedEditor.query.textBasedLanguagesEditor.disableWordWrapLabel": "移除管道符上的换行符", "languageDocumentationPopover.documentationESQL.abs": "ABS", "languageDocumentationPopover.documentationESQL.abs.markdown": "\n\n ### ABS\n 返回绝对值。\n\n ```\n ROW number = -1.0 \n | EVAL abs_number = ABS(number)\n ```\n ", @@ -7463,17 +7463,17 @@ "textBasedEditor.query.textBasedLanguagesEditor.esql": "ES|QL", "textBasedEditor.query.textBasedLanguagesEditor.expandLabel": "展开", "textBasedEditor.query.textBasedLanguagesEditor.feedback": "反馈", - "textBasedEditor.query.textBasedLanguagesEditor.functions": "函数", - "textBasedEditor.query.textBasedLanguagesEditor.functionsDocumentationESQLDescription": "ROW、EVAL 和 WHERE 支持的函数。", - "textBasedEditor.query.textBasedLanguagesEditor.groupingFunctions": "分组函数", - "textBasedEditor.query.textBasedLanguagesEditor.groupingFunctionsDocumentationESQLDescription": "这些分组函数可以与 `STATS...BY` 搭配使用:", + "languageDocumentationPopover.documentationESQL.functions": "函数", + "languageDocumentationPopover.documentationESQL.functionsDocumentationESQLDescription": "ROW、EVAL 和 WHERE 支持的函数。", + "languageDocumentationPopover.documentationESQL.groupingFunctions": "分组函数", + "languageDocumentationPopover.documentationESQL.groupingFunctionsDocumentationESQLDescription": "这些分组函数可以与 `STATS...BY` 搭配使用:", "textBasedEditor.query.textBasedLanguagesEditor.hideQueriesLabel": "隐藏最近查询", "textBasedEditor.query.textBasedLanguagesEditor.lineCount": "{count} {count, plural, other {行}}", "textBasedEditor.query.textBasedLanguagesEditor.lineNumber": "第 {lineNumber} 行", - "textBasedEditor.query.textBasedLanguagesEditor.operators": "运算符", - "textBasedEditor.query.textBasedLanguagesEditor.operatorsDocumentationESQLDescription": "ES|QL 支持以下运算符:", - "textBasedEditor.query.textBasedLanguagesEditor.processingCommands": "处理命令", - "textBasedEditor.query.textBasedLanguagesEditor.processingCommandsDescription": "处理命令会通过添加、移除或更改行和列来更改输入表。ES|QL 支持以下处理命令。", + "languageDocumentationPopover.documentationESQL.operators": "运算符", + "languageDocumentationPopover.documentationESQL.operatorsDocumentationESQLDescription": "ES|QL 支持以下运算符:", + "languageDocumentationPopover.documentationESQL.processingCommands": "处理命令", + "languageDocumentationPopover.documentationESQL.processingCommandsDescription": "处理命令会通过添加、移除或更改行和列来更改输入表。ES|QL 支持以下处理命令。", "textBasedEditor.query.textBasedLanguagesEditor.querieshistory.error": "查询失败", "textBasedEditor.query.textBasedLanguagesEditor.querieshistory.success": "已成功运行查询", "textBasedEditor.query.textBasedLanguagesEditor.querieshistoryCopy": "复制查询到剪贴板", @@ -7482,7 +7482,7 @@ "textBasedEditor.query.textBasedLanguagesEditor.recentQueriesColumnLabel": "最近查询", "textBasedEditor.query.textBasedLanguagesEditor.runQuery": "运行查询", "textBasedEditor.query.textBasedLanguagesEditor.showQueriesLabel": "显示最近查询", - "textBasedEditor.query.textBasedLanguagesEditor.sourceCommands": "源命令", + "languageDocumentationPopover.documentationESQL.sourceCommands": "源命令", "textBasedEditor.query.textBasedLanguagesEditor.submitFeedback": "提交反馈", "textBasedEditor.query.textBasedLanguagesEditor.timeRanColumnLabel": "运行时间", "textBasedEditor.query.textBasedLanguagesEditor.timestampNotDetected": "未找到 @timestamp", From deac8a7cd6c35d9b2bc8d1af99ef1377364c8f31 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Tue, 10 Sep 2024 13:38:34 +0200 Subject: [PATCH 21/31] Cleanup unused translations --- x-pack/plugins/translations/translations/fr-FR.json | 1 - x-pack/plugins/translations/translations/ja-JP.json | 1 - x-pack/plugins/translations/translations/zh-CN.json | 1 - 3 files changed, 3 deletions(-) diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index cff1628b3f6a74..34f3e0055fbd68 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -7453,7 +7453,6 @@ "textBasedEditor.query.textBasedLanguagesEditor.EnableWordWrapLabel": "Ajouter des sauts de ligne aux barres verticales", "textBasedEditor.query.textBasedLanguagesEditor.errorCount": "{count} {count, plural, one {erreur} other {erreurs}}", "textBasedEditor.query.textBasedLanguagesEditor.errorsTitle": "Erreurs", - "textBasedEditor.query.textBasedLanguagesEditor.esql": "ES|QL", "textBasedEditor.query.textBasedLanguagesEditor.expandLabel": "Développer", "textBasedEditor.query.textBasedLanguagesEditor.feedback": "Commentaires", "languageDocumentationPopover.documentationESQL.functions": "Fonctions", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 7964e7ed2a4dc9..ec91862811f463 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -7447,7 +7447,6 @@ "textBasedEditor.query.textBasedLanguagesEditor.EnableWordWrapLabel": "パイプの改行を追加", "textBasedEditor.query.textBasedLanguagesEditor.errorCount": "{count} {count, plural, other {# 件のエラー}}", "textBasedEditor.query.textBasedLanguagesEditor.errorsTitle": "エラー", - "textBasedEditor.query.textBasedLanguagesEditor.esql": "ES|QL", "textBasedEditor.query.textBasedLanguagesEditor.expandLabel": "拡張", "textBasedEditor.query.textBasedLanguagesEditor.feedback": "フィードバック", "languageDocumentationPopover.documentationESQL.functions": "関数", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index d896a5b310b39d..ba94739904f62a 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -7460,7 +7460,6 @@ "textBasedEditor.query.textBasedLanguagesEditor.EnableWordWrapLabel": "在管道符上添加换行符", "textBasedEditor.query.textBasedLanguagesEditor.errorCount": "{count} 个{count, plural, other {错误}}", "textBasedEditor.query.textBasedLanguagesEditor.errorsTitle": "错误", - "textBasedEditor.query.textBasedLanguagesEditor.esql": "ES|QL", "textBasedEditor.query.textBasedLanguagesEditor.expandLabel": "展开", "textBasedEditor.query.textBasedLanguagesEditor.feedback": "反馈", "languageDocumentationPopover.documentationESQL.functions": "函数", From 3fa663925935c7495fafdfa8888be6d1e09d2f10 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Thu, 12 Sep 2024 08:33:36 +0200 Subject: [PATCH 22/31] Fix the wrong key --- .../src/sections/generated/aggregation_functions.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/kbn-language-documentation-popover/src/sections/generated/aggregation_functions.tsx b/packages/kbn-language-documentation-popover/src/sections/generated/aggregation_functions.tsx index 0a20dc37155f3c..29bdeafbd48c07 100644 --- a/packages/kbn-language-documentation-popover/src/sections/generated/aggregation_functions.tsx +++ b/packages/kbn-language-documentation-popover/src/sections/generated/aggregation_functions.tsx @@ -13,11 +13,11 @@ import { Markdown } from '@kbn/shared-ux-markdown'; // DO NOT RENAME! export const functions = { - label: i18n.translate('languageDocumentationPopover.documentationESQLaggregationFunctions', { + label: i18n.translate('languageDocumentationPopover.documentationESQL.aggregationFunctions', { defaultMessage: 'Aggregation functions', }), description: i18n.translate( - 'languageDocumentationPopover.documentationESQLaggregationFunctionsDocumentationESQLDescription', + 'languageDocumentationPopover.documentationESQL.aggregationFunctionsDocumentationESQLDescription', { defaultMessage: `These functions can by used with STATS...BY:`, } From 4ab9e090414e9aa50d030db9bb256e53635aa762 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Thu, 12 Sep 2024 09:03:19 +0200 Subject: [PATCH 23/31] Cleanup translations --- .../translations/translations/fr-FR.json | 22 ------------------- .../translations/translations/ja-JP.json | 22 ------------------- .../translations/translations/zh-CN.json | 22 ------------------- 3 files changed, 66 deletions(-) diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index d2c4f3c43ff26f..40cbd5a3257bf1 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -7203,8 +7203,6 @@ "languageDocumentationPopover.documentationESQL.atan2.markdown": "\n\n ### ATAN2\n L'angle entre l'axe positif des x et le rayon allant de\n l'origine au point (x , y) dans le plan cartésien, exprimée en radians.\n\n ````\n ROW y=12.9, x=.6\n | EVAL atan2=ATAN2(y, x)\n ````\n ", "languageDocumentationPopover.documentationESQL.autoBucketFunction": "COMPARTIMENT", "languageDocumentationPopover.documentationESQL.autoBucketFunction.markdown": "### COMPARTIMENT\nCréer des groupes de valeurs, des compartiments (\"buckets\"), à partir d'une entrée d'un numéro ou d'un horodatage. La taille des compartiments peut être fournie directement ou choisie selon une plage de valeurs et de décompte recommandée.\n\n`BUCKET` a deux modes de fonctionnement : \n\n1. Dans lequel la taille du compartiment est calculée selon la recommandation de décompte d'un compartiment (quatre paramètres) et une plage.\n2. Dans lequel la taille du compartiment est fournie directement (deux paramètres).\n\nAvec un nombre cible de compartiments, le début d'une plage et la fin d'une plage, `BUCKET` choisit une taille de compartiment appropriée afin de générer le nombre cible de compartiments ou moins.\n\nPar exemple, demander jusqu'à 20 compartiments pour une année organisera les données en intervalles mensuels :\n\n````\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT hire_date\n````\n\n**REMARQUE** : Le but n'est pas de fournir le nombre précis de compartiments, mais plutôt de sélectionner une plage qui fournit, tout au plus, le nombre cible de compartiments.\n\nVous pouvez combiner `BUCKET` avec une agrégation pour créer un histogramme :\n\n````\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_month = COUNT(*) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT month\n````\n\n**REMARQUE** : `BUCKET` ne crée pas de compartiments qui ne correspondent à aucun document. C'est pourquoi, dans l'exemple précédent, il manque 1985-03-01 ainsi que d'autres dates.\n\nDemander d'autres compartiments peut résulter en une plage réduite. Par exemple, demander jusqu'à 100 compartiments en un an résulte en des compartiments hebdomadaires :\n\n````\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 100, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT week\n````\n\n**REMARQUE** : `AUTO_BUCKET` ne filtre aucune ligne. Il n'utilise que la plage fournie pour choisir une taille de compartiment appropriée. Pour les lignes dont la valeur se situe en dehors de la plage, il renvoie une valeur de compartiment qui correspond à un compartiment situé en dehors de la plage. Associez `BUCKET` à `WHERE` pour filtrer les lignes.\n\nSi la taille de compartiment désirée est connue à l'avance, fournissez-la comme second argument, en ignorant la plage :\n\n````\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 1 week)\n| SORT week\n````\n\n**REMARQUE** : Lorsque vous fournissez la taille du compartiment comme second argument, ce dernier doit être une période temporelle ou une durée.\n\n`BUCKET` peut également être utilisé pour des champs numériques. Par exemple, pour créer un histogramme de salaire :\n\n````\nFROM employees\n| STATS COUNT(*) by bs = BUCKET(salary, 20, 25324, 74999)\n| SORT bs\n````\n\nContrairement à l'exemple précédent qui filtre intentionnellement sur une plage temporelle, vous n'avez pas souvent besoin de filtrer sur une plage numérique. Vous devez trouver les valeurs min et max séparément. ES|QL n'a pas encore de façon aisée d'effectuer cette opération automatiquement.\n\nLa plage peut être ignorée si la taille désirée de compartiment est connue à l'avance. Fournissez-la simplement comme second argument :\n\n````\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS c = COUNT(1) BY b = BUCKET(salary, 5000.)\n| SORT b\n````\n\n**REMARQUE** : Lorsque vous fournissez la taille du compartiment comme second argument, elle doit être de type à **virgule flottante**.\n\nVoici un exemple sur comment créer des compartiments horaires pour les dernières 24 heures, et calculer le nombre d'événements par heure :\n\n````\nFROM sample_data\n| WHERE @timestamp >= NOW() - 1 day and @timestamp < NOW()\n| STATS COUNT(*) BY bucket = BUCKET(@timestamp, 25, NOW() - 1 day, NOW())\n````\n\nVoici un exemple permettant de créer des compartiments mensuels pour l'année 1985, et calculer le salaire moyen par mois d'embauche :\n\n````\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS AVG(salary) BY bucket = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT bucket\n````\n\n`BUCKET` peut être utilisé pour les parties de groupage et d'agrégation de la commande `STATS …​ BY ...`, tant que la partie d'agrégation de la fonction est **référencée par un alias défini dans la partie de groupage**, ou que celle-ci est invoquée avec exactement la même expression.\n\nPar exemple :\n\n````\nFROM employees\n| STATS s1 = b1 + 1, s2 = BUCKET(salary / 1000 + 999, 50.) + 2 BY b1 = BUCKET(salary / 100 + 99, 50.), b2 = BUCKET(salary / 1000 + 999, 50.)\n| SORT b1, b2\n| KEEP s1, b1, s2, b2\n````\n ", - "languageDocumentationPopover.documentationESQL.avgFunction": "AVG", - "languageDocumentationPopover.documentationESQL.avgFunction.markdown": "### AVG\nRenvoie la moyenne d'un champ numérique.\n\n````\nFROM employees\n| STATS AVG(height)\n````\n\nCette expression peut utiliser des fonctions alignées. Par exemple, pour calculer la moyenne sur une colonne multivaluée, il faut d'abord utiliser`MV_AVG` pour faire la moyenne des multiples valeurs par ligne et utiliser le résultat avec la fonction `AVG` :\n\n````\nFROM employees\n| STATS avg_salary_change = AVG(MV_AVG(salary_change))\n````\n ", "languageDocumentationPopover.documentationESQL.binaryOperators": "Opérateurs binaires", "languageDocumentationPopover.documentationESQL.binaryOperators.markdown": "### Opérateurs binaires\nLes opérateurs de comparaison binaire suivants sont pris en charge :\n\n* égalité : `==`\n* inégalité : `!=`\n* inférieur à : `<`\n* inférieur ou égal à : `<=`\n* supérieur à : `>`\n* supérieur ou égal à : `>=`\n* ajouter : `+`\n* soustraire : `-`\n* multiplier par : `*`\n* diviser par : `/`\n* module : `%`\n ", "languageDocumentationPopover.documentationESQL.booleanOperators": "Opérateurs booléens", @@ -7229,10 +7227,6 @@ "languageDocumentationPopover.documentationESQL.cos.markdown": "\n\n ### COS\n Renvoie le cosinus d'un angle.\n\n ````\n ROW a=1.8 \n | EVAL cos=COS(a)\n ````\n ", "languageDocumentationPopover.documentationESQL.cosh": "COSH", "languageDocumentationPopover.documentationESQL.cosh.markdown": "\n\n ### COSH\n Renvoie le cosinus hyperbolique d'un angle.\n\n ````\n ROW a=1.8 \n | EVAL cosh=COSH(a)\n ```\n ", - "languageDocumentationPopover.documentationESQL.countDistinctFunction": "COUNT_DISTINCT", - "languageDocumentationPopover.documentationESQL.countDistinctFunction.markdown": "### COUNT_DISTINCT\nDécompte le nombre approximatif de valeurs distinctes.\n\n````\nFROM hosts\n| STATS COUNT_DISTINCT(ip0), COUNT_DISTINCT(ip1)\n```\n\nLa fonction `COUNT_DISTINCT` est approximative, basée sur l'algorithme HyperLogLog++. Pour en savoir plus, consultez la [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-cardinality-aggregation.html#_counts_are_approximate). La précision est configurable à l'aide d'un deuxième paramètre facultatif. La valeur maximale compatible est 40000. Les seuils supérieurs à ce nombre auront le même effet qu'un seuil de 40000. La valeur par défaut est 3000.\n\n````\nFROM hosts\n| STATS COUNT_DISTINCT(ip0, 80000), COUNT_DISTINCT(ip1, 5)\n````\n\nCette expression peut utiliser des fonctions alignées. Cet exemple divise une chaîne en plusieurs valeurs à l'aide de la fonction `SPLIT` et compte les valeurs uniques :\n\n````\nROW words=\"foo;bar;baz;qux;quux;foo\"\n| STATS distinct_word_count = COUNT_DISTINCT(SPLIT(words, \";\"))\n````\n ", - "languageDocumentationPopover.documentationESQL.countFunction": "COUNT", - "languageDocumentationPopover.documentationESQL.countFunction.markdown": "### COUNT\nRenvoie le nombre total de valeurs en entrée.\n\n````\nFROM employees\n| STATS COUNT(height)\n````\n\nPeut prendre n'importe quel type de champ en entrée.\n\nPour compter le nombre de lignes, utiliser `COUNT()` ou `COUNT(*)` :\n\n````\nFROM employees\n| STATS count = COUNT(*) BY languages\n| SORT languages DESC\n````\n\nCette expression peut utiliser des fonctions alignées. Cet exemple divise une chaîne en plusieurs valeurs à l'aide de la fonction `SPLIT` et compte les valeurs :\n\n````\nROW words=\"foo;bar;baz;qux;quux;foo\"\n| STATS word_count = COUNT(SPLIT(words, \";\"))\n````\n ", "languageDocumentationPopover.documentationESQL.date_diff": "DATE_DIFF", "languageDocumentationPopover.documentationESQL.date_diff.markdown": "\n\n ### DATE_DIFF\n Soustrait le `startTimestamp` du `endTimestamp` et renvoie la différence en multiples `d'unité`.\n Si `startTimestamp` est postérieur à `endTimestamp`, des valeurs négatives sont renvoyées.\n\n ````\n ROW date1 = TO_DATETIME(\"2023-12-02T11:00:00.000Z\"), date2 = TO_DATETIME(\"2023-12-02T11:00:00.001Z\")\n | EVAL dd_ms = DATE_DIFF(\"microseconds\", date1, date2)\n ````\n ", "languageDocumentationPopover.documentationESQL.date_extract": "DATE_EXTRACT", @@ -7288,14 +7282,6 @@ "languageDocumentationPopover.documentationESQL.ltrim": "LTRIM", "languageDocumentationPopover.documentationESQL.ltrim.markdown": "\n\n ### LTRIM\n Retire les espaces au début des chaînes.\n\n ````\n ROW message = \" some text \", color = \" red \"\n | EVAL message = LTRIM(message)\n | EVAL color = LTRIM(color)\n | EVAL message = CONCAT(\"'\", message, \"'\")\n | EVAL color = CONCAT(\"'\", color, \"'\")\n ````\n ", "languageDocumentationPopover.documentationESQL.markdown": "## ES|QL\n\nUne requête ES|QL (langage de requête Elasticsearch) se compose d'une série de commandes, séparées par une barre verticale : `|`. Chaque requête commence par une **commande source**, qui produit un tableau, habituellement avec des données issues d'Elasticsearch. \n\nUne commande source peut être suivie d'une ou plusieurs **commandes de traitement**. Les commandes de traitement peuvent modifier le tableau de sortie de la commande précédente en ajoutant, supprimant ou modifiant les lignes et les colonnes.\n\n````\nsource-command\n| processing-command1\n| processing-command2\n````\n\nLe résultat d'une requête est le tableau produit par la dernière commande de traitement. \n ", - "languageDocumentationPopover.documentationESQL.maxFunction": "MAX", - "languageDocumentationPopover.documentationESQL.maxFunction.markdown": "### MAX\nRenvoie la valeur maximale d'une expression numérique.\n\n````\nFROM employees\n| STATS MAX(languages)\n````\n\nCette expression peut utiliser des fonctions alignées. Par exemple, pour calculer le maximum sur une moyenne d'une colonne multivaluée, il faut utiliser `MV_AVG` pour faire la moyenne des multiples valeurs par ligne et utiliser le résultat avec la fonction `MAX` :\n\n````\nFROM employees\n| STATS max_avg_salary_change = MAX(MV_AVG(salary_change))\n````\n ", - "languageDocumentationPopover.documentationESQL.medianAbsoluteDeviationFunction": "MEDIAN_ABSOLUTE_DEVIATION", - "languageDocumentationPopover.documentationESQL.medianAbsoluteDeviationFunction.markdown": "### MEDIAN_ABSOLUTE_DEVIATION\nRenvoie l'écart absolu médian, une mesure de la variabilité. Il s'agit d'un indicateur robuste, ce qui signifie qu'il est utile pour décrire des données qui peuvent présenter des valeurs aberrantes ou ne pas être normalement distribuées. Pour de telles données, il peut être plus descriptif que l'écart-type.\n\nIl est calculé comme la médiane de chaque écart de point de données par rapport à la médiane de l'ensemble de l'échantillon. Autrement dit, pour une variable aléatoire X, l'écart absolu médian est `median(|median(X) - X|)`.\n\n````\nFROM employees\n| STATS MEDIAN(salary), MEDIAN_ABSOLUTE_DEVIATION(salary)\n````\n\nREMARQUE : Comme la fonction `PERCENTILE`, la fonction `MEDIAN_ABSOLUTE_DEVIATION` est généralement approximative, et basée sur l'algorithme TDigest. Elle est également non déterministe. Cela signifie que vous pouvez obtenir des résultats légèrement différents en utilisant les mêmes données.\n\nCette expression peut utiliser des fonctions alignées. Par exemple, pour calculer l'écart absolu médian des valeurs maximales d'une colonne multivaluée, il faut d'abord utiliser `MV_MAX` pour obtenir la valeur maximale par ligne, et utiliser le résultat avec la fonction `MEDIAN_ABSOLUTE_DEVIATION` :\n\n````\nFROM employees\n| STATS m_a_d_max_salary_change = MEDIAN_ABSOLUTE_DEVIATION(MV_MAX(salary_change))\n````\n\n", - "languageDocumentationPopover.documentationESQL.medianFunction": "MEDIAN", - "languageDocumentationPopover.documentationESQL.medianFunction.markdown": "### MEDIAN\nRenvoie la valeur qui est supérieure à la moitié de toutes les valeurs et inférieure à la moitié de toutes les valeurs, également connue sous le nom de `PERCENTILE` 50 %.\n\n**REMARQUE :** Comme la fonction `PERCENTILE`, la fonction `MEDIAN` est généralement approximative et basée sur l'algorithme TDigest.\n\n**AVERTISSEMENT :** `MEDIAN` est également [non déterministe](https://en.wikipedia.org/wiki/Nondeterministic_algorithm). Cela signifie que vous pouvez obtenir des résultats légèrement différents en utilisant les mêmes données.\n\nExemple :\n\n````\nFROM employees\n| STATS MEDIAN(salary), PERCENTILE(salary, 50)\n````\n\nCette expression peut utiliser des fonctions alignées. Par exemple, pour calculer le médian des valeurs maximales d'une colonne multivaluée, il faut d'abord utiliser `MV_MAX` pour obtenir la valeur maximale par ligne et utiliser le résultat avec la fonction `MEDIAN` :\n\n````\nFROM employees\n| STATS median_max_salary_change = MEDIAN(MV_MAX(salary_change))\n````\n ", - "languageDocumentationPopover.documentationESQL.minFunction": "MIN", - "languageDocumentationPopover.documentationESQL.minFunction.markdown": "### MIN\nRenvoie la valeur minimale d'un champ numérique.\n\n````\nFROM employees\n| STATS MIN(languages)\n````\n\nCette expression peut utiliser des fonctions alignées. Par exemple, pour calculer le minimum sur une moyenne d'une colonne multivaluée, il faut utiliser `MV_AVG` pour faire la moyenne des valeurs multiples par ligne et utiliser le résultat avec la fonction `MIN` :\n\n````\nFROM employees\n| STATS min_avg_salary_change = MIN(MV_AVG(salary_change))\n````\n ", "languageDocumentationPopover.documentationESQL.mv_append": "MV_APPEND", "languageDocumentationPopover.documentationESQL.mv_append.markdown": "\n\n ### MV_APPEND\n Concatène les valeurs de deux champs à valeurs multiples.\n\n ", "languageDocumentationPopover.documentationESQL.mv_avg": "MV_AVG", @@ -7328,8 +7314,6 @@ "languageDocumentationPopover.documentationESQL.mvExpand.markdown": "### MV_EXPAND\nLa commande de traitement `MV_EXPAND` développe les champs multivalués en indiquant une valeur par ligne et en dupliquant les autres champs : \n````\nROW a=[1,2,3], b=\"b\", j=[\"a\",\"b\"]\n| MV_EXPAND a\n````\n ", "languageDocumentationPopover.documentationESQL.now": "NOW", "languageDocumentationPopover.documentationESQL.now.markdown": "\n\n ### NOW\n Renvoie la date et l'heure actuelles.\n\n ````\n ROW current_date = NOW()\n ````\n ", - "languageDocumentationPopover.documentationESQL.percentileFunction": "PERCENTILE", - "languageDocumentationPopover.documentationESQL.percentileFunction.markdown": "### PERCENTILE\nValeur à laquelle un certain pourcentage des valeurs observées se produit. Par exemple, le 95e percentile est la valeur qui est supérieure à 95 % des valeurs observées et le 50percentile est la médiane (`MEDIAN`).\n\n````\nFROM employees\n| STATS p0 = PERCENTILE(salary, 0)\n , p50 = PERCENTILE(salary, 50)\n , p99 = PERCENTILE(salary, 99)\n````\n\n**REMARQUE** : La fonction `PERCENTILE` est généralement approximative et basée sur l'algorithme TDigest. \n\n**AVERTISSEMENT :** `PERCENTILE` est aussi [non déterministe](https://en.wikipedia.org/wiki/Nondeterministic_algorithm). Cela signifie que vous pouvez obtenir des résultats légèrement différents en utilisant les mêmes données.\n\nCette expression peut utiliser des fonctions alignées. Par exemple, pour calculer un percentile des valeurs maximales d'une colonne multivaluée, il faut d'abord utiliser `MV_MAX` pour obtenir la valeur maximale par ligne et utiliser le résultat avec la fonction `PERCENTILE` :\n\n````\nFROM employees\n| STATS p80_max_salary_change = PERCENTILE(MV_MAX(salary_change), 80)\n````\n ", "languageDocumentationPopover.documentationESQL.pi": "PI", "languageDocumentationPopover.documentationESQL.pi.markdown": "\n\n ### PI\n Renvoie Pi, le rapport entre la circonférence et le diamètre d'un cercle.\n\n ````\n ROW PI()\n ````\n ", "languageDocumentationPopover.documentationESQL.pow": "POW", @@ -7382,14 +7366,10 @@ "languageDocumentationPopover.documentationESQL.starts_with.markdown": "\n\n ### STARTS_WITH\n Renvoie un booléen qui indique si une chaîne de mot-clés débute par une autre chaîne.\n\n ````\n FROM employees\n | KEEP last_name\n | EVAL ln_S = STARTS_WITH(last_name, \"B\")\n ````\n ", "languageDocumentationPopover.documentationESQL.statsby": "STATS ... BY", "languageDocumentationPopover.documentationESQL.statsby.markdown": "### STATS ... BY\nUtilisez `STATS ... BY` pour regrouper les lignes en fonction d'une valeur commune et calculer une ou plusieurs valeurs agrégées sur les lignes regroupées.\n\n**Exemples** :\n\n````\nFROM employees\n| STATS count = COUNT(emp_no) BY languages\n| SORT languages\n````\n\nSi `BY` est omis, le tableau de sortie contient exactement une ligne avec les agrégations appliquées sur l'ensemble des données :\n\n````\nFROM employees\n| STATS avg_lang = AVG(languages)\n````\n\nIl est possible de calculer plusieurs valeurs :\n\n````\nFROM employees\n| STATS avg_lang = AVG(languages), max_lang = MAX(languages)\n````\n\nIl est également possible d'effectuer des regroupements en fonction de plusieurs valeurs (uniquement pour les champs longs et les champs de la famille de mots-clés) :\n\n````\nFROM employees\n| EVAL hired = DATE_FORMAT(hire_date, \"YYYY\")\n| STATS avg_salary = AVG(salary) BY hired, languages.long\n| EVAL avg_salary = ROUND(avg_salary)\n| SORT hired, languages.long\n````\n\nConsultez la rubrique **Fonctions d'agrégation** pour obtenir la liste des fonctions pouvant être utilisées avec `STATS ... BY`.\n\nLes fonctions d'agrégation et les expressions de regroupement acceptent toutes deux d'autres fonctions. Ceci est utile pour utiliser `STATS...BY` sur des colonnes à valeur multiple. Par exemple, pour calculer l'évolution moyenne du salaire, vous pouvez utiliser `MV_AVG` pour faire la moyenne des multiples valeurs par employé, et utiliser le résultat avec la fonction `AVG` :\n\n````\nFROM employees\n| STATS avg_salary_change = AVG(MV_AVG(salary_change))\n````\n\nLe regroupement par expression est par exemple le regroupement des employés en fonction de la première lettre de leur nom de famille :\n\n````\nFROM employees\n| STATS my_count = COUNT() BY LEFT(last_name, 1)\n| SORT \"LEFT(last_name, 1)\"\n````\n\nIl n'est pas obligatoire d'indiquer le nom de la colonne de sortie. S'il n'est pas spécifié, le nouveau nom de la colonne est égal à l'expression. La requête suivante renvoie une colonne appelée `AVG(salary)` :\n\n````\nFROM employees\n| STATS AVG(salary)\n````\n\nComme ce nom contient des caractères spéciaux, il doit être placé entre deux caractères (`) lorsqu'il est utilisé dans des commandes suivantes :\n\n````\nFROM employees\n| STATS AVG(salary)\n| EVAL avg_salary_rounded = ROUND(\"AVG(salary)\")\n````\n\n**Remarque** : `STATS` sans aucun groupe est beaucoup plus rapide que l'ajout d'un groupe.\n\n**Remarque** : Le regroupement sur une seule expression est actuellement beaucoup plus optimisé que le regroupement sur plusieurs expressions.\n ", - "languageDocumentationPopover.documentationESQL.stCentroidFunction": "ST_CENTROID_AGG", - "languageDocumentationPopover.documentationESQL.stCentroidFunction.markdown": "### ST_CENTROID_AGG\n**AVERTISSEMENT : Cette fonctionnalité est en version d'évaluation technique et pourra être modifiée ou supprimée dans une future version. Elastic s'efforcera de corriger tout problème éventuel, mais les fonctionnalités des versions d'évaluation technique ne sont pas soumises aux accords de niveau de service (SLA) d'assistance des fonctionnalités officielles en disponibilité générale.**\n\nCalcule le centroïde spatial sur un champ avec un type de géométrie de point spatial.\n\n````\nAéroports FROM\n| STATS centroid=ST_CENTROID_AGG(location)\n````\n ", "languageDocumentationPopover.documentationESQL.stringOperators": "LIKE et RLIKE", "languageDocumentationPopover.documentationESQL.stringOperators.markdown": "### LIKE et RLIKE\nPour comparer des chaînes en utilisant des caractères génériques ou des expressions régulières, utilisez `LIKE` ou `RLIKE` :\n\nUtilisez `LIKE` pour faire correspondre des chaînes à l'aide de caractères génériques. Les caractères génériques suivants sont pris en charge :\n\n* `*` correspond à zéro caractère ou plus.\n* `?` correspond à un seul caractère.\n\n````\nFROM employees\n| WHERE first_name LIKE \"?b*\"\n| KEEP first_name, last_name\n````\n\nUtilisez `RLIKE` pour faire correspondre des chaînes à l'aide d'expressions régulières :\n\n````\nFROM employees\n| WHERE first_name RLIKE \".leja.*\"\n| KEEP first_name, last_name\n````\n ", "languageDocumentationPopover.documentationESQL.substring": "SUBSTRING", "languageDocumentationPopover.documentationESQL.substring.markdown": "\n\n ### SUBSTRING\n Renvoie la sous-chaîne d'une chaîne, délimitée en fonction d'une position de départ et d'une longueur facultative\n\n ````\n FROM employees\n | KEEP last_name\n | EVAL ln_sub = SUBSTRING(last_name, 1, 3)\n ````\n ", - "languageDocumentationPopover.documentationESQL.sumFunction": "SUM", - "languageDocumentationPopover.documentationESQL.sumFunction.markdown": "### SUM\nRenvoie la somme d'un champ numérique.\n\n````\nFROM employees\n| STATS SUM(languages)\n````\n\nCette expression peut utiliser des fonctions alignées. Par exemple, pour calculer la somme de l'évolution de salaire maximale de chaque employé, appliquez la fonction `MV_MAX` à chaque ligne et additionnez les résultats (`SUM`) :\n\n````\nFROM employees\n| STATS total_salary_changes = SUM(MV_MAX(salary_change))\n````\n ", "languageDocumentationPopover.documentationESQL.tan": "TAN", "languageDocumentationPopover.documentationESQL.tan.markdown": "\n\n ### TAN\n Renvoie la fonction trigonométrique Tangente d'un angle.\n\n ````\n ROW a=1.8 \n | EVAL tan=TAN(a)\n ````\n ", "languageDocumentationPopover.documentationESQL.tanh": "TANH", @@ -7434,8 +7414,6 @@ "languageDocumentationPopover.documentationESQL.to_version.markdown": "\n\n ### TO_VERSION\n Convertit une chaîne d'entrée en une valeur de version.\n\n ````\n ROW v = TO_VERSION(\"1.2.3\")\n ````\n ", "languageDocumentationPopover.documentationESQL.trim": "TRIM", "languageDocumentationPopover.documentationESQL.trim.markdown": "\n\n ### TRIM\n Supprime les espaces de début et de fin d'une chaîne.\n\n ````\n ROW message = \" some text \", color = \" red \"\n | EVAL message = TRIM(message)\n | EVAL color = TRIM(color)\n ````\n ", - "languageDocumentationPopover.documentationESQL.valuesFunction": "VALEURS", - "languageDocumentationPopover.documentationESQL.valuesFunction.markdown": "### VALEURS\n\n**AVERTISSEMENT : N’utilisez pas `VALUES` dans les environnements de production. Cette fonctionnalité est en version d'évaluation technique et pourra être modifiée ou supprimée dans une future version. Elastic s'efforcera de corriger tout problème éventuel, mais les fonctionnalités des versions d'évaluation technique ne sont pas soumises aux accords de niveau de service (SLA) d'assistance des fonctionnalités officielles en disponibilité générale.**\n\nRenvoie toutes les valeurs d’un groupe dans un champ multivalué. L'ordre des valeurs renvoyées n'est pas garanti. Si vous avez besoin que les valeurs renvoyées soient dans l'ordre, utilisez `MV_SORT`.\n\nAccepte une expression de n'importe quel type, sauf `geo_point`, `cartesian_point`, `geo_shape` ou `cartesian_shape`.\n\n\nExemple :\n\n````\n FROM employees\n| EVAL first_letter = SUBSTRING(first_name, 0, 1)\n| STATS first_name=MV_SORT(VALUES(first_name)) BY first_letter\n| SORT first_letter\n````\n\n> _**AVERTISSEMENT :** Ceci peut utiliser une quantité importante de mémoire et ES|QL ne développe pas encore les agrégations au-delà de la mémoire. Cette agrégation fonctionnera donc jusqu'à ce qu'elle soit utilisée pour collecter plus de valeurs que la mémoire ne peut en contenir. Lorsque le nombre de valeurs collectées est trop élevé, la requête échoue avec un message d'erreur de type [Circuit Breaker Error](https://www.elastic.co/guide/en/elasticsearch/reference/current/circuit-breaker-errors.html)._\n\n ", "languageDocumentationPopover.documentationESQL.where": "WHERE", "languageDocumentationPopover.documentationESQL.where.markdown": "### WHERE\nUtilisez `WHERE` afin d'obtenir un tableau qui comprend toutes les lignes du tableau d'entrée pour lesquelles la condition fournie est évaluée à `true` :\n \n````\nFROM employees\n| KEEP first_name, last_name, still_hired\n| WHERE still_hired == true\n````\n\n#### Opérateurs\n\nPour obtenir un aperçu des opérateurs pris en charge, consultez la section **Opérateurs**.\n\n#### Fonctions\n`WHERE` prend en charge diverses fonctions de calcul des valeurs. Pour en savoir plus, consultez la section **Fonctions**.\n ", "textBasedEditor.query.textBasedLanguagesEditor.EnableWordWrapLabel": "Ajouter des sauts de ligne aux barres verticales", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 7d6667bd928558..2101d7f878cd53 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -7197,8 +7197,6 @@ "languageDocumentationPopover.documentationESQL.atan2.markdown": "\n\n ### ATAN2\n 直交平面上の原点から点(x , y)に向かう光線と正のx軸のなす角(ラジアン表記)。\n \n\n ```\n ROW y=12.9, x=.6\n | EVAL atan2=ATAN2(y, x)\n ```\n ", "languageDocumentationPopover.documentationESQL.autoBucketFunction": "BUCKET", "languageDocumentationPopover.documentationESQL.autoBucketFunction.markdown": "### バケット\n日時または数値入力から、値(バケット)のグループを作成します。バケットのサイズは直接指定するか、推奨される数と値の範囲に基づいて選択できます。\n\nBUCKETは次の2つのモードで動作します。\n\n1.バケットのサイズがバケット数の提案(4つのパラメーター)と範囲に基づいて計算される。\n2.バケットサイズが直接指定される(2つのパラメーター)。\n\n目標バケット数、開始日、終了日を使用すると、目標バケット数以下のバケットを生成するために適切なバケットサイズがBUCKETによって選択されます。\n\nたとえば、1年に最大20バケットをリクエストすると、データが1か月間隔で整理されます。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT hire_date\n```\n\n**注**:ここでは、正確な目標バケット数を指定するのではなく、目標バケット数を_上限_として範囲を指定します。\n\nBUCKETを集約と組み合わせ、ヒストグラムを作成できます。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_month = COUNT(*) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT month\n```\n\n**注**:BUCKETは、どのドキュメントにも一致しないバケットを作成しません。そのため、前の例では1985-03-01やその他の日付が抜けています。\n\nその他のバケットを要求すると、範囲が小さくなることがあります。たとえば、1年に最大100バケットをリクエストすると、1週間単位のバケットになります。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 100, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT week\n```\n\n**注**:AUTO_BUCKETは行をフィルタリングしません。指定された範囲のみを使用して、適切なバケットサイズを選択します。範囲外の値の行に対しては、範囲外のバケツに対応するバケット値を返します。行をフィルタリングするには、BUCKETとWHEREを組み合わせます。\n\n事前に任意のバケットサイズがわかっている場合は、2番目の引数として指定し、範囲を除外します。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 1 week)\n| SORT week\n```\n\n**注**:バケットサイズを2番目のパラメーターとして指定するときには、時間の期間または日付の期間を選択する必要があります。\n\nBUCKETは数値フィールドでも動作します。たとえば、給与ヒストグラムを作成します。\n\n```\nFROM employees\n| STATS COUNT(*) by bs = BUCKET(salary, 20, 25324, 74999)\n| SORT bs\n```\n\n日付範囲で意図的フィルタリングする前の例とは異なり、数値フィールドでフィルタリングすることはほとんどありません。最小値と最大値を別々に見つける必要があります。ES|QLにはそれを自動的に実行するための簡単な方法がありません。\n\n任意のバケットサイズが事前にわかっている場合は、範囲を省略できます。2番目の引数として指定します。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS c = COUNT(1) BY b = BUCKET(salary, 5000.)\n| SORT b\n```\n\n**注**:バケットサイズを2番目のパラメーターとして指定するときには、**浮動小数点数型**でなければなりません。\n\n次の例は、過去24時間の1時間単位のバケットを作成し、1時間当たりのイベント数を計算します。\n\n```\nFROM sample_data\n| WHERE @timestamp >= NOW() - 1 day and @timestamp < NOW()\n| STATS COUNT(*) BY bucket = BUCKET(@timestamp, 25, NOW() - 1 day, NOW())\n```\n\n次の例は、1985年の1か月単位のバケットを作成し、採用月別に平均給与を計算します。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS AVG(salary) BY bucket = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT bucket\n```\n\n集約部で関数が**グループ部で定義されたエイリアスによって参照されている**場合、またはまったく同じ式で呼び出されている場合、BUCKETは、 STATS …​ BY …コマンドの集約部とグループ部の両方で使用できます。\n\n例:\n\n```\nFROM employees\n| STATS s1 = b1 + 1, s2 = BUCKET(salary / 1000 + 999, 50.) + 2 BY b1 = BUCKET(salary / 100 + 99, 50.), b2 = BUCKET(salary / 1000 + 999, 50.)\n| SORT b1, b2\n| KEEP s1, b1, s2, b2\n```\n ", - "languageDocumentationPopover.documentationESQL.avgFunction": "AVG", - "languageDocumentationPopover.documentationESQL.avgFunction.markdown": "### AVG\n数値フィールドの平均を返します。\n\n```\nFROM employees\n| STATS AVG(height)\n```\n\n式はインライン関数を使用できます。たとえば、複数値列で平均を計算するには、まず、MV_AVGを使用して行ごとに複数の値の平均を求め、その結果にAVG関数を適用します。\n\n```\nFROM employees\n| STATS avg_salary_change = AVG(MV_AVG(salary_change))\n```\n ", "languageDocumentationPopover.documentationESQL.binaryOperators": "バイナリ演算子", "languageDocumentationPopover.documentationESQL.binaryOperators.markdown": "### バイナリ演算子\n次のバイナリ比較演算子がサポートされています。\n\n* 等号:`==`\n* 不等号:`!=`\n* より小さい:`<`\n* 以下:`<=`\n* より大きい:`>`\n* 以上:`>=`\n* 加算:`+`\n* 減算:`-`\n* 乗算:`*`\n* 除算:`/`\n* 係数:`%`\n ", "languageDocumentationPopover.documentationESQL.booleanOperators": "ブール演算子", @@ -7223,10 +7221,6 @@ "languageDocumentationPopover.documentationESQL.cos.markdown": "\n\n ### COS\n 角度の余弦を返します。\n\n ```\n ROW a=1.8 \n | EVAL cos=COS(a)\n ```\n ", "languageDocumentationPopover.documentationESQL.cosh": "COSH", "languageDocumentationPopover.documentationESQL.cosh.markdown": "\n\n ### COSH\n 角度の双曲余弦を返します。\n\n ```\n ROW a=1.8 \n | EVAL cosh=COSH(a)\n ```\n ", - "languageDocumentationPopover.documentationESQL.countDistinctFunction": "COUNT_DISTINCT", - "languageDocumentationPopover.documentationESQL.countDistinctFunction.markdown": "### COUNT_DISTINCT\n異なる値のおおよその数をカウントします。\n\n```\nFROM hosts\n| STATS COUNT_DISTINCT(ip0), COUNT_DISTINCT(ip1)\n```\n\nCOUNT_DISTINCT関数はHyperLogLog++アルゴリズムに基づく近似関数です。詳細については、[ドキュメント](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-cardinality-aggregation.html#_counts_are_approximate)を参照してください。精度は、オプションの2番目のパラメーターを使って設定できます。サポートされている最大値は40000です。この数値を超えたしきい値は、しきい値40000と同じ結果になります。デフォルト値は3000です。\n\n```\nFROM hosts\n| STATS COUNT_DISTINCT(ip0, 80000), COUNT_DISTINCT(ip1, 5)\n```\n\n式はインライン関数を使用できます。この例では、SPLIT関数を使用して、複数の値を分割し、一意の値をカウントします。\n\n```\nROW words=\"foo;bar;baz;qux;quux;foo\"\n| STATS distinct_word_count = COUNT_DISTINCT(SPLIT(words, \";\"))\n```\n ", - "languageDocumentationPopover.documentationESQL.countFunction": "COUNT", - "languageDocumentationPopover.documentationESQL.countFunction.markdown": "### COUNT\n入力値の合計数(カウント)が返されます。\n\n```\nFROM employees\n| STATS COUNT(height)\n```\n\n任意のフィールドを入力として渡すことができます。\n\n行数をカウントするには、`COUNT()`または`COUNT(*)`を使用します。\n\n```\nFROM employees\n| STATS count = COUNT(*) BY languages\n| SORT languages DESC\n```\n\n式はインライン関数を使用できます。この例では、SPLIT関数を使用して、複数の値を分割し、値をカウントします。\n\n```\nROW words=\"foo;bar;baz;qux;quux;foo\"\n| STATS word_count = COUNT(SPLIT(words, \";\"))\n```\n ", "languageDocumentationPopover.documentationESQL.date_diff": "DATE_DIFF", "languageDocumentationPopover.documentationESQL.date_diff.markdown": "\n\n ### DATE_DIFF\n startTimestampをendTimestampから減算し、unitの乗数の差を返します。\n startTimestampがendTimestampより後の場合は、負の値が返されます。\n\n ```\n ROW date1 = TO_DATETIME(\"2023-12-02T11:00:00.000Z\"), date2 = TO_DATETIME(\"2023-12-02T11:00:00.001Z\")\n | EVAL dd_ms = DATE_DIFF(\"microseconds\", date1, date2)\n ```\n ", "languageDocumentationPopover.documentationESQL.date_extract": "DATE_EXTRACT", @@ -7282,14 +7276,6 @@ "languageDocumentationPopover.documentationESQL.ltrim": "LTRIM", "languageDocumentationPopover.documentationESQL.ltrim.markdown": "\n\n ### LTRIM\n 文字列から先頭の空白を取り除きます。\n\n ```\n ROW message = \" some text \", color = \" red \"\n | EVAL message = LTRIM(message)\n | EVAL color = LTRIM(color)\n | EVAL message = CONCAT(\"'\", message, \"'\")\n | EVAL color = CONCAT(\"'\", color, \"'\")\n ```\n ", "languageDocumentationPopover.documentationESQL.markdown": "## ES|QL\n\nES|QL(Elasticsearch クエリー言語)クエリーは、パイプ文字の|で区切られた一連のコマンドで構成されます。各クエリーは**ソースコマンド**で始まり、通常はElasticsearchのデータを使ってテーブルを生成します。\n\nソースコマンドには、1つ以上の**処理コマンド**を続けることができます。処理コマンドは、行や列を追加、削除、変更することで、前のコマンドの出力テーブルを変更することができます。\n\n```\nsource-command\n| processing-command1\n| processing-command2\n```\n\nクエリーの結果は、最終的な処理コマンドによって生成されるテーブルです。 \n ", - "languageDocumentationPopover.documentationESQL.maxFunction": "MAX", - "languageDocumentationPopover.documentationESQL.maxFunction.markdown": "### MAX\n数値式の最大値を返します。\n\n```\nFROM employees\n| STATS MAX(languages)\n```\n\n式はインライン関数を使用できます。たとえば、複数値列の平均に対して最大値を計算するには、まず、MV_AVGを使用して行ごとに複数の値の平均を求め、その結果にMAX関数を適用します。\n\n```\nFROM employees\n| STATS max_avg_salary_change = MAX(MV_AVG(salary_change))\n```\n ", - "languageDocumentationPopover.documentationESQL.medianAbsoluteDeviationFunction": "MEDIAN_ABSOLUTE_DEVIATION", - "languageDocumentationPopover.documentationESQL.medianAbsoluteDeviationFunction.markdown": "### MEDIAN_ABSOLUTE_DEVIATION\n絶対偏差の中央値で、ばらつきを表す指標を返します。これはロバスト統計量であり、外れ値があったり、正規分布していない可能性があるデータを説明するのに有用です。このようなデータでは、標準偏差よりもわかりやすくなります。\n\nこれは、サンプル全体の中央値からの各データポイントの偏差の中央値として計算されます。つまり、確率変数Xに対して、絶対偏差の中央値はmedian(|median(X) - X|)です。\n\n```\nFROM employees\n| STATS MEDIAN(salary), MEDIAN_ABSOLUTE_DEVIATION(salary)\n```\n\n注:PERCENTILEと同様に、通常、MEDIAN_ABSOLUTE_DEVIATIONはTDigestアルゴリズムに基づく近似値です。MEDIAN_ABSOLUTE_DEVIATIONも非決定論的です。つまり、同じデータでも微妙に異なる結果が得られる可能性があります。\n\n式はインライン関数を使用できます。たとえば、複数値列の最大値の中央絶対偏差を計算するには、まず、MV_MAXを使用して行ごとの最大値を取得し、その結果に対してMEDIAN_ABSOLUTE_DEVIATION関数を使用します。\n\n```\nFROM employees\n| STATS m_a_d_max_salary_change = MEDIAN_ABSOLUTE_DEVIATION(MV_MAX(salary_change))\n```\n\n", - "languageDocumentationPopover.documentationESQL.medianFunction": "MEDIAN", - "languageDocumentationPopover.documentationESQL.medianFunction.markdown": "### MEDIAN\n全数値の半分より大きく、全数値の半分より小さい値で、50%パーセンタイルとも呼ばれる値を返します。\n\n**注:**PERCENTILEと同様に、通常MEDIANはTDigestアルゴリズムに基づく近似値です。\n\n**警告:** MEDIANは[非決定性](https://en.wikipedia.org/wiki/Nondeterministic_algorithm)です。つまり、同じデータでも微妙に異なる結果が得られる可能性があります。\n\n例:\n\n```\nFROM employees\n| STATS MEDIAN(salary), PERCENTILE(salary, 50)\n```\n\n式はインライン関数を使用できます。たとえば、複数値列の最大値の中央値を計算するには、まず、MV_MAXを使用して行ごとに最大値を求め、その結果にMEDIAN関数を適用します。\n\n```\nFROM employees\n| STATS median_max_salary_change = MEDIAN(MV_MAX(salary_change))\n```\n ", - "languageDocumentationPopover.documentationESQL.minFunction": "MIN", - "languageDocumentationPopover.documentationESQL.minFunction.markdown": "### MIN\n数値フィールドの最小値を返します。\n\n```\nFROM employees\n| STATS MIN(languages)\n```\n\n式はインライン関数を使用できます。たとえば、複数値列の平均に対して最小値を計算するには、まず、MV_AVGを使用して行ごとに複数の値の平均を求め、その結果にMIN関数を適用します。\n\n```\nFROM employees\n| STATS min_avg_salary_change = MIN(MV_AVG(salary_change))\n```\n ", "languageDocumentationPopover.documentationESQL.mv_append": "MV_APPEND", "languageDocumentationPopover.documentationESQL.mv_append.markdown": "\n\n ### MV_APPEND\n 2つの複数値フィールドの値を連結します\n\n ", "languageDocumentationPopover.documentationESQL.mv_avg": "MV_AVG", @@ -7322,8 +7308,6 @@ "languageDocumentationPopover.documentationESQL.mvExpand.markdown": "### MV_EXPAND\nMV_EXPAND処理コマンドは、複数値フィールドを値ごとに1行に展開し、他のフィールドを複製します。 \n```\nROW a=[1,2,3], b=\"b\", j=[\"a\",\"b\"]\n| MV_EXPAND a\n```\n ", "languageDocumentationPopover.documentationESQL.now": "NOW", "languageDocumentationPopover.documentationESQL.now.markdown": "\n\n ### NOW\n 現在の日付と時刻を返します。\n\n ```\n ROW current_date = NOW()\n ```\n ", - "languageDocumentationPopover.documentationESQL.percentileFunction": "PERCENTILE", - "languageDocumentationPopover.documentationESQL.percentileFunction.markdown": "### PERCENTILE\n観測値の特定の割合で発生する値。たとえば、95パーセンタイルは観測値の95%より大きい値で、50パーセンタイルはMEDIAN`です。\n\n```\nFROM employees\n| STATS p0 = PERCENTILE(salary, 0)\n , p50 = PERCENTILE(salary, 50)\n , p99 = PERCENTILE(salary, 99)\n```\n\n**注**:PERCENTILEは通常TDigestアルゴリズムに基づく近似値です。\n\n**警告:**PERCENTILEは[非決定性](https://en.wikipedia.org/wiki/Nondeterministic_algorithm)です。つまり、同じデータでも微妙に異なる結果が得られる可能性があります。\n\n式はインライン関数を使用できます。たとえば、複数値列の最大値のパーセンタイルを計算するには、まず、MV_MAXを使用して行ごとの最大値を取得し、その結果に対してMEDIAN_ABSOLUTE_DEVIATION関数を使用します。\n\n```\nFROM employees\n| STATS p80_max_salary_change = PERCENTILE(MV_MAX(salary_change), 80)\n```\n ", "languageDocumentationPopover.documentationESQL.pi": "PI", "languageDocumentationPopover.documentationESQL.pi.markdown": "\n\n ### PI\n 円の円周と直径の比率であるPiを返します。\n\n ```\n ROW PI()\n ```\n ", "languageDocumentationPopover.documentationESQL.pow": "POW", @@ -7376,14 +7360,10 @@ "languageDocumentationPopover.documentationESQL.starts_with.markdown": "\n\n ### STARTS_WITH\n キーワード文字列が他の文字列で始まるかどうかを示すブール値を返します。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL ln_S = STARTS_WITH(last_name, \"B\")\n ```\n ", "languageDocumentationPopover.documentationESQL.statsby": "STATS ...BY", "languageDocumentationPopover.documentationESQL.statsby.markdown": "### STATS ...BY\nSTATS ...BYを使用すると、共通の値に従って行をグループ化し、グループ化された行に対する1つ以上の集約値を計算します。\n\n**例**:\n\n```\nFROM employees\n| STATS count = COUNT(emp_no) BY languages\n| SORT languages\n```\n\nBYが省略された場合、出力テーブルには、データセット全体に適用された集約が正確に1行だけ含まれます。\n\n```\nFROM employees\n| STATS avg_lang = AVG(languages)\n```\n\n複数の値を計算することができます。\n\n```\nFROM employees\n| STATS avg_lang = AVG(languages), max_lang = MAX(languages)\n```\n\n複数の値でグループ化することも可能です(longおよびkeywordファミリーフィールドでのみサポート)。\n\n```\nFROM employees\n| EVAL hired = DATE_FORMAT(hire_date, \"YYYY\")\n| STATS avg_salary = AVG(salary) BY hired, languages.long\n| EVAL avg_salary = ROUND(avg_salary)\n| SORT hired, languages.long\n```\n\nSTATS ...BYで使用できる関数の一覧については、**集計関数**を参照してください。\n\n集計関数とグループ式の両方で他の関数を使用できます。これは、複数値列でSTATS...BYを使用するときに有用です。たとえば、平均給与変動を計算するには、まず、MV_AVGを使用して従業員ごとに複数の値の平均を求め、その結果にAVG関数を適用します。\n\n```\nFROM employees\n| STATS avg_salary_change = AVG(MV_AVG(salary_change))\n```\n\n式によるグループ化の例は、姓の最初の文字で従業員をグループ化することです。\n\n```\nFROM employees\n| STATS my_count = COUNT() BY LEFT(last_name, 1)\n| SORT `LEFT(last_name, 1)`\n```\n\n出力列名の指定は任意です。指定しない場合は、新しい列名が式と等しくなります。次のクエリーは列\"AVG(salary)\"を返します。\n\n```\nFROM employees\n| STATS AVG(salary)\n```\n\nこの名前には特殊文字が含まれているため、後続のコマンドで使用するときには、バッククオート(`)で囲む必要があります。\n\n```\nFROM employees\n| STATS AVG(salary)\n| EVAL avg_salary_rounded = ROUND(`AVG(salary)`)\n```\n\n**注**:グループなしのSTATSは、グループを追加するよりも大幅に高速です。\n\n**注**:単一式でのグループは、現在、複数式でのグループよりも大幅に最適化されています。\n ", - "languageDocumentationPopover.documentationESQL.stCentroidFunction": "ST_CENTROID_AGG", - "languageDocumentationPopover.documentationESQL.stCentroidFunction.markdown": "### ST_CENTROID_AGG\n**警告:この機能はテクニカルプレビュー中であり、将来のリリースでは変更されたり削除されたりする場合があります。Elasticはすべての問題の修正に努めますが、テクニカルプレビュー中の機能には正式なGA機能のサポートSLAが適用されません。**\n\n空間点ジオメトリタイプのフィールドで、空間中心を計算します。\n\n```\nFROM airports\n| STATS centroid=ST_CENTROID_AGG(location)\n```\n ", "languageDocumentationPopover.documentationESQL.stringOperators": "LIKEおよびRLIKE", "languageDocumentationPopover.documentationESQL.stringOperators.markdown": "### LIKEおよびRLIKE\nワイルドカードや正規表現を使った文字列比較にはLIKEまたはRLIKEを使います。\n\nワイルドカードを使って文字列を一致させるにはLIKEを使います。次のワイルドカード文字がサポートされています。\n\n* `*`は0文字以上と一致します。\n* `?`は1文字と一致します。\n\n```\nFROM employees\n| WHERE first_name LIKE \"?b*\"\n| KEEP first_name, last_name\n```\n\n正規表現を使って文字列を一致させるには、RLIKEを使います。\n\n```\nFROM employees\n| WHERE first_name RLIKE \".leja.*\"\n| KEEP first_name, last_name\n```\n ", "languageDocumentationPopover.documentationESQL.substring": "SUBSTRING", "languageDocumentationPopover.documentationESQL.substring.markdown": "\n\n ### SUBSTRING\n 文字列のサブ文字列を、開始位置とオプションの長さで指定して返します。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL ln_sub = SUBSTRING(last_name, 1, 3)\n ```\n ", - "languageDocumentationPopover.documentationESQL.sumFunction": "SUM", - "languageDocumentationPopover.documentationESQL.sumFunction.markdown": "### SUM\n数値フィールドの合計を返します。\n\n```\nFROM employees\n| STATS SUM(languages)\n```\n\n式はインライン関数を使用できます。たとえば、各従業員の最大給与変動の総計を計算するには、MV_MAX関数を各行に適用してから、その結果にSUMを適用します。\n\n```\nFROM employees\n| STATS total_salary_changes = SUM(MV_MAX(salary_change))\n```\n ", "languageDocumentationPopover.documentationESQL.tan": "TAN", "languageDocumentationPopover.documentationESQL.tan.markdown": "\n\n ### TAN\n 角度の正接三角関数を返します。\n\n ```\n ROW a=1.8 \n | EVAL tan=TAN(a)\n ```\n ", "languageDocumentationPopover.documentationESQL.tanh": "TANH", @@ -7428,8 +7408,6 @@ "languageDocumentationPopover.documentationESQL.to_version.markdown": "\n\n ### TO_VERSION\n 入力文字列をバージョン値に変換します。\n\n ```\n ROW v = TO_VERSION(\"1.2.3\")\n ```\n ", "languageDocumentationPopover.documentationESQL.trim": "TRIM", "languageDocumentationPopover.documentationESQL.trim.markdown": "\n\n ### TRIM\n 文字列から先頭と末尾の空白を削除します。\n\n ```\n ROW message = \" some text \", color = \" red \"\n | EVAL message = TRIM(message)\n | EVAL color = TRIM(color)\n ```\n ", - "languageDocumentationPopover.documentationESQL.valuesFunction": "VALUES", - "languageDocumentationPopover.documentationESQL.valuesFunction.markdown": "### 値\n\n**警告:本番環境ではVALUESを使用しないでください。この機能はテクニカルプレビュー中であり、将来のリリースでは変更されたり削除されたりする場合があります。Elasticはすべての問題の修正に努めますが、テクニカルプレビュー中の機能には正式なGA機能のサポートSLAが適用されません。**\n\nグループのすべての値を複数値フィールドとして返します。返された値の順序は保証されません。返された値を並べ替える必要がある場合はMV_SORTを使用します。\n\ngeo_point、cartesian_point、geo_shape、またはcartesian_shapeを除く任意のタイプの式を使用できます。\n\n\n例:\n\n```\n FROM employees\n| EVAL first_letter = SUBSTRING(first_name, 0, 1)\n| STATS first_name=MV_SORT(VALUES(first_name)) BY first_letter\n| SORT first_letter\n```\n\n> _**警告:** これはメモリの使用量が非常に大きくなるため、ES|QLはメモリを超えると、集約を拡大しません。このため、この集約は、収集する値がメモリに収まらなくなるまでは機能します。収集する値が多くなりすぎると、[回路ブレーカーエラー](https://www.elastic.co/guide/en/elasticsearch/reference/current/circuit-breaker-errors.html)でクエリが失敗します。_\n\n ", "languageDocumentationPopover.documentationESQL.where": "WHERE", "languageDocumentationPopover.documentationESQL.where.markdown": "### WHERE\nWHEREを使用すると、入力テーブルから、指定した条件がtrueと評価されるすべての行を含むテーブルを作成します。\n \n```\nFROM employees\n| KEEP first_name, last_name, still_hired\n| WHERE still_hired == true\n```\n\n#### 演算子\n\nサポートされている演算子の概要については、**演算子**を参照してください。\n\n#### 関数\nWHEREは値を計算するためのさまざまな関数をサポートしています。**関数**をクリックすると詳細が表示されます。\n ", "textBasedEditor.query.textBasedLanguagesEditor.EnableWordWrapLabel": "パイプの改行を追加", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 9f317718564673..f78933b76eb5af 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -7210,8 +7210,6 @@ "languageDocumentationPopover.documentationESQL.atan2.markdown": "\n\n ### ATAN2\n 笛卡儿平面中正 x 轴\n 与从原点到点 (x , y) 构成的射线之间的角度,以弧度表示。\n\n ```\n ROW y=12.9, x=.6\n | EVAL atan2=ATAN2(y, x)\n ```\n ", "languageDocumentationPopover.documentationESQL.autoBucketFunction": "BUCKET", "languageDocumentationPopover.documentationESQL.autoBucketFunction.markdown": "### BUCKET\n用日期时间或数字输入创建值(存储桶)的分组。存储桶的大小可以直接提供,或基于建议的计数和值范围进行选择。\n\n`BUCKET` 以两种模式运行:\n\n1.在此模式下基于存储桶计数建议(四个参数)和范围计算存储桶的大小。\n2.在此模式下直接提供存储桶大小(两个参数)。\n\n使用存储桶的目标数量、起始范围和结束范围,`BUCKET` 将选取适当的存储桶大小以生成目标数量或更小数量的存储桶。\n\n例如,一年请求多达 20 个存储桶会按每月时间间隔组织数据:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT hire_date\n```\n\n**注意**:目标并不是提供存储桶的确切目标数量,而是选择一个范围,最多提供存储桶的目标数量。\n\n可以组合 `BUCKET` 与聚合以创建直方图:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_month = COUNT(*) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT month\n```\n\n**注意**:`BUCKET` 不会创建未匹配任何文档的存储桶。因此,上一示例缺少 `1985-03-01` 和其他日期。\n\n如果需要更多存储桶,可能导致更小的范围。例如,如果一年内最多请求 100 个存储桶,会导致周期为周的存储桶:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 100, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT week\n```\n\n**注意**:`AUTO_BUCKET` 不筛选任何行。它只会使用提供的范围来选取适当的存储桶大小。对于值超出范围的行,它会返回与超出范围的存储桶对应的存储桶值。组合 `BUCKET` 与 `WHERE` 可筛选行。\n\n如果提前已知所需存储桶大小,则只需提供它作为第二个参数,而忽略范围:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 1 week)\n| SORT week\n```\n\n**注意**:提供存储桶大小作为第二个参数时,它必须为持续时间或日期期间。\n\n`BUCKET` 还可对数字字段执行操作。例如,要创建工资直方图:\n\n```\nFROM employees\n| STATS COUNT(*) by bs = BUCKET(salary, 20, 25324, 74999)\n| SORT bs\n```\n\n与前面的有意筛选日期范围示例不同,您极少想要筛选数值范围。您必须分别查找最小值和最大值。ES|QL 尚未提供简便方法来自动执行此操作。\n\n如果提前已知所需存储桶大小,则可以忽略该范围。只需提供它作为第二个参数即可:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS c = COUNT(1) BY b = BUCKET(salary, 5000.)\n| SORT b\n```\n\n**注意**:提供存储桶大小作为第二个参数时,它必须为 **浮点类型**。\n\n这里提供了一个示例,用于为过去 24 小时创建小时存储桶,并计算每小时的事件数:\n\n```\nFROM sample_data\n| WHERE @timestamp >= NOW() - 1 day and @timestamp < NOW()\n| STATS COUNT(*) BY bucket = BUCKET(@timestamp, 25, NOW() - 1 day, NOW())\n```\n\n这里提供了一个示例,用于为 1985 年创建月度存储桶,并按聘用月份计算平均工资:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS AVG(salary) BY bucket = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT bucket\n```\n\n`BUCKET` 可用在 `STATS …​ BY …`​ 命令的聚合和分组部分, 前提是在聚合部分中,该函数 **由在分组部分中定义的别名引用**,或使用完全相同的表达式调用。\n\n例如:\n\n```\nFROM employees\n| STATS s1 = b1 + 1, s2 = BUCKET(salary / 1000 + 999, 50.) + 2 BY b1 = BUCKET(salary / 100 + 99, 50.), b2 = BUCKET(salary / 1000 + 999, 50.)\n| SORT b1, b2\n| KEEP s1, b1, s2, b2\n```\n ", - "languageDocumentationPopover.documentationESQL.avgFunction": "AVG", - "languageDocumentationPopover.documentationESQL.avgFunction.markdown": "### AVG\n返回数字字段的平均值。\n\n```\nFROM employees\n| STATS AVG(height)\n```\n\n此表达式可使用内联函数。例如,要计算一个多值列的平均值,应首先使用 `MV_AVG` 对每行的多个值求平均值,然后将结果用于 `AVG` 函数:\n\n```\nFROM employees\n| STATS avg_salary_change = AVG(MV_AVG(salary_change))\n```\n ", "languageDocumentationPopover.documentationESQL.binaryOperators": "二进制运算符", "languageDocumentationPopover.documentationESQL.binaryOperators.markdown": "### 二进制运算符\n支持这些二进制比较运算符:\n\n* 等于:`==`\n* 不等于:`!=`\n* 小于:`<`\n* 小于或等于:`<=`\n* 大于:`>`\n* 大于或等于:`>=`\n* 加:`+`\n* 减:`-`\n* 乘:`*`\n* 除:`/`\n* 取模:`%`\n ", "languageDocumentationPopover.documentationESQL.booleanOperators": "布尔运算符", @@ -7236,10 +7234,6 @@ "languageDocumentationPopover.documentationESQL.cos.markdown": "\n\n ### COS\n 返回角度的余弦。\n\n ```\n ROW a=1.8 \n | EVAL cos=COS(a)\n ```\n ", "languageDocumentationPopover.documentationESQL.cosh": "COSH", "languageDocumentationPopover.documentationESQL.cosh.markdown": "\n\n ### COSH\n 返回角度的双曲余弦。\n\n ```\n ROW a=1.8 \n | EVAL cosh=COSH(a)\n ```\n ", - "languageDocumentationPopover.documentationESQL.countDistinctFunction": "COUNT_DISTINCT", - "languageDocumentationPopover.documentationESQL.countDistinctFunction.markdown": "### COUNT_DISTINCT\n对不同值的近似数进行计数。\n\n```\nFROM hosts\n| STATS COUNT_DISTINCT(ip0), COUNT_DISTINCT(ip1)\n```\n\n`COUNT_DISTINCT` 函数为基于 HyperLogLog++ 算法的近似计算。请参阅此[文档](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-cardinality-aggregation.html#_counts_are_approximate)了解更多信息。精确度可使用可选的第二个参数进行配置。支持的最大值为 40000。高于此数字的阈值与阈值 40000 的效果相同。默认值为 3000。\n\n```\nFROM hosts\n| STATS COUNT_DISTINCT(ip0, 80000), COUNT_DISTINCT(ip1, 5)\n```\n\n此表达式可使用内联函数。此示例会使用 `SPLIT` 函数将字符串拆分成多个值,并对唯一值进行计数:\n\n```\nROW words=\"foo;bar;baz;qux;quux;foo\"\n| STATS distinct_word_count = COUNT_DISTINCT(SPLIT(words, \";\"))\n```\n ", - "languageDocumentationPopover.documentationESQL.countFunction": "COUNT", - "languageDocumentationPopover.documentationESQL.countFunction.markdown": "### COUNT\n返回输入值的总数(计数)。\n\n```\nFROM employees\n| STATS COUNT(height)\n```\n\n可接受任何字段类型作为输入。\n\n要计算行数,请使用 `COUNT()` 或 `COUNT(*)`:\n\n```\nFROM employees\n| STATS count = COUNT(*) BY languages\n| SORT languages DESC\n```\n\n此表达式可使用内联函数。此示例会使用 `SPLIT` 函数将字符串拆分成多个值,并对值进行计数:\n\n```\nROW words=\"foo;bar;baz;qux;quux;foo\"\n| STATS word_count = COUNT(SPLIT(words, \";\"))\n```\n ", "languageDocumentationPopover.documentationESQL.date_diff": "DATE_DIFF", "languageDocumentationPopover.documentationESQL.date_diff.markdown": "\n\n ### DATE_DIFF\n 从 `endTimestamp` 中减去 `startTimestamp`,并以倍数 `unit` 返回差异。\n 如果 `startTimestamp` 晚于 `endTimestamp`,则返回负值。\n\n ```\n ROW date1 = TO_DATETIME(\"2023-12-02T11:00:00.000Z\"), date2 = TO_DATETIME(\"2023-12-02T11:00:00.001Z\")\n | EVAL dd_ms = DATE_DIFF(\"microseconds\", date1, date2)\n ```\n ", "languageDocumentationPopover.documentationESQL.date_extract": "DATE_EXTRACT", @@ -7295,14 +7289,6 @@ "languageDocumentationPopover.documentationESQL.ltrim": "LTRIM", "languageDocumentationPopover.documentationESQL.ltrim.markdown": "\n\n ### LTRIM\n 从字符串中移除前导空格。\n\n ```\n ROW message = \" some text \", color = \" red \"\n | EVAL message = LTRIM(message)\n | EVAL color = LTRIM(color)\n | EVAL message = CONCAT(\"'\", message, \"'\")\n | EVAL color = CONCAT(\"'\", color, \"'\")\n ```\n ", "languageDocumentationPopover.documentationESQL.markdown": "## ES|QL\n\nES|QL(Elasticsearch 查询语言)查询包含一系列命令,它们用管道字符分隔:`|`。每个查询以**源命令**开头,它会生成一个表,其中通常包含来自 Elasticsearch 的数据。\n\n源命令可后接一个或多个**处理命令**。处理命令可通过添加、移除以及更改行和列来更改前一个命令的输出表。\n\n```\nsource-command\n| processing-command1\n| processing-command2\n```\n\n查询的结果为由最后的处理命令生成的表。 \n ", - "languageDocumentationPopover.documentationESQL.maxFunction": "MAX", - "languageDocumentationPopover.documentationESQL.maxFunction.markdown": "### MAX\n返回数字表达式的最大值。\n\n```\nFROM employees\n| STATS MAX(languages)\n```\n\n此表达式可使用内联函数。例如,要计算一个多值列的平均值的最大值,应首先使用 `MV_AVG` 对每行的多个值求平均值,然后将结果用于 `MAX` 函数:\n\n```\nFROM employees\n| STATS max_avg_salary_change = MAX(MV_AVG(salary_change))\n```\n ", - "languageDocumentationPopover.documentationESQL.medianAbsoluteDeviationFunction": "MEDIAN_ABSOLUTE_DEVIATION", - "languageDocumentationPopover.documentationESQL.medianAbsoluteDeviationFunction.markdown": "### MEDIAN_ABSOLUTE_DEVIATION\n返回中位数绝对偏差,衡量可变性。这是一种稳健统计,意味着它可用于描述可能包含离群值,或可能不是正态分布的数据。对于此类数据,它比标准偏差更具描述性。\n\n它计算为每个数据点的中位数与整个样例的中位数的偏差。也就是说,对于随机变量 X,中位数绝对偏差为 `median(|median(X) - X|)`。\n\n```\nFROM employees\n| STATS MEDIAN(salary), MEDIAN_ABSOLUTE_DEVIATION(salary)\n```\n\n注意:与 `PERCENTILE` 一样,`MEDIAN_ABSOLUTE_DEVIATION` 通常为基于 TDigest 算法的近似计算。`MEDIAN_ABSOLUTE_DEVIATION` 也具有非确定性。这意味着,即使使用相同的数据,但您得到的结果可能会略有不同。\n\n此表达式可使用内联函数。例如,要计算一个多值列的最大值的中位数绝对偏差,应首先使用 `MV_MAX` 获取每行的最大值,然后将结果用于 `MEDIAN_ABSOLUTE_DEVIATION` 函数:\n\n```\nFROM employees\n| STATS m_a_d_max_salary_change = MEDIAN_ABSOLUTE_DEVIATION(MV_MAX(salary_change))\n```\n\n", - "languageDocumentationPopover.documentationESQL.medianFunction": "MEDIAN", - "languageDocumentationPopover.documentationESQL.medianFunction.markdown": "### MEDIAN\n返回大于所有值的一半且小于所有值的一半的值,也称为 50% `PERCENTILE`。\n\n**注意:**与 `PERCENTILE` 一样,`MEDIAN` 通常为基于 TDigest 算法的近似计算。\n\n**警告:** `MEDIAN` 也具有[非确定性](https://en.wikipedia.org/wiki/Nondeterministic_algorithm)。这意味着,即使使用相同的数据,但您得到的结果可能会略有不同。\n\n例如:\n\n```\nFROM employees\n| STATS MEDIAN(salary), PERCENTILE(salary, 50)\n```\n\n此表达式可使用内联函数。例如,要计算一个多值列的最大值的中位数,应首先使用 `MV_MAX` 获取每行的最大值,然后将结果用于 `MEDIAN` 函数:\n\n```\nFROM employees\n| STATS median_max_salary_change = MEDIAN(MV_MAX(salary_change))\n```\n ", - "languageDocumentationPopover.documentationESQL.minFunction": "MIN", - "languageDocumentationPopover.documentationESQL.minFunction.markdown": "### MIN\n返回数字字段的最小值。\n\n```\nFROM employees\n| STATS MIN(languages)\n```\n\n此表达式可使用内联函数。例如,要计算一个多值列的平均值的最小值,应首先使用 `MV_AVG` 对每行的多个值求平均值,然后将结果用于 `MIN` 函数:\n\n```\nFROM employees\n| STATS min_avg_salary_change = MIN(MV_AVG(salary_change))\n```\n ", "languageDocumentationPopover.documentationESQL.mv_append": "MV_APPEND", "languageDocumentationPopover.documentationESQL.mv_append.markdown": "\n\n ### MV_APPEND\n 串联两个多值字段的值。\n\n ", "languageDocumentationPopover.documentationESQL.mv_avg": "MV_AVG", @@ -7335,8 +7321,6 @@ "languageDocumentationPopover.documentationESQL.mvExpand.markdown": "### MV_EXPAND\n`MV_EXPAND` 处理命令将多值字段扩展成每个值一行,从而复制其他字段: \n```\nROW a=[1,2,3], b=\"b\", j=[\"a\",\"b\"]\n| MV_EXPAND a\n```\n ", "languageDocumentationPopover.documentationESQL.now": "NOW", "languageDocumentationPopover.documentationESQL.now.markdown": "\n\n ### NOW\n 返回当前日期和时间。\n\n ```\n ROW current_date = NOW()\n ```\n ", - "languageDocumentationPopover.documentationESQL.percentileFunction": "PERCENTILE", - "languageDocumentationPopover.documentationESQL.percentileFunction.markdown": "### PERCENTILE\n出现某个百分比的观察值时的值。例如,第 95 个百分位是大于 95% 的观察值的值,第 50 个百分位是 `MEDIAN`。\n\n```\nFROM employees\n| STATS p0 = PERCENTILE(salary, 0)\n , p50 = PERCENTILE(salary, 50)\n , p99 = PERCENTILE(salary, 99)\n```\n\n**注意:** `PERCENTILE` 通常为基于 TDigest 算法的近似计算。\n\n**警告:** `PERCENTILE` 也具有[非确定性](https://en.wikipedia.org/wiki/Nondeterministic_algorithm)。这意味着,即使使用相同的数据,但您得到的结果可能会略有不同。\n\n此表达式可使用内联函数。例如,要计算一个多值列的最大值的百分位数,应首先使用 `MV_MAX` 获取每行的最大值,然后将结果用于 `PERCENTILE` 函数:\n\n```\nFROM employees\n| STATS p80_max_salary_change = PERCENTILE(MV_MAX(salary_change), 80)\n```\n ", "languageDocumentationPopover.documentationESQL.pi": "PI", "languageDocumentationPopover.documentationESQL.pi.markdown": "\n\n ### PI\n 返回 Pi,即圆的周长与其直径的比率。\n\n ```\n ROW PI()\n ```\n ", "languageDocumentationPopover.documentationESQL.pow": "POW", @@ -7389,14 +7373,10 @@ "languageDocumentationPopover.documentationESQL.starts_with.markdown": "\n\n ### STARTS_WITH\n 返回指示关键字字符串是否以另一个字符串开头的布尔值。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL ln_S = STARTS_WITH(last_name, \"B\")\n ```\n ", "languageDocumentationPopover.documentationESQL.statsby": "STATS ...BY", "languageDocumentationPopover.documentationESQL.statsby.markdown": "### STATS ...BY\n使用 `STATS ...BY` 可根据公共值对行分组,并计算已分组行中的一个或多个聚合值。\n\n**示例**:\n\n```\nFROM employees\n| STATS count = COUNT(emp_no) BY languages\n| SORT languages\n```\n\n如果省略 `BY`,输出表实际将包含一行,其中为应用于整个数据集的聚合:\n\n```\nFROM employees\n| STATS avg_lang = AVG(languages)\n```\n\n可以计算多个值:\n\n```\nFROM employees\n| STATS avg_lang = AVG(languages), max_lang = MAX(languages)\n```\n\n也可以按多个值分组(仅长整型和关键字家族字段支持):\n\n```\nFROM employees\n| EVAL hired = DATE_FORMAT(hire_date, \"YYYY\")\n| STATS avg_salary = AVG(salary) BY hired, languages.long\n| EVAL avg_salary = ROUND(avg_salary)\n| SORT hired, languages.long\n```\n\n请参阅**聚合函数**获取可与 `STATS ...BY` 搭配使用的函数列表。\n\n聚合函数和分组表达式均接受其他函数。这在对多值列使用 `STATS...BY` 时有用。例如,要计算平均工资变动,可以首先使用 `MV_AVG` 对每名员工的多个值求平均值,然后将结果用于 `AVG` 函数:\n\n```\nFROM employees\n| STATS avg_salary_change = AVG(MV_AVG(salary_change))\n```\n\n按表达式分组的示例为根据员工姓氏的第一个字母对其进行分组:\n\n```\nFROM employees\n| STATS my_count = COUNT() BY LEFT(last_name, 1)\n| SORT `LEFT(last_name, 1)`\n```\n\n指定输出列名称为可选操作。如果未指定,新列名称等于该表达式。以下查询将返回名为 `AVG(salary)` 的列:\n\n```\nFROM employees\n| STATS AVG(salary)\n```\n\n由于此名称包含特殊字符,在后续命令中使用该名称时,需要用反撇号 (`) 引用它:\n\n```\nFROM employees\n| STATS AVG(salary)\n| EVAL avg_salary_rounded = ROUND(`AVG(salary)`)\n```\n\n**注意**:不包含任何组的 `STATS` 比添加组更快。\n\n**注意**:当前,根据单一表达式进行分组比根据许多表达式进行分组更为优化。\n ", - "languageDocumentationPopover.documentationESQL.stCentroidFunction": "ST_CENTROID_AGG", - "languageDocumentationPopover.documentationESQL.stCentroidFunction.markdown": "### ST_CENTROID_AGG\n**警告:此功能处于技术预览状态,在未来版本中可能会更改或移除。Elastic 将努力修复任何问题,但处于技术预览状态的功能不受正式 GA 功能支持 SLA 的约束。**\n\n对包含空间点几何图形类型的字段计算空间重心。\n\n```\nFROM airports\n| STATS centroid=ST_CENTROID_AGG(location)\n```\n ", "languageDocumentationPopover.documentationESQL.stringOperators": "LIKE 和 RLIKE", "languageDocumentationPopover.documentationESQL.stringOperators.markdown": "### LIKE 和 RLIKE\n使用通配符或正则表达式比较字符串时,请使用 `LIKE` 或 `RLIKE`:\n\n使用 `LIKE` 时,可使用通配符来匹配字符串。支持以下通配符字符:\n\n* `*` 匹配零个或更多字符。\n* `?` 匹配一个字符。\n\n```\nFROM employees\n| WHERE first_name LIKE \"?b*\"\n| KEEP first_name, last_name\n```\n\n使用 `RLIKE` 时,可使用正则表达式来匹配字符串:\n\n```\nFROM employees\n| WHERE first_name RLIKE \".leja.*\"\n| KEEP first_name, last_name\n```\n ", "languageDocumentationPopover.documentationESQL.substring": "SUBSTRING", "languageDocumentationPopover.documentationESQL.substring.markdown": "\n\n ### SUBSTRING\n 返回字符串的子字符串,用起始位置和可选长度指定\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL ln_sub = SUBSTRING(last_name, 1, 3)\n ```\n ", - "languageDocumentationPopover.documentationESQL.sumFunction": "SUM", - "languageDocumentationPopover.documentationESQL.sumFunction.markdown": "### SUM\n返回数字字段的总和。\n\n```\nFROM employees\n| STATS SUM(languages)\n```\n\n此表达式可使用内联函数。例如,要计算每名员工的最大工资变动的总和,请对每行应用 `MV_MAX` 函数,然后对结果使用 `SUM`:\n\n```\nFROM employees\n| STATS total_salary_changes = SUM(MV_MAX(salary_change))\n```\n ", "languageDocumentationPopover.documentationESQL.tan": "TAN", "languageDocumentationPopover.documentationESQL.tan.markdown": "\n\n ### TAN\n 返回角度的正切三角函数。\n\n ```\n ROW a=1.8 \n | EVAL tan=TAN(a)\n ```\n ", "languageDocumentationPopover.documentationESQL.tanh": "TANH", @@ -7441,8 +7421,6 @@ "languageDocumentationPopover.documentationESQL.to_version.markdown": "\n\n ### TO_VERSION\n 将输入字符串转换为版本值。\n\n ```\n ROW v = TO_VERSION(\"1.2.3\")\n ```\n ", "languageDocumentationPopover.documentationESQL.trim": "TRIM", "languageDocumentationPopover.documentationESQL.trim.markdown": "\n\n ### TRIM\n 从字符串中移除前导和尾随空格。\n\n ```\n ROW message = \" some text \", color = \" red \"\n | EVAL message = TRIM(message)\n | EVAL color = TRIM(color)\n ```\n ", - "languageDocumentationPopover.documentationESQL.valuesFunction": "VALUES", - "languageDocumentationPopover.documentationESQL.valuesFunction.markdown": "### VALUES\n\n**警告:请勿在生产环境中使用 `VALUES`。此功能处于技术预览状态,在未来版本中可能会更改或移除。Elastic 将努力修复任何问题,但处于技术预览状态的功能不受正式 GA 功能支持 SLA 的约束。**\n\n以多值字段的形式返回组中的所有值。无法保证返回值的顺序。如果需要按顺序返回值,请使用 `MV_SORT`。\n\n接受任何类型的表达式,但 `geo_point`、`cartesian_point`、`geo_shape` 或 `cartesian_shape` 除外。\n\n\n例如:\n\n```\n FROM employees\n| EVAL first_letter = SUBSTRING(first_name, 0, 1)\n| STATS first_name=MV_SORT(VALUES(first_name)) BY first_letter\n| SORT first_letter\n```\n\n> _**警告:**这可能会占用大量内存,但除内存以外,ES|QL 尚不会增长聚合。因此,此聚合会正常工作,直到将其用于收集的值超出内存装载量。一旦收集的值过多,查询将会失败,并出现[断路器错误](https://www.elastic.co/guide/en/elasticsearch/reference/current/circuit-breaker-errors.html)。_\n\n ", "languageDocumentationPopover.documentationESQL.where": "WHERE", "languageDocumentationPopover.documentationESQL.where.markdown": "### WHERE\n使用 `WHERE` 可生成一个表,其中包含输入表中所提供的条件评估为 `true` 的所有行:\n \n```\nFROM employees\n| KEEP first_name, last_name, still_hired\n| WHERE still_hired == true\n```\n\n#### 运算符\n\n请参阅**运算符**了解所支持的运算符的概览。\n\n#### 函数\n`WHERE` 支持各种用于计算值的函数。请参阅**函数**了解更多信息。\n ", "textBasedEditor.query.textBasedLanguagesEditor.EnableWordWrapLabel": "在管道符上添加换行符", From 6bff966b3837fcb38ea38593ceaeaa256e12c4d9 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Fri, 13 Sep 2024 08:02:09 +0200 Subject: [PATCH 24/31] Fix the broken script --- .buildkite/scripts/steps/esql_generate_function_metadata.sh | 2 +- packages/kbn-language-documentation-popover/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.buildkite/scripts/steps/esql_generate_function_metadata.sh b/.buildkite/scripts/steps/esql_generate_function_metadata.sh index 837a962b3c42bf..07de4bc9bd04c0 100755 --- a/.buildkite/scripts/steps/esql_generate_function_metadata.sh +++ b/.buildkite/scripts/steps/esql_generate_function_metadata.sh @@ -2,7 +2,7 @@ set -euo pipefail VALIDATION_PACKAGE_DIR="packages/kbn-esql-validation-autocomplete" -EDITOR_PACKAGE_DIR="packages/kbn-text-based-editor" +EDITOR_PACKAGE_DIR="packages/kbn-language-documentation-popover" GIT_SCOPE="$VALIDATION_PACKAGE_DIR/**/* $EDITOR_PACKAGE_DIR/**/*" report_main_step () { diff --git a/packages/kbn-language-documentation-popover/package.json b/packages/kbn-language-documentation-popover/package.json index ad2f82f7170f15..1be60ceee22961 100644 --- a/packages/kbn-language-documentation-popover/package.json +++ b/packages/kbn-language-documentation-popover/package.json @@ -7,7 +7,7 @@ "*.scss" ], "scripts": { - "make:docs": "ts-node --transpileOnly scripts/generate_esql_docs.ts", + "make:docs": "ts-node --transpileOnly src/scripts/generate_esql_docs.ts", "postmake:docs": "yarn run lint:fix", "lint:fix": "cd ../.. && node ./scripts/eslint --fix ./packages/kbn-language-documentation-popover/src/sections/generated" } From a056700893c72c73cbd8ad05db1509bbff3f5557 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Mon, 16 Sep 2024 14:19:57 +0200 Subject: [PATCH 25/31] Give a better layout in the ESQL alert layout --- .../rule_types/es_query/expression/esql_query_expression.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/esql_query_expression.tsx b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/esql_query_expression.tsx index c8ce47ce68ac40..da8559a958d99c 100644 --- a/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/esql_query_expression.tsx +++ b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/esql_query_expression.tsx @@ -198,6 +198,7 @@ export const EsqlQueryExpression: React.FC< detectedTimestamp={detectedTimestamp} hideRunQueryText={true} isLoading={isLoading} + editorIsInline hasOutline /> From 4d099f2943a35b47c7e10dcc45b05880c7800d69 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Mon, 16 Sep 2024 15:03:49 +0200 Subject: [PATCH 26/31] Revert the docs button from the footer --- .../src/editor_footer/index.tsx | 40 ++++++++++++++++++- .../src/text_based_languages_editor.test.tsx | 12 ++++++ .../src/text_based_languages_editor.tsx | 2 + packages/kbn-text-based-editor/src/types.ts | 3 ++ .../index_data_visualizer_esql.tsx | 1 + 5 files changed, 56 insertions(+), 2 deletions(-) diff --git a/packages/kbn-text-based-editor/src/editor_footer/index.tsx b/packages/kbn-text-based-editor/src/editor_footer/index.tsx index c1bf5aa14b8768..6468a2c08a8bc8 100644 --- a/packages/kbn-text-based-editor/src/editor_footer/index.tsx +++ b/packages/kbn-text-based-editor/src/editor_footer/index.tsx @@ -10,15 +10,27 @@ import React, { memo, useState, useCallback, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { EuiText, EuiFlexGroup, EuiFlexItem, EuiCode, EuiButtonIcon } from '@elastic/eui'; +import { + EuiText, + EuiFlexGroup, + EuiFlexItem, + EuiCode, + EuiButtonIcon, + EuiButtonEmpty, +} from '@elastic/eui'; import { Interpolation, Theme, css } from '@emotion/react'; -import { LanguageDocumentationInline } from '@kbn/language-documentation-popover'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { + LanguageDocumentationInline, + LanguageDocumentationFlyout, +} from '@kbn/language-documentation-popover'; import { getLimitFromESQLQuery } from '@kbn/esql-utils'; import { type MonacoMessage } from '../helpers'; import { ErrorsWarningsFooterPopover } from './errors_warnings_popover'; import { QueryHistoryAction, QueryHistory } from './query_history'; import { SubmitFeedbackComponent } from './feedback_component'; import { QueryWrapComponent } from './query_wrap_component'; +import type { TextBasedEditorDeps } from '../types'; const isMac = navigator.platform.toLowerCase().indexOf('mac') >= 0; const COMMAND_KEY = isMac ? '⌘' : '^'; @@ -45,6 +57,7 @@ interface EditorFooterProps { hideTimeFilterInfo?: boolean; hideQueryHistory?: boolean; isInCompactMode?: boolean; + displayDocumentationAsFlyout?: boolean; } export const EditorFooter = memo(function EditorFooter({ @@ -64,9 +77,12 @@ export const EditorFooter = memo(function EditorFooter({ setIsHistoryOpen, hideQueryHistory, isInCompactMode, + displayDocumentationAsFlyout, measuredContainerWidth, code, }: EditorFooterProps) { + const kibana = useKibana(); + const { docLinks } = kibana.services; const [isErrorPopoverOpen, setIsErrorPopoverOpen] = useState(false); const [isLanguageComponentOpen, setIsLanguageComponentOpen] = useState(false); const [isWarningPopoverOpen, setIsWarningPopoverOpen] = useState(false); @@ -273,6 +289,26 @@ export const EditorFooter = memo(function EditorFooter({ )} + {displayDocumentationAsFlyout && !Boolean(editorIsInline) && ( + <> + toggleLanguageComponent()} + css={css` + cursor: pointer; + `} + /> + + + )} {Boolean(editorIsInline) && ( diff --git a/packages/kbn-text-based-editor/src/text_based_languages_editor.test.tsx b/packages/kbn-text-based-editor/src/text_based_languages_editor.test.tsx index ff8253646980c3..0855d0326263f6 100644 --- a/packages/kbn-text-based-editor/src/text_based_languages_editor.test.tsx +++ b/packages/kbn-text-based-editor/src/text_based_languages_editor.test.tsx @@ -138,6 +138,18 @@ describe('TextBasedLanguagesEditor', () => { expect(component.find('[data-test-subj="TextBasedLangEditor-run-query"]').length).not.toBe(0); }); + it('should render the doc icon if the displayDocumentationAsFlyout is true', async () => { + const newProps = { + ...props, + displayDocumentationAsFlyout: true, + editorIsInline: false, + }; + const component = mount(renderTextBasedLanguagesEditorComponent({ ...newProps })); + expect(component.find('[data-test-subj="TextBasedLangEditor-documentation"]').length).not.toBe( + 0 + ); + }); + it('should not render the run query text if the hideRunQueryText prop is set to true', async () => { const newProps = { ...props, diff --git a/packages/kbn-text-based-editor/src/text_based_languages_editor.tsx b/packages/kbn-text-based-editor/src/text_based_languages_editor.tsx index d760e6586ae09d..a92ddc7814f7a6 100644 --- a/packages/kbn-text-based-editor/src/text_based_languages_editor.tsx +++ b/packages/kbn-text-based-editor/src/text_based_languages_editor.tsx @@ -79,6 +79,7 @@ export const TextBasedLanguagesEditor = memo(function TextBasedLanguagesEditor({ hideTimeFilterInfo, hideQueryHistory, hasOutline, + displayDocumentationAsFlyout, }: TextBasedLanguagesEditorProps) { const popoverRef = useRef(null); const datePickerOpenStatusRef = useRef(false); @@ -734,6 +735,7 @@ export const TextBasedLanguagesEditor = memo(function TextBasedLanguagesEditor({ setIsHistoryOpen={toggleHistory} measuredContainerWidth={measuredEditorWidth} hideQueryHistory={hideHistoryComponent} + displayDocumentationAsFlyout={displayDocumentationAsFlyout} /> = (dataVi detectedTimestamp={currentDataView?.timeFieldName} hideRunQueryText={false} isLoading={queryHistoryStatus ?? false} + displayDocumentationAsFlyout /> From 3b1998c6d920c2cc00685aafc245dbcfe8ddcc9e Mon Sep 17 00:00:00 2001 From: Ryan Keairns Date: Mon, 16 Sep 2024 10:58:35 -0700 Subject: [PATCH 27/31] Change layout of flyout header --- .../src/components/as_flyout/index.tsx | 13 ++- .../shared/documentation_navigation.tsx | 103 ++++++------------ 2 files changed, 48 insertions(+), 68 deletions(-) diff --git a/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx b/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx index 238960301cd296..a3433556d44b51 100644 --- a/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx +++ b/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx @@ -7,7 +7,14 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ import React, { useCallback, useEffect, useState, useRef, useMemo } from 'react'; -import { EuiFlyout, useEuiTheme, EuiFlyoutBody, EuiFlyoutHeader } from '@elastic/eui'; +import { + EuiFlyout, + useEuiTheme, + EuiFlyoutBody, + EuiFlyoutHeader, + EuiTitle, + EuiSpacer +} from '@elastic/eui'; import { getFilteredGroups } from '../../utils/get_filtered_groups'; import { DocumentationMainContent, DocumentationNavigation } from '../shared'; import { getESQLDocsSections } from '../../sections'; @@ -74,6 +81,10 @@ function DocumentationFlyout({ size={DEFAULT_WIDTH} > + +

ES|QL quick reference

+
+ - {linkToDocumentation && ( - - - {i18n.translate('languageDocumentationPopover.esqlDocsLabel', { - defaultMessage: 'View full ES|QL documentation', - })} - - - )} - - - { - setSearchText(e.target.value); - }} - data-test-subj="language-documentation-navigation-search" - placeholder={i18n.translate('languageDocumentationPopover.searchPlaceholder', { - defaultMessage: 'Search', - })} - fullWidth - compressed - /> - - - + + + label="Search or select topic" + labelAppend={linkToDocumentation && ( + + + {i18n.translate('languageDocumentationPopover.esqlDocsLabel', { + defaultMessage: 'View full ES|QL documentation', + })} + + + )} + > + + From ad2a53b252fa5fae46d11a934968b4432af7e77a Mon Sep 17 00:00:00 2001 From: Ryan Keairns Date: Mon, 16 Sep 2024 11:25:36 -0700 Subject: [PATCH 28/31] Add search back --- .../src/components/as_flyout/index.tsx | 7 +- .../shared/documentation_navigation.tsx | 100 ++++++++++++------ 2 files changed, 70 insertions(+), 37 deletions(-) diff --git a/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx b/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx index a3433556d44b51..1a795f7d2da072 100644 --- a/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx +++ b/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx @@ -13,7 +13,7 @@ import { EuiFlyoutBody, EuiFlyoutHeader, EuiTitle, - EuiSpacer + EuiSpacer, } from '@elastic/eui'; import { getFilteredGroups } from '../../utils/get_filtered_groups'; import { DocumentationMainContent, DocumentationNavigation } from '../shared'; @@ -79,12 +79,13 @@ function DocumentationFlyout({ aria-labelledby="esqlInlineDocumentationFlyout" type="push" size={DEFAULT_WIDTH} + paddingSize="m" > - +

ES|QL quick reference

- + - + - + + {i18n.translate('languageDocumentationPopover.esqlDocsLabel', { + defaultMessage: 'View full ES|QL documentation', + })} + + + )} + > + - - {i18n.translate('languageDocumentationPopover.esqlDocsLabel', { - defaultMessage: 'View full ES|QL documentation', - })} - - - )} - > - + /> + + { + setSearchText(e.target.value); + }} + data-test-subj="language-documentation-navigation-search" + placeholder={i18n.translate('languageDocumentationPopover.searchPlaceholder', { + defaultMessage: 'Search', + })} + fullWidth + compressed + /> + ); From 46005df9846bc48e6a809c985c29f619d273f60c Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Tue, 17 Sep 2024 08:46:29 +0200 Subject: [PATCH 29/31] Fixes in the merged PR --- .../src/components/as_flyout/index.tsx | 7 +- .../shared/documentation_navigation.tsx | 68 ++++++++++--------- .../sections/esql_documentation_sections.tsx | 3 +- 3 files changed, 43 insertions(+), 35 deletions(-) diff --git a/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx b/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx index 1a795f7d2da072..0a617165f76617 100644 --- a/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx +++ b/packages/kbn-language-documentation-popover/src/components/as_flyout/index.tsx @@ -15,6 +15,7 @@ import { EuiTitle, EuiSpacer, } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; import { getFilteredGroups } from '../../utils/get_filtered_groups'; import { DocumentationMainContent, DocumentationNavigation } from '../shared'; import { getESQLDocsSections } from '../../sections'; @@ -83,7 +84,11 @@ function DocumentationFlyout({ > -

ES|QL quick reference

+

+ {i18n.translate('languageDocumentationPopover.documentationFlyoutTitle', { + defaultMessage: 'ES|QL quick reference', + })} +

- - - {i18n.translate('languageDocumentationPopover.esqlDocsLabel', { - defaultMessage: 'View full ES|QL documentation', - })} - - - )} - > - + label={i18n.translate('languageDocumentationPopover.esqlDocsLabel', { + defaultMessage: 'Select or search topics', + })} + labelAppend={ + linkToDocumentation && ( + + + {i18n.translate('languageDocumentationPopover.esqlDocsLinkLabel', { + defaultMessage: 'View full ES|QL documentation', + })} + + + ) + } + > + [0]) => ( export const initialSection = ( Date: Tue, 17 Sep 2024 08:49:08 +0200 Subject: [PATCH 30/31] Close the popover when a child is clio --- .../public/query_string_input/esql_menu_popover.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/unified_search/public/query_string_input/esql_menu_popover.tsx b/src/plugins/unified_search/public/query_string_input/esql_menu_popover.tsx index 1c04bbd84c7fa1..d684448670c42a 100644 --- a/src/plugins/unified_search/public/query_string_input/esql_menu_popover.tsx +++ b/src/plugins/unified_search/public/query_string_input/esql_menu_popover.tsx @@ -31,6 +31,7 @@ export const ESQLMenuPopover = () => { const toggleLanguageComponent = useCallback(async () => { setIsLanguageComponentOpen(!isLanguageComponentOpen); + setIsESQLMenuPopoverOpen(false); }, [isLanguageComponentOpen]); const esqlPanelItems = useMemo(() => { @@ -52,6 +53,7 @@ export const ESQLMenuPopover = () => { data-test-subj="esql-about" target="_blank" href={docLinks.links.query.queryESQL} + onClick={() => setIsESQLMenuPopoverOpen(false)} > {i18n.translate('unifiedSearch.query.queryBar.esqlMenu.documentation', { defaultMessage: 'Documentation', @@ -63,6 +65,7 @@ export const ESQLMenuPopover = () => { data-test-subj="esql-examples" target="_blank" href={docLinks.links.query.queryESQLExamples} + onClick={() => setIsESQLMenuPopoverOpen(false)} > {i18n.translate('unifiedSearch.query.queryBar.esqlMenu.documentation', { defaultMessage: 'Example queries', @@ -75,6 +78,7 @@ export const ESQLMenuPopover = () => { data-test-subj="esql-feedback" target="_blank" href={FEEDBACK_LINK} + onClick={() => setIsESQLMenuPopoverOpen(false)} > {i18n.translate('unifiedSearch.query.queryBar.esqlMenu.documentation', { defaultMessage: 'Submit feedback', From fe970f44c7bfdc4982052da2f6fa9ee5fa4215eb Mon Sep 17 00:00:00 2001 From: Drew Tate Date: Wed, 18 Sep 2024 14:39:41 -0600 Subject: [PATCH 31/31] fix docs generation script --- packages/kbn-language-documentation-popover/package.json | 4 ++-- .../{src => }/scripts/generate_esql_docs.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) rename packages/kbn-language-documentation-popover/{src => }/scripts/generate_esql_docs.ts (96%) diff --git a/packages/kbn-language-documentation-popover/package.json b/packages/kbn-language-documentation-popover/package.json index 1be60ceee22961..002c3c4ee51b3e 100644 --- a/packages/kbn-language-documentation-popover/package.json +++ b/packages/kbn-language-documentation-popover/package.json @@ -7,8 +7,8 @@ "*.scss" ], "scripts": { - "make:docs": "ts-node --transpileOnly src/scripts/generate_esql_docs.ts", + "make:docs": "ts-node --transpileOnly scripts/generate_esql_docs.ts", "postmake:docs": "yarn run lint:fix", "lint:fix": "cd ../.. && node ./scripts/eslint --fix ./packages/kbn-language-documentation-popover/src/sections/generated" } -} \ No newline at end of file +} diff --git a/packages/kbn-language-documentation-popover/src/scripts/generate_esql_docs.ts b/packages/kbn-language-documentation-popover/scripts/generate_esql_docs.ts similarity index 96% rename from packages/kbn-language-documentation-popover/src/scripts/generate_esql_docs.ts rename to packages/kbn-language-documentation-popover/scripts/generate_esql_docs.ts index 63796fbd6a8ee2..4fad23e2e25f2b 100644 --- a/packages/kbn-language-documentation-popover/src/scripts/generate_esql_docs.ts +++ b/packages/kbn-language-documentation-popover/scripts/generate_esql_docs.ts @@ -11,18 +11,18 @@ import * as recast from 'recast'; const n = recast.types.namedTypes; import fs from 'fs'; import path from 'path'; -import { functions } from '../sections/generated/scalar_functions'; +import { functions } from '../src/sections/generated/scalar_functions'; (function () { const pathToElasticsearch = process.argv[2]; const { scalarFunctions, aggregationFunctions } = loadFunctionDocs(pathToElasticsearch); writeFunctionDocs( scalarFunctions, - path.join(__dirname, '.../sections/generated/scalar_functions.tsx') + path.join(__dirname, '../src/sections/generated/scalar_functions.tsx') ); writeFunctionDocs( aggregationFunctions, - path.join(__dirname, '.../sections/generated/aggregation_functions.tsx') + path.join(__dirname, '../src/sections/generated/aggregation_functions.tsx') ); })();