mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 09:28:55 -04:00
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) |
||
---|---|---|
.. | ||
ccs-common-rest | ||
ccs-rolling-upgrade-remote-cluster | ||
ccs-unavailable-clusters | ||
custom-rest-controller | ||
evil-tests | ||
full-cluster-restart | ||
logging-config | ||
logging-spi | ||
lucene-index-compatibility | ||
mixed-cluster | ||
multi-cluster-search | ||
no-bootstrap-tests | ||
packaging | ||
remote-clusters | ||
repository-multi-version | ||
restricted-loggers | ||
rolling-upgrade | ||
rolling-upgrade-legacy | ||
smoke-test-http | ||
smoke-test-ingest-disabled | ||
smoke-test-ingest-with-all-dependencies | ||
smoke-test-multinode | ||
smoke-test-plugins | ||
stable-api | ||
system-indices | ||
unconfigured-node-name | ||
verify-version-constants | ||
build.gradle |