Scripted histogram facets

Hi everyone,

I'm trying to figure out how to do an histogram facet :

{
"query" : {
"match_all" : {}
},
"facets" : {
"histo1" : {
"histogram" : {
"field" : "field_name",
"interval" : 100
}
}
}
}

where the field is, in fact, the substraction of two fields.

I have a native script that works wonder for a terms facet, but I can't
seem to find how I should apply it for an Histogram facet.
A terms facet return too many differentes results.

I could, In the native script, create the buckets myself and use a tems
facet anyway (thus mimicking an histogram), but it seems an ugly way to
achieve what I want (and maybe a bit expensive..I think).

I'd prefer using an Histogram facet, as that's what they are here for.

Is it possible? Did I miss something?

Any infos on the matter would be tremendously useful.
Thanks.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/422de6b5-fd32-4d31-8619-dd969f943cb9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

I don't know much about facets, but the new histogram aggregation supports
scripts, maybe you can try it out?

On Tue, Dec 2, 2014 at 2:49 PM, DH ciddp195@gmail.com wrote:

Hi everyone,

I'm trying to figure out how to do an histogram facet :

{
"query" : {
"match_all" : {}
},
"facets" : {
"histo1" : {
"histogram" : {
"field" : "field_name",
"interval" : 100
}
}
}
}

where the field is, in fact, the substraction of two fields.

I have a native script that works wonder for a terms facet, but I can't
seem to find how I should apply it for an Histogram facet.
A terms facet return too many differentes results.

I could, In the native script, create the buckets myself and use a tems
facet anyway (thus mimicking an histogram), but it seems an ugly way to
achieve what I want (and maybe a bit expensive..I think).

I'd prefer using an Histogram facet, as that's what they are here for.

Is it possible? Did I miss something?

Any infos on the matter would be tremendously useful.
Thanks.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/422de6b5-fd32-4d31-8619-dd969f943cb9%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/422de6b5-fd32-4d31-8619-dd969f943cb9%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Adrien Grand

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j5fcKSUOq%3Dsi4zv_%2Bi4g%3DwF93w1r7heb1YiyqD_qxmncQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hi, and thanks for the reply.

I should have said that, for reasons I (sadly) have no power over, I'm
stuck with ES v0.90.5, and thus don't get to use those impressives
aggregations.
I'm beginnig to think that the only way of doing what I want is indeed
using a native script that will carve my buckets for me.
Thanks, anyway !

Le mardi 2 décembre 2014 14:49:40 UTC+1, DH a écrit :

Hi everyone,

I'm trying to figure out how to do an histogram facet :

{
"query" : {
"match_all" : {}
},
"facets" : {
"histo1" : {
"histogram" : {
"field" : "field_name",
"interval" : 100
}
}
}
}

where the field is, in fact, the substraction of two fields.

I have a native script that works wonder for a terms facet, but I can't
seem to find how I should apply it for an Histogram facet.
A terms facet return too many differentes results.

I could, In the native script, create the buckets myself and use a tems
facet anyway (thus mimicking an histogram), but it seems an ugly way to
achieve what I want (and maybe a bit expensive..I think).

I'd prefer using an Histogram facet, as that's what they are here for.

Is it possible? Did I miss something?

Any infos on the matter would be tremendously useful.
Thanks.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/261641b7-e7a3-411d-b055-ce4f66b1008b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.