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 <[email protected]> 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 [email protected].
> 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 [email protected].
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.

Reply via email to