Skip to content

feat(search): graph search query endpoint with aggregations - #3211

Draft
dschmidt wants to merge 6 commits into
feat/search-tika-facetsfrom
feat/graph-search-query
Draft

feat(search): graph search query endpoint with aggregations#3211
dschmidt wants to merge 6 commits into
feat/search-tika-facetsfrom
feat/graph-search-query

Conversation

@dschmidt

@dschmidt dschmidt commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

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/query with terms, range, metric and nested sub-aggregations, on both the bleve and OpenSearch backends.

Stacked on #3198. Three commits: vendored SDK regen, bleve aggregations, opensearch aggregations.

Caveats

Note

Even once this PR and #3210 (honest has-preview + thumbnails relationship) are both merged, search hits still won't carry thumbnails — the $expand=thumbnails wiring for /search/query hits builds on both PRs and currently only exists on the consolidation branch (dschmidt/opencloud@feat/graph-search-full-2, commit 0d94199a: searchEntityThumbnailSet in searchquery.go, preview presence via thumbnail.HasPreviewForMimeType + indexed oc.preview/image-facet dimensions). It needs a follow-up PR once both are in.

dschmidt added 3 commits July 30, 2026 22:00
…egations

Rebased dschmidt/libre-graph-api feat/graph-search-full (PR #34) onto
opencloud-eu main and regenerated via the repo's woodpecker build-go recipe
(openapi-generator v7.23.0, --api-name-suffix Api).
Adds the graph /v1beta1/search/query endpoint, the aggregation proto messages,
the service-layer aggregation forwarding/merging, and the recursive bleve
aggregation implementation (terms, range, metric, sub-aggregations).
Implements terms, range, metric and sub-aggregations for the OpenSearch backend
via a dedicated aggs builder, wiring them through the shared search service.
@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

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.

Range aggregations parsed from/to with ParseFloat only, so date bounds on
datetime fields like photo.takenDateTime silently degraded to unbounded
numeric ranges. Detect date-formatted bounds (RFC3339 or YYYY-MM-DD),
switch the facet to bleve date ranges and read DateRanges from the facet
result. Malformed bounds in date mode are rejected.
Metric aggregations (sum/min/max/avg) only worked as sub-aggregations
under a terms bucket. Compute top-level metrics by folding the matched
hits through the existing accumulator and allow them through the graph
layer's numeric field validation.
The cross-space merge only carried buckets, dropping metric results
(value/metricKind) from the per-space responses. Reduce metrics with
their kind's reducer, keyed by field and kind.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant