appbaseio / appbaseio/reactivesearch
Multi-list with "complex" aggregation query
- Dominant language
- JavaScript
- Stars
- 4.9k
- Forks
- 478
- PR merge metrics
- No merged PRs in 30d
Description
**Affected Projects**
Vue.JS
**Is your feature request related to a problem? Please describe.**
I would like to create separate aggregations on the same field using nested aggregations with a filter.
**Describe the solution you'd like**
Either an expansion of the multi-list component that allows for more control over the aggregation query or a separate component that can handle this use-case.
**Describe alternatives you've considered**
I have looked into extending the MultiList component conform https://docs.appbase.io/docs/reactivesearch/vue/list/MultiList/#extending. However this does not provide enough control.
**Additional context**
Hereby a sample query:
```
GET _search
{
"aggs": {
"continent": {
"nested": {
"path": "subjects"
},
"aggs": {
"inner": {
"filter": {
"bool": {
"must": [
{
"term": {
"subjects.typeId.keyword": "subjectType:sYdC11MLUoxrAGt24dGw"
}
}
]
}
},
"aggs": {
"subjects.id.keyword": {
"terms": {
"field": "subjects.name.keyword",
"size": 10,
"order": {
"_term": "asc"
}
}
}
}
}
}
}
},
"size": 0
}
```
Contributor guide
Research direction
Start with the MultiList extension documentation linked in the issue and inspect how it builds aggregation queries. Compare that behavior with the supplied nested, filtered aggregation example; done should mean a documented component approach can express separate aggregations on the same field.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, search
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100