elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
995 stars 24.82k forks source link

Remove usage of SortedSetDocValues#NO_MORE_ORDS #88004

Open jpountz opened 2 years ago

jpountz commented 2 years ago

Description

Lucene's SortedSetDocValues got a new SortedSetDocValues#docValueCount API that allows getting the number of values of a document without iterating through all values. We should change the iteration logic to use this count and consume count ords instead of iterating all ords until NO_MORE_ORDS is returned.

This should speed up some queries, e.g. value_count aggregations through the refactoring of FieldData#toString(SortedSetDocValues) to not iterate through all values to figure out the number of values.

elasticmachine commented 2 years ago

Pinging @elastic/es-search (Team:Search)

elasticmachine commented 2 years ago

Pinging @elastic/es-analytics-geo (Team:Analytics)

wchaparro commented 1 year ago

Added to: https://github.com/elastic/elasticsearch/issues/65019

elasticsearchmachine commented 3 months ago

Pinging @elastic/es-analytical-engine (Team:Analytics)

elasticsearchmachine commented 3 months ago

Pinging @elastic/es-search-foundations (Team:Search Foundations)