OpenSearch/docs/reference
Marios Trivyzas f373020349 SQL: Fix ORDER BY YEAR() function (#51562)
Previously, if YEAR() was used as and ORDER BY argument without being
wrapped with another scalar (e.g. YEAR(birth_date) + 10), no script
ordering was used but instead the underlying field (e.g. birth_date)
was used instead as a performance optimisation. This works correctly if
YEAR() is the only ORDER BY arg but if further args are used as tie
breakers for the ordering wrong results are produced. This is because
2 rows with the different birth_date but on the same year are not tied
as the underlying ordering is on birth_date and not on the
YEAR(birth_date), and the following ORDER BY args are ignored.

Remove this optimisation for YEAR() to avoid incorrect results in
such cases.

As a consequence another bug is revealed: scalar functions on top
of nested fields produce scripted sorting/filtering which is not yet
supported. In such cases no error was thrown but instead all values for
such nested fields were null and were passed to the script implementing
the sorting/filtering, producing incorrect results.

Detect such cases and throw a validation exception.

Fixes: #51224
(cherry picked from commit f41efd6753dc3650a7eabb3e07b02b3b32c5704c)
2020-01-30 15:29:36 +01:00
..
aggregations Fix leftover mentions of method parameter in Percentile Aggs (#51272) 2020-01-22 10:03:35 -05:00
analysis [DOCS] Reformat unique token filter docs (#50748) 2020-01-28 10:42:25 -05:00
autoscaling Initial autoscaling commit (#51161) 2020-01-17 15:31:12 -05:00
cat [DOCS] Task management API experimental status issue (#51634) 2020-01-30 14:15:47 +01:00
ccr Remove outdated requirement of CCR (#50859) 2020-01-13 20:00:23 -05:00
cluster [DOCS] Task management API experimental status issue (#51634) 2020-01-30 14:15:47 +01:00
commands Password-protected Keystore Feature Branch PR (#51123) (#51510) 2020-01-28 05:32:32 -05:00
docs [DOCS] Fixes "enables you to" typos (#50225) 2019-12-23 14:39:14 -05:00
eql [DOCS] Add top-level EQL docs page. Adds EQL requirements page. (#51334) 2020-01-27 16:04:47 -05:00
graph [DOCS] [2 of 5] Change // CONSOLE comments to [source,console] (#46353) (#46502) 2019-09-09 13:38:14 -04:00
high-availability [DOCS] Move snapshot-restore out of modules. (#49618) (#50829) 2020-01-09 16:55:46 -08:00
how-to [DOCS] Remove unneeded redirects (#50476) 2019-12-26 08:29:28 -05:00
ilm Stricter checks of setup and teardown in docs tests (#51430) 2020-01-28 16:52:23 +01:00
images [DOCS] Replace cross-cluster search PNG images with SVGs (#49395) 2019-11-21 09:06:33 -05:00
index-modules Deprecate translog retention settings (#51588) (#51638) 2020-01-30 09:03:10 -05:00
indices Deprecate creation of dot-prefixed index names except for hidden and system indices (#49959) 2020-01-28 10:01:16 -07:00
ingest [DOCS] Fixes indentation in inference processor code snippet (#51252) 2020-01-21 16:22:16 +01:00
licensing [DOCS] Update license expiry links (#50812) 2020-01-09 11:28:43 -08:00
mapping Stricter checks of setup and teardown in docs tests (#51430) 2020-01-28 16:52:23 +01:00
migration [DOCS] Fix minor typo affecting formatting (#51655) 2020-01-29 23:44:09 -08:00
ml [ML] Use CSV ingest processor in find_file_structure ingest pipeline (#51492) 2020-01-28 14:38:43 +00:00
modules [DOCS] Expands the documentation of Node Query Cache (#51105) 2020-01-20 11:13:29 +01:00
monitoring Stricter checks of setup and teardown in docs tests (#51430) 2020-01-28 16:52:23 +01:00
query-dsl [Docs] Including leading slash in range query doc example URLs (#51277) 2020-01-22 09:42:18 +01:00
release-notes [DOCS] Adds release highlight for transforms (#51555) 2020-01-29 08:35:02 -08:00
rest-api [DOCS] Document `indices` cluster stats (#50527) 2020-01-28 11:00:00 -05:00
rollup [DOCS] Merge rollup config details into API (#49412) 2019-11-22 08:39:49 -08:00
scripting Scripting: Add char position of script errors (#51069) (#51266) 2020-01-21 13:45:59 -07:00
search [Docs] Small edits to Ranking Evaluation API docs (#51116) 2020-01-20 10:30:23 +01:00
settings Deprecate timeout.tcp_read AD/LDAP realm setting (#47305) 2020-01-29 10:48:26 +02:00
setup Password-protected Keystore Feature Branch PR (#51123) (#51510) 2020-01-28 05:32:32 -05:00
snapshot-restore [DOCS] Move snapshot-restore out of modules. (#49618) (#50829) 2020-01-09 16:55:46 -08:00
sql SQL: Fix ORDER BY YEAR() function (#51562) 2020-01-30 15:29:36 +01:00
testing Uppercasing some docs section title (#37781) 2019-01-24 22:54:55 +01:00
transform [DOCS] Minor fixes in transform documentation (#51633) 2020-01-29 16:58:18 -08:00
upgrade Deprecate synced flush (#50835) 2020-01-13 19:54:38 -05:00
vectors Remove the 'experimental' marking from vector fields. (#49120) 2019-11-18 12:42:46 -08:00
aggregations.asciidoc [Docs] Update aggregations.asciidoc (#29265) 2018-03-28 15:01:45 +02:00
analysis.asciidoc [DOCS] Add tutorials section to analysis topic (#50809) 2020-01-16 13:12:06 -05:00
api-conventions.asciidoc [DOCS] [2 of 5] Change // CONSOLE comments to [source,console] (#46353) (#46502) 2019-09-09 13:38:14 -04:00
cat.asciidoc [DOCS] Use `s` parameter in cat API overview example (#50616) 2020-01-14 08:22:07 -05:00
cluster.asciidoc Password-protected Keystore Feature Branch PR (#51123) (#51510) 2020-01-28 05:32:32 -05:00
data-rollup-transform.asciidoc [DOCS] Adds transforms to Elasticsearch book (#46846) (#47055) 2019-09-25 08:11:37 -07:00
docs.asciidoc [DOCS] Remove heading offsets for REST APIs (#44568) 2019-07-19 14:36:06 -04:00
frozen-indices.asciidoc [DOCS] [2 of 5] Change // CONSOLE comments to [source,console] (#46353) (#46502) 2019-09-09 13:38:14 -04:00
getting-started.asciidoc Allow decimal max_task_wait_time in docs (#51352) 2020-01-24 08:59:43 +00:00
glossary.asciidoc [DOCS] Move snapshot-restore out of modules. (#49618) (#50829) 2020-01-09 16:55:46 -08:00
gs-index.asciidoc [DOCS] Adding index file for GS "mini book". 2017-07-18 13:44:08 -07:00
high-availability.asciidoc [DOCS] Remove leveloffset for CCR docs (#46818) 2019-09-18 09:44:43 -04:00
how-to.asciidoc
index-modules.asciidoc Deprecate creation of dot-prefixed index names except for hidden and system indices (#49959) 2020-01-28 10:01:16 -07:00
index.asciidoc [DOCS] Add top-level EQL docs page. Adds EQL requirements page. (#51334) 2020-01-27 16:04:47 -05:00
index.x.asciidoc [DOCS] Removes redundant index.asciidoc files (#30707) 2018-05-18 11:05:40 -07:00
indices.asciidoc [DOCS] Reorder index APIs alphabetically (#46981) (#47402) 2019-10-01 17:07:28 -04:00
ingest.asciidoc Replace required pipeline with final pipeline (#49470) 2019-11-22 14:37:36 -05:00
intro.asciidoc [7.x][DOCS] Updates ML links (#50387) (#50409) 2019-12-20 10:01:19 -08:00
mapping.asciidoc [DOCS] Note clause limit in `index.mapping.total_fields.limit` docs (#48153) 2019-10-18 10:20:49 -04:00
modules.asciidoc [DOCS] Move snapshot-restore out of modules. (#49618) (#50829) 2020-01-09 16:55:46 -08:00
query-dsl.asciidoc [SPATIAL] Backport new ShapeFieldMapper and ShapeQueryBuilder to 7x (#45363) 2019-08-14 16:35:10 -05:00
redirects.asciidoc [DOCS] Move snapshot-restore out of modules. (#49618) (#50829) 2020-01-09 16:55:46 -08:00
release-notes.asciidoc [DOCS] Adds placeholder for 7.5.2 release notes (#51124) 2020-01-16 14:42:24 -05:00
scripting.asciidoc [DOCS] Move 'Scripting' section to top-level navigation. (#42939) 2019-06-06 10:46:02 -04:00
search.asciidoc Use snake casing for document field (#45432) 2019-09-19 14:27:00 +02:00
setup.asciidoc [DOCS] Creates a cluster restart documentation page (#48583) 2019-11-12 14:50:53 +01:00
testing.asciidoc [Docs] Unify spelling of Elasticsearch (#27567) 2017-11-29 09:44:25 +01:00
upgrade.asciidoc [DOCS] Change prev version to 7.5 in upgrade docs (#48415) 2019-10-23 12:09:26 -05:00