Basically, I'd like to be able to aggregate a field of an array of
observations, grouped by an ancestor/parent id.
So for example (see gist): Aggregate the timings per contestant across a
set of contests.
I realise that the data can be structured differently - effectively
flattened to a document per contest-contestant-contest.
However, I don't have the luxury of doing this in the real-world case.
Basically, I'd like to be able to aggregate a field of an array of
observations, grouped by an ancestor/parent id.
So for example (see gist): Aggregate the timings per contestant across a
set of contests.
I realise that the data can be structured differently - effectively
flattened to a document per contest-contestant-contest.
However, I don't have the luxury of doing this in the real-world case.
Basically, I'd like to be able to aggregate a field of an array of
observations, grouped by an ancestor/parent id.
So for example (see gist): Aggregate the timings per contestant across a
set of contests.
I realise that the data can be structured differently - effectively
flattened to a document per contest-contestant-contest.
However, I don't have the luxury of doing this in the real-world case.
Basically, I'd like to be able to aggregate a field of an array of
observations, grouped by an ancestor/parent id.
So for example (see gist): Aggregate the timings per contestant across a
set of contests.
I realise that the data can be structured differently - effectively
flattened to a document per contest-contestant-contest.
However, I don't have the luxury of doing this in the real-world case.
I'm wondering why, in the solution, the mapping doesn't include the data
node in the tree.
In fact when I explicitly state the data node as a property of contestant,
the aggregations come back blank.Gist:
many thanks!
On Wednesday, 2 April 2014 18:31:29 UTC+1, Mark Harwood wrote:
Basically, I'd like to be able to aggregate a field of an array of
observations, grouped by an ancestor/parent id.
So for example (see gist): Aggregate the timings per contestant across a
set of contests.
I realise that the data can be structured differently - effectively
flattened to a document per contest-contestant-contest.
However, I don't have the luxury of doing this in the real-world case.
I thought it may be useful to summarise what we're trying to do:
Let the document structure be:
contest:
contestant: // [array]
id: string
data: // [array]
run: integer // note that I've added this to highlight one of our
usecases
timing: integer
// ... other attributes
We don't have control of this structure. Clients of our service are free to
define it as they wish (hence, I guess we need to use dynamic templates to
define the mappings).
The structure may be *arbitrarily *deep, with nested array types.
The types of aggregations the client would like to make:
find total of timing by contestant id (explained very nicely with your
answer)
find average of timing across all contestants by run. In this case the
grouping is by "run"
I can see how to each of the above, albeit with different mappings. What's
required is one mapping a flexible way to do both (ideally with full Kibana
support).
thanks
Fuzz.
On Thursday, 3 April 2014 16:53:02 UTC+1, dazraf wrote:
Hi Mark,
thanks again for helping with this.
I'm wondering why, in the solution, the mapping doesn't include the data
node in the tree.
In fact when I explicitly state the data node as a property of contestant,
the aggregations come back blank.Gist: Why doesn't this mapping work? · GitHub
many thanks!
On Wednesday, 2 April 2014 18:31:29 UTC+1, Mark Harwood wrote:
Basically, I'd like to be able to aggregate a field of an array of
observations, grouped by an ancestor/parent id.
So for example (see gist): Aggregate the timings per contestant across
a set of contests.
I realise that the data can be structured differently - effectively
flattened to a document per contest-contestant-contest.
However, I don't have the luxury of doing this in the real-world case.
I thought it may be useful to summarise what we're trying to do:
Let the document structure be:
contest:
contestant: // [array]
id: string
data: // [array]
run: integer // note that I've added this to highlight one of our
usecases
timing: integer
// ... other attributes
We don't have control of this structure. Clients of our service are free to
define it as they wish (hence, I guess we need to use dynamic templates to
define the mappings).
The structure may be *arbitrarily *deep, with nested array types.
Some example of the types of aggregations the client would like to make:
find total of timing by contestant id (explained very nicely with your
answer)
find average of timing across all contestants by run. In this case the
grouping is by "run"
I can see how to carry out each of the above, albeit with distinct
mappings. However, what's we need is one mapping that can do both queries
(ideally one that works with Kibana).
thanks
Fuzz.
On Thursday, 3 April 2014 16:53:02 UTC+1, dazraf wrote:
Hi Mark,
thanks again for helping with this.
I'm wondering why, in the solution, the mapping doesn't include the data
node in the tree.
In fact when I explicitly state the data node as a property of contestant,
the aggregations come back blank.Gist: Why doesn't this mapping work? · GitHub
many thanks!
On Wednesday, 2 April 2014 18:31:29 UTC+1, Mark Harwood wrote:
Basically, I'd like to be able to aggregate a field of an array of
observations, grouped by an ancestor/parent id.
So for example (see gist): Aggregate the timings per contestant across
a set of contests.
I realise that the data can be structured differently - effectively
flattened to a document per contest-contestant-contest.
However, I don't have the luxury of doing this in the real-world case.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.