elasticsearch icon indicating copy to clipboard operation
elasticsearch copied to clipboard

Don't use fielddataBuilder to test for aggregatability

Open romseygeek opened this issue 3 years ago • 2 comments

The current default implementation of isAggregatable on MappedFieldType tries to construct a field data builder, and returns true or false depending on whether an exception was thrown during construction. This is fairly fragile, and is becoming increasingly so with the introduction of field data contexts, so that a non-aggregatable field type may in fact provide field data to scripts.

This commit changes the default implementation to check for docvalues instead of directly building a fielddata builder, and adds checks to MapperTestCase that verify these implementations work correctly.

romseygeek avatar Sep 21 '22 11:09 romseygeek

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

elasticsearchmachine avatar Sep 21 '22 11:09 elasticsearchmachine

Well. Jenkins is panicing a bit. So maybe not that easy.

nik9000 avatar Sep 21 '22 11:09 nik9000

@elasticmachine run elasticsearch-ci/part-1

romseygeek avatar Sep 22 '22 13:09 romseygeek

@elasticmachine update branch

romseygeek avatar Sep 23 '22 11:09 romseygeek