elasticsearch/qa
Mayya Sharipova 080a0cdd89
Enable sort optimization on int, short and byte fields (#127968)
Before this PR sorting on integer, short and byte fields types used
SortField.Type.LONG. This made sort optimization impossible for these
field types.

This PR uses SortField.Type.INT for integer, short and byte fields. This
enables sort optimization.

There are several caveats with changing sort type that are addressed: -
Before mixed sort on integer and long fields was automatically
supported, as both field types used SortField.TYPE.LONG. Now when
merging results from different shards, we need to convert sort to LONG
and results to long values. - Similar for collapsing when there is mixed
INT and LONG sort types. - Index sorting. Similarly, before for index
sorting on integer field, SortField.Type.LONG was used. This sort type
is stored in the index writer config on disk and can't be modified. Now
when providing sortField() for index sorting, we need to account for
index version: for older indices return sort with SortField.Type.LONG
and for new indices return SortField.Type.INT.

---

There is only 1 change that  may be considered not backwards compatible:
Before if an integer field was [missing a
value](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/sort-search-results#_missing_values)
, it sort values will return Long.MAX_VALUE in a search response. With
this integer, it sort valeu will return Integer.MAX_VALUE.  But I think
this change is ok, as in our documentation, we don't provide information
what value will be returned, we just say it will be sorted last. 

---

Also closes #127965 (as same type validation in added for collapse
queries)
2025-06-03 07:50:11 +10:00
..
ccs-common-rest Add dense vector off-heap stats to Node stats and Index stats APIs (#126704) 2025-04-23 15:04:44 +01:00
ccs-rolling-upgrade-remote-cluster Add ability to redirect ingestion failures on data streams to a failure store (#126973) 2025-04-18 16:33:03 -04:00
ccs-unavailable-clusters [Build] Require reason for usesDefaultDistribution (#124707) 2025-03-17 08:25:39 +01:00
custom-rest-controller Add AGPLv3 as a supported license 2024-09-13 15:29:46 -07:00
evil-tests Remove doPrivileged uses from server (#127781) 2025-05-07 07:24:53 -07:00
full-cluster-restart Add ability to redirect ingestion failures on data streams to a failure store (#126973) 2025-04-18 16:33:03 -04:00
logging-config Remove security manager policy files (#127727) 2025-05-06 19:37:46 +02:00
logging-spi Update Gradle wrapper to 8.12 (#118683) 2024-12-30 15:34:24 +01:00
lucene-index-compatibility Increase timeout for index migration in FullClusterRestartSystemIndexCompatibilityIT (#127710) 2025-05-05 19:37:31 +02:00
mixed-cluster Non existing synonyms sets do not fail shard recovery (#125659) 2025-03-27 18:04:20 +02:00
multi-cluster-search [Build] Remove deprecated BuildParams (#116984) 2024-11-22 16:30:57 +01:00
no-bootstrap-tests Cleanup missing use of StandardCharsets (#125424) 2025-03-21 20:10:15 +01:00
packaging Restructure docker files for docker distributions (#127960) 2025-05-19 19:47:34 +02:00
remote-clusters Update Gradle wrapper to 8.12 (#118683) 2024-12-30 15:34:24 +01:00
repository-multi-version [Build] Remove deprecated BuildParams (#116984) 2024-11-22 16:30:57 +01:00
restricted-loggers Add AGPLv3 as a supported license 2024-09-13 15:29:46 -07:00
rolling-upgrade Enable sort optimization on int, short and byte fields (#127968) 2025-06-03 07:50:11 +10:00
rolling-upgrade-legacy [Gradle] Make rolling upgrade tests configuration cache compatible (#119577) 2025-01-16 23:23:04 +11:00
smoke-test-http Always log data node failures (#127420) 2025-04-29 09:40:31 -04:00
smoke-test-ingest-disabled Migrate legacy QA projects to new test clusters framework (#125545) 2025-03-26 10:05:56 -07:00
smoke-test-ingest-with-all-dependencies Migrate legacy QA projects to new test clusters framework (#125545) 2025-03-26 10:05:56 -07:00
smoke-test-multinode Use Lucene101 postings format by default (#126080) 2025-04-04 12:41:27 -07:00
smoke-test-plugins Migrate legacy QA projects to new test clusters framework (#125545) 2025-03-26 10:05:56 -07:00
stable-api Validate that stable plugins do not break compatibility (#92776) 2023-01-18 06:48:48 -05:00
system-indices [main] Move system indices migration to migrate plugin (#125437) 2025-04-04 18:49:38 +01:00
unconfigured-node-name Remove security manager policy files (#127727) 2025-05-06 19:37:46 +02:00
verify-version-constants Re-enable VerifyVersionConstantsIT (#125605) 2025-03-25 12:16:53 -07:00
build.gradle Do not create unused testCluster (#77581) 2021-09-23 03:45:59 -04:00