feat(search): graph search query endpoint with aggregations - #3211
feat(search): graph search query endpoint with aggregations#3211dschmidt wants to merge 7 commits into
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 446 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Follow-up: narrow
|
1b61ef6 to
fb1e41b
Compare
c54ffe7 to
cc3e6f4
Compare
cc3e6f4 to
af951f6
Compare
08eddc9 to
ceb7df5
Compare
2513263 to
71ca404
Compare
fef1116 to
7f7ecbf
Compare
Generated from opencloud-eu/libre-graph-api#34 rebased onto main: POST /search/query with hits, aggregations and metrics.
MS-Graph-style search query endpoint: hits from all accessible spaces, with from/size paging, remote items for hits from shared spaces, thumbnails on $expand, and the effective permission actions on every hit. The search proto gains the aggregation types of the graph API and the endpoint passes aggregations through to the search service, which does not evaluate them yet.
beae60b to
654fba0
Compare
Outdated: metrics and sub-aggregations are folded from doc values by |
654fba0 to
b2296c5
Compare
Term buckets on both engines: bleve facets, OpenSearch terms aggregations, buckets merged across spaces and post-processed per BucketDefinition (minimum count, sort, size). Terms aggregations on numeric fields are rejected at the graph endpoint. Pinned in the parity suite as AGG-01 to AGG-03. Ranges, metrics and sub-aggregations are declined until the engines evaluate them.
Numeric and date ranges on both engines: bleve numeric and date-time range facets, OpenSearch range and date_range aggregations, a bound that is neither number nor date is rejected. A terms aggregation on a numeric field now points to ranges as the alternative. AGG-04, 05 and 07 to 09 in the parity suite.
Sum, min, max and avg on both engines. bleve facets cannot compute, so a collector hooked into the document-match handler folds the metric from doc values, one pass over every match, before the top-n cut. Avg travels as sum and count so the service can reduce it across spaces. AGG-06 in the parity suite.
Sub-aggregations on both engines. bleve folds child buckets from doc values through the same collector as the metrics, terms and ranges alike; the service unions nested buckets across spaces. AGG-10 to AGG-16 in the parity suite.
Every bucket carries an opaque aggregationFilterToken; a search request can pass tokens back as aggregationFilters. The service decodes them into KQL fragments once, the engines AND them into the query as exact, case-sensitive matches.
b2296c5 to
be68afb
Compare
This contains a huge libre-graph-api-go bump - so please don't be alarmed about the size of the diff
MS-Graph-style
POST /graph/v1beta1/search/querywith terms, range, metric and nested sub-aggregations, on both the bleve and OpenSearch backends.Stacked on #3198.
Caveats
libre-graph-api-gois interim, generated from feat: add search query endpoint with request examples libre-graph-api#34 rebased onto main. Proper path: land that spec PR upstream (feat: add search query endpoint with request examples libre-graph-api#34) and pin a released version.artist -> album -> sum(duration)).Note
Even once this PR and #3210 (honest has-preview + thumbnails relationship) are both merged, search hits still won't carry thumbnails — the
$expand=thumbnailswiring for/search/queryhits builds on both PRs and currently only exists on the consolidation branch (dschmidt/opencloud@feat/graph-search-full-2, commit0d94199a:searchEntityThumbnailSetinsearchquery.go, preview presence viathumbnail.HasPreviewForMimeType+ indexedoc.preview/image-facet dimensions). It needs a follow-up PR once both are in.