Here's my full query. I'm using the Ruby gem for ElasticSearch. I have it currently working with just one must clause and single term in that.
query: { bool: { must: [{ term: { successful: true }}, { term: { account_id: self.id}}]},
filter: { range: { record_completed_at: { gte: begin_date, lte: end_date }}}},
aggregations: {
deliveries: { date_histogram: {
field: "record_completed_at", interval: "day", format: "yyyy-MM-dd", min_doc_count: 0,
time_zone: timezone.identifier,
extended_bounds: { min: begin_date, max: end_date}}}})
With this modified query I'm getting the following error:
[400] {"error":{"root_cause":[{"type":"parse_exception","reason":"failed to parse search source. expected field name but got [START_OBJECT]"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query_fetch","grouped":true,"failed_shards":[{"shard":0,"index":"roots","node":"613MZvDtSx2fK6jutlo4yg","reason":{"type":"parse_exception","reason":"failed to parse search source. expected field name but got [START_OBJECT]"}}]},"status":400}