Elasticsearch continues to improve on sorting speed for field types, with version 9.0.1 now having accelerated float/half_float sorting. Additionally, the upcoming Elasticsearch 9.1 will also include enhancements that will deliver remarkable latency improvements in integer sorting.
Not only are these new sorting enhancements available in Elastic Cloud Serverless, they will be backported to Elasticsearch 8.19, allowing customers not yet ready to move to Elasticsearch 9.x to also benefit from improved sorting speed.
Using 2 different benchmarks, we see a wide array of improved latencies:
- NYC Taxis for float and half_float sorting: 83x to 920x
- Http_logs for integer sorting: 41x to 531x
Check out our nightly benchmarks for http_logs here. (Note: additional sort latencies were added to the benchmarks in May 2025).
Background
In 2020, with Elasticsearch 7.6, we made a significant investment in optimizing sort on long and date field types. As a result of this, for example, retrieving logs sorted by recent timestamps became much faster. We followed this optimization with an enhancement in 7.16 where we enabled search_after parameter (which enabled the common pagination use case).
This time, we are applying the same optimization to integer, short, and byte field types, as well as float and half_float field types.
Depending on your data and its distribution across segments, you may observe speedups ranging from a few to several hundred times for sorted queries on integer, short, byte, float and half_float data types.
How do we do it?
Instead of relying on index sorting, we employed the novel approach of combining BKD (Block k-dimensional) Trees with distance queries. BKD Trees have leaf blocks properties that lend themselves to being skipped since the field min and max values of the block are available for comparison.
Combining this with using the distance_feature query, we can rapidly determine during comparison which blocks are non-competitive. This enables significant time savings as we skip non-competitive data regions.
Whether we measure the distance from the global minimum or maximum depends on whether we are sorting ascending or descending.
This implies that the field must be indexed and cannot be null.
Further details can be found in a previous blog on optimizing sort queries.
Now on to the results….
Results
NYC Taxis benchmark
On the NYC Taxis benchmark (with half_float added), the speedup range is from 83x to 920x (calculated by dividing the prior P90 latency with the new P90 latency):

Visually, in log scale, we see the significant improvement:

This acceleration in sorting of float, half_float is already available in Elasticsearch 9.0.1 and is also available in Elastic Cloud Serverless. It will be backported to Elasticsearch 8.19.
Http_logs benchmark
We used the http_logs track from the open-source Rally tool. We ran with the default settings available here.
For the improvements in integer sort, we see speedups between 41x and 531x in the http_logs benchmark (again calculated by dividing the prior P90 latency with the new P90 latency) across eight different use cases.

Again, we see the stark improvement contrast even in log scale:


The improvement in integer sorting is dramatic according to our nightly benchmarks, replicated here:


A whole host of use cases benefit from this speedup, including analytics dashboards in Observability, Security and Search. Lower latencies also lead to more efficient computation and lower infrastructure costs for users.
Looking forward to Elasticsearch 9.1
Elastic 9.1 will also include other exciting enhancements, including but not limited to:
- ES|QL Full Text Search (MATCH, QSTR, scoring) GA
- Linear Retrievers (Advancing Hybrid Search)
- ACORN-1 performance improvement for HNSW
- How early termination leads to faster Approximate KNN Search
We’re committed to continuous innovation so you can build the fastest search apps.
Ready to try this out on your own? Start a free trial.
Want to get Elastic certified? Find out when the next Elasticsearch Engineer training is running!
Related content

December 22, 2025
Influencing BM25 ranking with multiplicative boosting in Elasticsearch
Learn why additive boosting methods can destabilize BM25 rankings and how multiplicative scoring provides controlled, scalable ranking influence in Elasticsearch.

December 19, 2025
Elasticsearch Serverless pricing demystified: VCUs and ECUs explained
Learn how Elasticsearch Serverless pricing works for Elastic’s fully-managed deployment offering. We explain VCUs (Search, Ingest, ML) and ECUs, detailing how consumption is based on actual allocated resources, workload complexity, and Search Power.

December 17, 2025
Boosting e-commerce search by profit and popularity with the function score query in Elasticsearch
Discover how to optimize e-commerce search by blending BM25 relevance with profit margin and popularity signals in Elasticsearch using the function_score query.

December 16, 2025
Reducing Elasticsearch frozen tier costs with Deepfreeze S3 Glacier archival
Learn how to leverage Deepfreeze in Elasticsearch to automate searchable snapshot repository rotation, retaining historical data and aging it into lower cost S3 Glacier tiers after index deletion.

December 11, 2025
Evaluating search query relevance with judgment lists
Explore how to build judgment lists to objectively evaluate search query relevance and improve performance metrics such as recall, for scalable search testing in Elasticsearch.