opensearch-project / OpenSearch

🔎 Open source distributed and RESTful search engine.
https://opensearch.org/docs/latest/opensearch/index/
Apache License 2.0
9.62k stars 1.76k forks source link

[Feature Request] Generic Numeric Type Converters for Numeric Field Data #14657

Closed sarthakaggarwal97 closed 1 month ago

sarthakaggarwal97 commented 3 months ago

Is your feature request related to a problem? Please describe

With an ongoing introduction of Star Tree (Composite Field), there was a requirement to convert the sortable long value of a field to an original numeric type value in order to perform aggregations via star tree.

Currently, we picked up different numeric conversions for different numeric types to incorporate for star tree. This is prone to inconsistent results in cases where the type conversion implementation changes in the original aggregation flow.

Describe the solution you'd like

A generic utility to perform numeric type conversion across OpenSearch. This will become a one-stop utility for numeric conversions.

Related component

Indexing

mgodwan commented 3 months ago

A generic utility to perform numeric type conversion across OpenSearch. This will become a one-stop utility for numeric conversions.

Won't using this utility still be an opt-in. Can we bake something to achieve this within the contract for these mappers?