sergehuber opened a new pull request, #926:
URL: https://github.com/apache/unomi/pull/926

   ## Summary
   Fixes [UNOMI-1018](https://issues.apache.org/jira/browse/UNOMI-1018): 
aggregate queries now return date and range buckets on both Elasticsearch and 
OpenSearch.
   
   **Reading results (both engines)**
   - One helper reads every bucket type Unomi builds: string, long and double 
terms, date histograms, and numeric, date and IP ranges.
   - Range buckets were ignored on both engines. OpenSearch also ignored date 
histograms and long terms.
   - Elasticsearch reported terms on a plain numeric field under a `null` key.
   - IP range requests cannot carry a key on either client, so IP buckets are 
reported under the key of the `IpRange` they were built from.
   
   **Building requests (OpenSearch)**
   - The date histogram rejected the short interval format (`1M`, the default, 
or `1d`). It now maps the interval the same way Elasticsearch does.
   - An open-ended date range sent an empty bound and failed. Missing bounds 
are now left out.
   - An IP range's key (a result label) was sent as its CIDR mask. It is now 
sent as from/to, like Elasticsearch.
   
   **Tests (`PersistenceServiceIT`)**
   - New `testDateAndRangeAggregatesReturnBuckets`: a date histogram with the 
`1d` format (including an empty day), a numeric range with `_filtered`, and a 
date range open at both ends.
   - The other-tenant check from UNOMI-1014: another tenant's `_all` only 
counts its own items.
   - IP ranges are not covered by an IT: no default mapping has an `ip` field.
   
   Not changed: `InMemoryPersistenceServiceImpl` (test code) keeps its own 
aggregate behaviour.
   
   ## Test plan
   - [x] `PersistenceServiceIT` on Elasticsearch (10/10)
   - [x] `PersistenceServiceIT` on OpenSearch (10/10)
   - [ ] Full IT suite on Elasticsearch
   - [ ] Full IT suite on OpenSearch
   - [ ] CI
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to