opensearch-project / OpenSearch

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

[Star Tree ] Handle unsigned long during flush and merge operations #16645

Open Shailesh-Kumar-Singh opened 1 week ago

Shailesh-Kumar-Singh commented 1 week ago

Is your feature request related to a problem? Please describe

Parent issue - [Star tree] Handle 'unsigned long' as part of star tree #15231

During flush and merge operations, unsigned long values in number fields are stored as Java.Long. When the unsigned long exceeds Long.MAX_VALUE, the value becomes negative, causing issues with comparison.

Describe the solution you'd like

Numeric dimensions now include an isUnsignedLong flag to indicate whether the value is unsigned, which impacts sorting and comparison operations. During sorting, Long.compareUnsigned is used to handle unsigned long values, ensuring that they are correctly compared even when they exceed the maximum value of a signed long.

Related component

Indexing

Describe alternatives you've considered

No response

Additional context

No response