Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregations: Allow calculation of bucket fields #127

Open
max-moser opened this issue Feb 16, 2023 · 0 comments
Open

Aggregations: Allow calculation of bucket fields #127

max-moser opened this issue Feb 16, 2023 · 0 comments
Assignees

Comments

@max-moser
Copy link
Contributor

In InvenioRDM, we would like to distinguish between record-view events that go through the API or UI via a boolean field via_api in the event.
Currently, during aggregation we can either discard events with either of the values (via_api=true/false), or discard the information from this field altogether – or we can cobble together a unique_id that separates the two kinds of events (e.g. {prefix}-{recid} where prefix would be either "ui" or "api").
In the statistics PR in app-rdm (inveniosoftware/invenio-app-rdm#2080), we went the third route for now.

Neither of these possibilities is too enticing, we would rather be able to aggregate the document counts per value inside the aggregation, similar to:

{
  "via_api": [
    {"key": true, "doc_count": 123},
    {"key": false, "doc_count": 567},
  ]
}

This would probably require a bucket_fields feature in the aggregations, similar to the metric_fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant