Skip to content

Split ES|QL functions/operators/commands into separate pages for similar functions and make commands examples generated #126279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

craigtaverner
Copy link
Contributor

@craigtaverner craigtaverner commented Apr 4, 2025

Fixes #126199

While the internal structure of the docs is already split into many (over 1000) sub-pages, the final display for the Functions and Operators page is a single giant page, making navigation harder. This PR splits it into separate pages, one for each group of similar functions and one for the operators. Twelve new pages.

This PR also bundles a few other related changes. In total what is done is:

  • Split functions/operators into 12 pages, one for each group, maintaining the existing split of each function/operator into a snippet with dynamically generated examples
  • Split esql-commands.md into source-commands.md and processing-commands.md, each of which is split into individual snippets, one for each command
  • Each command snippet has it's examples split out into separate files, if they were examples that were dynamically generated in the older asciidoc system
  • The examples files are overwritten by the ES|QL unit tests, using a similar mechanism to the examples written for functions and operators)
  • Some additional refinements to the Kibana definition and markdown files (nicer operator headings, and display text)

For example, this is what it looks like to navigate to MV_MEDIAN, where we can see on the left the new tree-structure with a separate item for multivalue functions and a shorter contents list on the right showing all the mv-functions:

Screenshot 2025-04-04 at 11 46 43

The same is done for the commands page, in preparation for also making all examples in commands based on tested examples again.

Screenshot 2025-04-05 at 13 47 32

@craigtaverner craigtaverner added >docs General docs changes Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) :Analytics/ES|QL AKA ESQL Team:Docs Meta label for docs team labels Apr 4, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-docs (Team:Docs)

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

Copy link
Contributor

@alex-spies alex-spies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't check the details, but I agree with the approach and new structure. Thanks @craigtaverner !

Copy link
Contributor

@leemthompo leemthompo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few suggestions to capitalize nav titles and fix page mappings

---
navigation_title: "Aggregation functions"
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/functions-operators/aggregation-functions.html
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- https://www.elastic.co/guide/en/elasticsearch/reference/current/functions-operators/aggregation-functions.html
- https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-functions-operators.html#esql-agg-functions

This metadata maps pages from old system to new system, and they have been impacted by find/replaces elsewhere

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the url to use for mapped_pages should be the old URL? I can make that change. I had thought I would need to add a bunch of entries to redirects, but perhaps this has the same effect?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@craigtaverner this is purely for migration purposes and is unrelated to redirects.yml

@leemthompo
Copy link
Contributor

Otherwise, this is looking great @craigtaverner 👏. I think we'll just need to set up a temporary redirects.yml file to mute the errors of the following type, due to URL path changes:

'reference/query-languages/esql/esql-commands.md' has no anchor named: '#esql-stats-by'. (docs-content:0)

Writers will fix the links in docs-content once this gets merged.

@leemthompo
Copy link
Contributor

I think the redirects.yml file should look something like this:

redirects:
  # Redirect main files that were split up
  'query-languages/esql/esql-commands.md':
    many:
      - to: 'query-languages/esql/commands/source-commands.md'
        anchors:
          'esql-from': 'esql-from'
          'esql-row': 'esql-row'
          'esql-show': 'esql-show'
      - to: 'query-languages/esql/commands/processing-commands.md'
        anchors:
          'esql-stats-by': 'esql-stats-by'
          'esql-limit': 'esql-limit'
          'esql-drop': 'esql-drop'
          'esql-eval': 'esql-eval'
          'esql-keep': 'esql-keep'
          'esql-lookup-join': 'esql-lookup-join'
          'esql-enrich': 'esql-enrich'
          'esql-where': 'esql-where'
          'esql-sort': 'esql-sort'
          'esql-grok': 'esql-grok'
          'esql-dissect': 'esql-dissect'

  # Redirect function and operator anchors
  'query-languages/esql/esql-functions-operators.md':
    many:
      - to: 'query-languages/esql/functions-operators/aggregation-functions.md'
        anchors:
          'esql-agg-functions': ''
      - to: 'query-languages/esql/functions-operators/type-conversion-functions.md'
        anchors:
          'esql-type-conversion-functions': ''
          'esql-to_string': 'esql-to_string'
      - to: 'query-languages/esql/functions-operators/search-functions.md'
        anchors:
          'esql-search-functions': ''
          'esql-match': 'esql-match'
          'esql-kql': 'esql-kql'
          'esql-qstr': 'esql-qstr'
      - to: 'query-languages/esql/functions-operators/operators.md'
        anchors:
          'esql-operators': ''
          'esql-search-operators': 'esql-match-operator'
          'esql-like': 'esql-like'
      - to: 'query-languages/esql/functions-operators/spatial-functions.md'
        anchors:
          'esql-spatial-functions': ''
          'esql-st_distance': 'esql-st_distance'
          'esql-st_within': 'esql-st_within'
          'esql-st_contains': 'esql-st_contains'
          'esql-st_disjoint': 'esql-st_disjoint'
          'esql-st_intersects': 'esql-st_intersects'
      - to: 'query-languages/esql/functions-operators/date-time-functions.md'
        anchors:
          'esql-now': 'esql-now'
      - to: 'query-languages/esql/functions-operators/grouping-functions.md'
        anchors:
          'esql-bucket': 'esql-bucket'
      - to: 'query-languages/esql/functions-operators/math-functions.md'
        anchors:
          'esql-round': 'esql-round'

