Skip to content

composite aggregation filter (#15) #16

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

Merged
merged 3 commits into from
Jan 9, 2023

Conversation

benwalch
Copy link
Member

@benwalch benwalch commented Jan 5, 2023

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Fixed tickets #15, partially

This PR provides a composite filter / aggregation.

This filter works exactly like the aggregation filter, except the fields on which should be aggregated / filtered, which can be a combination of multiple fields.

Example:

->addFilterDefinition([
    'name'          => 'my_composite_agg'
    'type'          => 'composite_aggregation',
    'configuration' => [
        'fields'              => ['field1', 'field2, 'fieldX', ...],
        'separator'       => '--' // default: '__',
        ...
    ]
])

The composite fields will be aggregated as follows

"filter": [
    {
        "name": "my_composite_agg",
        ...
        "values": [
            {
                "value": "field1valueA--field2valueB--fieldXvalueC",
                ...
            },
            {
                "value": "field1valueK--field2valueB--fieldXvalueY",
                ...
            },
            ...

@solverat solverat force-pushed the feature/composite-aggregation-filter branch from b5d4ce4 to df12e7f Compare January 5, 2023 14:44
@benwalch benwalch force-pushed the feature/composite-aggregation-filter branch from df12e7f to 013a3de Compare January 5, 2023 15:33
@benwalch benwalch requested a review from solverat January 9, 2023 08:27
@benwalch benwalch merged commit 628f02d into master Jan 9, 2023
@solverat solverat deleted the feature/composite-aggregation-filter branch January 9, 2023 15:02
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 this pull request may close these issues.

2 participants