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

Add query inside aggregations #36

Closed
To-om opened this issue Nov 7, 2017 · 0 comments
Closed

Add query inside aggregations #36

To-om opened this issue Nov 7, 2017 · 0 comments
Assignees
Milestone

Comments

@To-om
Copy link
Contributor

To-om commented Nov 7, 2017

The aim of this feature is to add _query field in selectable aggregations (avg, min, max ,sum and count).
With this feature, it could be interesting to have several aggregations of the same type, with different filter. To prevent name collision, an optional name can be set to any aggregation.
For example:

{
  "query": { "_field": "status", "_value": "new" },
  "stats": [{
    "_agg": "time",
    "_fields": ["createdAt"],
    "_interval": "1h",
    "_name": "documentsOverTime",
    "_select": [{
        "_agg": "count",
        "_name": "LowPriorityCount",
        "_query": { "_field": "priority", "_value": "low" }
      },
      {
        "_agg": "count",
        "_name": "highPriorityCount",
        "_query": { "_field": "priority", "_value": "high" }
      }
    ]
  }]
}
@To-om To-om added this to the 1.4.0 milestone Nov 7, 2017
@To-om To-om self-assigned this Nov 7, 2017
To-om added a commit that referenced this issue Nov 7, 2017
@To-om To-om closed this as completed Nov 7, 2017
To-om added a commit that referenced this issue Nov 9, 2017
To-om added a commit that referenced this issue Nov 13, 2017
To-om added a commit that referenced this issue Nov 20, 2017
To-om added a commit that referenced this issue Nov 20, 2017
To-om added a commit that referenced this issue Nov 20, 2017
To-om added a commit that referenced this issue Dec 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant