nicco
(nicco)
August 18, 2011, 12:11pm
1
Hi everyone I have a question:
I have a data structure to map invoices and for each invoice i store
its currency and the total amount:
{
"document": {
properties: {
currencycode: {type: "string", index: "not_analyzed",
include_in_all: false},
total: {type: "double"},
....
}
}
}
I would like to create a facets that will return me the totals for the
invoices divided by currencies:
EUR : 20300
USD : 13300
.....
Is it possible?
Thanks!
Ivan
(Ivan Brusic)
August 18, 2011, 8:15pm
2
Sounds like you want the term stats facets
Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.
currencycode will be the term facet and total will be the value_field
--
Ivan
On Thu, Aug 18, 2011 at 8:11 AM, nicco nicco82@gmail.com wrote:
Hi everyone I have a question:
I have a data structure to map invoices and for each invoice i store
its currency and the total amount:
{
"document": {
properties: {
currencycode: {type: "string", index: "not_analyzed",
include_in_all: false},
total: {type: "double"},
....
}
}
}
I would like to create a facets that will return me the totals for the
invoices divided by currencies:
EUR : 20300
USD : 13300
.....
Is it possible?
Thanks!
nicco
(nicco)
August 22, 2011, 8:43am
3
Works perfectly thanks you!
On Aug 18, 10:15 pm, Ivan Brusic i...@brusic.com wrote:
Sounds like you want the term stats facetshttp://www.elasticsearch.org/guide/reference/api/search/facets/terms-...
currencycode will be the term facet and total will be the value_field
--
Ivan
On Thu, Aug 18, 2011 at 8:11 AM, nicco nicc...@gmail.com wrote:
Hi everyone I have a question:
I have a data structure to map invoices and for each invoice i store
its currency and the total amount:
{
"document": {
properties: {
currencycode: {type: "string", index: "not_analyzed",
include_in_all: false},
total: {type: "double"},
....
}
}
}
I would like to create a facets that will return me the totals for the
invoices divided by currencies:
EUR : 20300
USD : 13300
.....
Is it possible?
Thanks!