Hi Mark, This is unfortunately a known limitation of histograms today: they only work with integer intervals.
https://github.com/elasticsearch/elasticsearch/issues/4847 On Mon, Oct 27, 2014 at 1:17 PM, LiquidMark <[email protected]> wrote: > Hi, the following query (note bolded line): > > { > "query": { > "filtered": { > "query": { > "term": { > "self_and_ancestors": "diamonds" > } > }, > "filter": { > "terms": { > "attr_types.diamond#color": [ > "0000d" > ] > } > } > } > }, > "sort": [ > { > "sell_offer_cents": { > "order": "asc" > } > } > ], > "fields": "_source", > "script_fields": { > "gap_cents": { > "script": "custom_score_item_bid_ask_gap", > "params": { > "individual_price_item_ids": [], > "individual_price_item_cents": [], > "pb_amount_below_cents": 0 > }, > "lang": "native" > } > }, > "aggs": { > "all_items": { > "global": {}, > "aggs": { > "gem#carats": { > "filter": { > "terms": { > "attr_types.diamond#polish": [ > "0000ex", > "0001vg" > ] > } > }, > "aggs": { > "gems#carats": { > "histogram": { > "field": "attr_types.gem#carats", > * "interval": 0.1,* > "min_doc_count": 0 > } > }, > "gem#carats_stats": { > "stats": { > "field": "attr_types.gem#carats" > } > } > } > } > } > } > } > } > > Gives the following error: > > { > "error": "SearchPhaseExecutionException[Failed to execute phase > [query], all shards failed; shardFailures > {[D6h8GKwjRqO_Yem09Hu_VA][development-liquidibles::application-items][4]: > QueryPhaseExecutionException[[development-liquidibles::application-items][4]: > query[filtered(filtered(self_and_ancestors:diamonds)->cache(attr_types.diamond#color:0000d))->cache(_type:item)],from[0],size[10],sort[<custom:\"sell_offer_cents\": > org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@11ce49a>]: > Query Failed [Failed to execute global aggregators]]; nested: > ArithmeticException; > }{[D6h8GKwjRqO_Yem09Hu_VA][development-liquidibles::application-items][3]: > QueryPhaseExecutionException[[development-liquidibles::application-items][3]: > query[filtered(filtered(self_and_ancestors:diamonds)->cache(attr_types.diamond#color:0000d))->cache(_type:item)],from[0],size[10],sort[<custom:\"sell_offer_cents\": > org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@8c9d82>]: > Query Failed [Failed to execute global aggregators]]; nested: > ArithmeticException; > }{[D6h8GKwjRqO_Yem09Hu_VA][development-liquidibles::application-items][2]: > QueryPhaseExecutionException[[development-liquidibles::application-items][2]: > query[filtered(filtered(self_and_ancestors:diamonds)->cache(attr_types.diamond#color:0000d))->cache(_type:item)],from[0],size[10],sort[<custom:\"sell_offer_cents\": > org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@73a7e5>]: > Query Failed [Failed to execute global aggregators]]; nested: > ArithmeticException; > }{[D6h8GKwjRqO_Yem09Hu_VA][development-liquidibles::application-items][1]: > QueryPhaseExecutionException[[development-liquidibles::application-items][1]: > query[filtered(filtered(self_and_ancestors:diamonds)->cache(attr_types.diamond#color:0000d))->cache(_type:item)],from[0],size[10],sort[<custom:\"sell_offer_cents\": > org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@15d1b1a>]: > Query Failed [Failed to execute global aggregators]]; nested: > ArithmeticException; > }{[D6h8GKwjRqO_Yem09Hu_VA][development-liquidibles::application-items][0]: > QueryPhaseExecutionException[[development-liquidibles::application-items][0]: > query[filtered(filtered(self_and_ancestors:diamonds)->cache(attr_types.diamond#color:0000d))->cache(_type:item)],from[0],size[10],sort[<custom:\"sell_offer_cents\": > org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@1b8c216>]: > Query Failed [Failed to execute global aggregators]]; nested: > *ArithmeticException*; }]", > "status": 500 > } > > If I change the interval to be 1.0 or greater, it works. But, I want > intervals of 0.1... > > -- > 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/b8dad371-dfef-4c57-b7d8-433ee1c308c6%40googlegroups.com > <https://groups.google.com/d/msgid/elasticsearch/b8dad371-dfef-4c57-b7d8-433ee1c308c6%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/CAL6Z4j5oOcmh-Ne3tpoBNqaMpStskZzAYJch6R%2BtPz7hzVQV3g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
