Files
opencloud/services
Dominik Schmidt fef1116ec8 feat(search): fold bleve metrics and nested aggregations from doc values
Bleve has count facets only: no metric and no nested facet. So far a
metric or a sub-aggregation widened the page to every match and loaded
all stored fields of each, then folded the hits in Go. The stored
document, extracted text included, was decoded for every match: about
1s and 780MB per 100k matches, independent of the nesting depth.

Metrics and nested aggregations now go through an aggCollector hooked
into bleve's collector walk via the document-match-handler context key.
For every match it visits the doc values of the aggregated fields, the
columnar storage bleve's own facets read, and folds them into an
accumulator tree. The page stays the size the caller asked for and no
stored field is loaded for an aggregation: 7x faster and 80x less memory
at 100k matches, within 1.4x of a native bleve facet.

Flat terms and range aggregations stay bleve facets. A range parent now
carries its sub-aggregations too (the hit fold matched range bucket
names against raw values and never attached them), and multi-valued
fields count each value like a bleve facet does.

The parity suite renders nested results and pins them on both engines:
terms in terms, metrics per bucket, terms in numeric and date ranges,
three levels, a page of one still aggregating every match, and a
malformed bound in a nested range.
2026-09-09 03:05:07 +00:00
..
2026-09-06 23:16:18 +00:00
2026-08-18 17:17:30 +02:00
2026-06-03 16:28:44 +02:00
2026-08-03 13:20:03 +02:00
2026-09-03 23:17:09 +00:00
2026-07-14 18:12:24 +02:00
2026-09-06 23:16:18 +00:00
2026-06-18 15:05:49 +02:00
2026-08-25 09:55:39 +02:00