Hi Colin, thanks for checking. I could successfully reproduce your example and I even splitted it into 2 indeces and it worked (Elasticsearch 1.3.0). But as soon as I try it with my data it doesnt work. I ran some additional tests and it works if I only use the current index (day) and split it in half. But as soon as I try to compare yesterday and the day before it only seems to get the data from one day but not the other.
Cheers, Valentin On Monday, July 28, 2014 10:07:43 AM UTC+2, Colin Goodheart-Smithe wrote: > > Hi, > > I ran the commands in the following gist, on master, without error. Would > you be able to post the error you get and a similar reproducible example to > help diagnose the issue you are running into? Also, which version of > Elasticsearch are you running? > > https://gist.github.com/colings86/46fbb0b22c2f3c4348ae > > Thanks > > Colin > > On Sunday, 27 July 2014 17:53:29 UTC+1, Valentin wrote: >> >> Hi, >> >> I am trying to use this aggregation which does not work: >> "aggs": { >> "winners": { >> "terms": { >> "field": "urls", >> "order": { >> "diff": "desc" >> } >> }, >> "aggs": { >> "diff": { >> "sum": { >> "script": "(doc['datetime'].date.getMillis() < 1406332800000) >> ? -1 : 1", >> "lang": "groovy" >> } >> } >> } >> } >> } >> >> Can anyone help? >> >> Cheers, >> Valentin >> > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/e32f68f5-3c9d-485d-80e9-fd09ce6de92c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.