Copy link
Contributor

@leemthompo leemthompo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👏

@craigtaverner craigtaverner added auto-backport Automatically create backport pull requests when merged v9.0.1 labels Apr 10, 2025
@craigtaverner craigtaverner merged commit 67b15ad into elastic:main Apr 10, 2025
16 checks passed
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
9.0 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 126279

craigtaverner added a commit to craigtaverner/elasticsearch that referenced this pull request Apr 10, 2025
…lar functions and make commands examples generated (elastic#126279)

While the internal structure of the docs is already split into many (over 1000) sub-pages, the final display for the `Functions and Operators` page is a single giant page, making navigation harder. This PR splits it into separate pages, one for each group of similar functions and one for the operators. Twelve new pages.

This PR also bundles a few other related changes. In total what is done is:
* Split functions/operators into 12 pages, one for each group, maintaining the existing split of each function/operator into a snippet with dynamically generated examples
* Split esql-commands.md into source-commands.md and processing-commands.md, each of which is split into individual snippets, one for each command
* Each command snippet has it's examples split out into separate files, if they were examples that were dynamically generated in the older asciidoc system
* The examples files are overwritten by the ES|QL unit tests, using a similar mechanism to the examples written for functions and operators)
* Some additional refinements to the Kibana definition and markdown files (nicer operator headings, and display text)
elasticsearchmachine pushed a commit that referenced this pull request Apr 10, 2025
…r similar functions and make commands examples generated (#126279) (#126624)

* Split ES|QL functions/operators/commands into separate pages for similar functions and make commands examples generated (#126279)

While the internal structure of the docs is already split into many (over 1000) sub-pages, the final display for the `Functions and Operators` page is a single giant page, making navigation harder. This PR splits it into separate pages, one for each group of similar functions and one for the operators. Twelve new pages.

This PR also bundles a few other related changes. In total what is done is:
* Split functions/operators into 12 pages, one for each group, maintaining the existing split of each function/operator into a snippet with dynamically generated examples
* Split esql-commands.md into source-commands.md and processing-commands.md, each of which is split into individual snippets, one for each command
* Each command snippet has it's examples split out into separate files, if they were examples that were dynamically generated in the older asciidoc system
* The examples files are overwritten by the ES|QL unit tests, using a similar mechanism to the examples written for functions and operators)
* Some additional refinements to the Kibana definition and markdown files (nicer operator headings, and display text)

* After re-running tests to ensure we get 9.0 behaviour only
charlotte-hoblik added a commit to elastic/docs-content that referenced this pull request Apr 11, 2025
Update links to ESQL reference docs following up on [this
PR](elastic/elasticsearch#126279) that splits
the `Functions and Operators` page into separate pages, one for each
group of similar functions and one for the operators.
Based on #1072
charlotte-hoblik added a commit to elastic/docs-content that referenced this pull request Apr 14, 2025
Connected to: #1095

Update links to ESQL reference docs following up on
elastic/elasticsearch#126279 that splits the
Functions and Operators page into separate pages, one for each group of
similar functions and one for the operators.
Based on #1072
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL auto-backport Automatically create backport pull requests when merged backport pending >docs General docs changes Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:Docs Meta label for docs team v9.0.1 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DOCS v3] Break out ESQL functions into subpages
5 participants