So I have an index containing a 82 documents like the following (sample
data to familiarise me with the api).
{"_index":"foo","_type":"bar","_id":"3675293","_score":1.0, "_source" : {
"companyId": 3675293,
"companyName": "ABC",
"companyOwner": {
"ownerFirstName": "Billy",
"ownerLastName": "Jean"
},
"created": "2013-05-22T13:45:49",
"accounts": [
{
"year": 2013,
"amount": 1.0,
"currency": "GBP"
},
{
"year": 2012,
"amount": 1.0,
"currency": "GBP"
}
]
}}
The problem I have is that I'm trying to total all of the amounts. When I
use a Statistical Facet via the NEST .Net client I get an answer I wouldn't
expect.
82 documents, each with a collection containing 2 amount of £1 in my mind
aggregates to a total of 2 X 82 = 164. However, the facet returns a total
of 82. When I change one of the amounts in each of the two documents to be
2 instead of 1, I get the correct result.
Does Elastic Search only aggregate unique numerical values per document?
Can this be overriden?
The above isn't the real world example, but the collection will contain a
monetary field which I need to aggregate for all matching documents, and
the amounts in the collection for one or more items may match. I need to
aggreate everything, not just distinct values. Is this possible?
Incidentally I'm using the NEST .Net client if that has any bearing.
Thanks
Regards
Tim
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.