sort_by=calories&group_by=team&filter[campaign]=au-123,au-456&filter[date_start]=2015-01-01&filter[date_end]=2015-01-01 This should group by team_page_id on the document
[
{
team: {
name: 'Team abc',
url: 'http://def',
team_page_id: 123,
},
calories: 12345, (calories)
doc_count: 50, (number of activities),
elevation: 4567, (meters)
distance: 1234, (meters)
time: 12345, (seconds)
},
{
team: {
name: 'Team hello',
url: 'http://hi',
team_page_id: 1234,
},
calories: 12345,
doc_count: 50,
elevation: 4567,
distance: 1234,
time: 12345
},
{
team: {
name: 'Team 123456',
url: 'http://hi there',
team_page_id: 1234,
},
calories: 12345,
doc_count: 50,
elevation: 4567,
distance: 1234,
time: 12345
}
]
sort_by=calories&group_by=page&filter[team_page_id]=456&filter[campaign]=au-123,au-456&filter[date_start]=2015-01-01&filter[date_end]=2015-01-01
This should group by page_id on the document. in this case we're filtering to a specific team. It should filter to activities with team_page_id=456
[
{
page: {
name: 'My abc',
url: 'http://def',
id: 123
},
calories: 12345, (calories)
doc_count: 50, (number of activities),
elevation: 4567, (meters)
distance: 1234, (meters)
time: 12345, (seconds)
},
{
page: {
name: 'Page hello',
url: 'http://hi',
id: 456
},
calories: 12345,
doc_count: 50,
elevation: 4567,
distance: 1234,
time: 12345
},
{
page: {
name: 'Page 123456',
url: 'http://hi there',
id: 123
},
calories: 12345,
doc_count: 50,
elevation: 4567,
distance: 1234,
time: 12345
}
]