Add a best_speed value for index.codec setting #71788
Labels
>enhancement
:Search Foundations/Mapping
Index mappings, including merging and defining field types
Team:Search Foundations
Meta label for the Search Foundations team in Elasticsearch
ES lets you configure codec compression via the "index.codec" setting and/or via a MapperService. You can use "default" or "best_compression", but you can't use "best_speed". I'd really like a way to set "best_speed" and have it apply to binary doc values. This would really simplify the elastiknn plugin, which uses binary doc values to store vectors. Currently I'm implementing my own EngineFactory, just to provide a CodecService which uses the default Lucene87Codec to encode binary doc values. Providing my own EngineFactory actually seems to interfere with some other Elasticsearch functionality. Instead, it would be a lot better and simpler to do one of two things:
new Lucene87Codec(BEST_SPEED)
.Some related observations:
Binary doc values are hard-coded to use best compression: code
Lucene 8.8 recently added a BEST_SPEED setting which makes a big difference for binary doc values. Best speed is actually the default for Lucene87Codec: code
Not sure if it's intentional, but if the MapperService is null, ES will actually use BEST_SPEED: code (since the default constructor for the 87 codec uses BEST_SPEED).
You can technically already do this by setting index.codec to
lucene_default
, again because the default constructor uses BEST_SPEED, but there are several places in the docs which discourage users from usinglucene_default
outside of testing.The text was updated successfully, but these errors were encountered: