Manual backport of two PRs: * #125155 * #125251
Even though the docs are not needed in 9.0, due to all docs being
published off main, doing the backport makes future backports of
non-docs, but docs-adjacent PRs easier.
This entirely syncs the contents of docs/reference/query-languages/esql with main, just so we can continue auto-backporting easily, which will continue to be relevant.
* Restructure query-languages docs files for clarity (#124797)
In a few previous PR's we restructured the ES|QL docs to make it possible to generate them dynamically.
This PR just moves a few files around to make the query languages docs easier to work with, and a little more organized like the ES|QL docs.
A bit part of this was setting up redirects to the new locations, so other repo's could correctly link to the elasticsearch docs.
* After running tests, we revert a few features
* Fix build.gradle and improved some generating code
* After running tests
* Update x-pack/plugin/esql/build.gradle