Skip to content

Commit

Permalink
#7 Replace ISO format to timestamp for date in time aggregation
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Nov 10, 2017
1 parent 2d8b5a2 commit a2f8592
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/org/elastic4play/services/Aggregations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import org.joda.time.DateTime
import org.elastic4play.BadRequestError
import org.elastic4play.database.DBUtils
import org.elastic4play.models.BaseModelDef
import org.elastic4play.utils.Date.RichJoda

abstract class Agg(val aggregationName: String) {
def apply(model: BaseModelDef): Seq[AggregationDefinition]
Expand Down Expand Up @@ -189,7 +188,7 @@ class GroupByTime(aggregationName: String, fields: Seq[String], interval: String
.reduceOption(_ ++ _)
.getOrElse(JsObject(Nil))
// date -> obj(key{avg, min} -> value)
bucket.getKey.asInstanceOf[DateTime].toIso results
bucket.getKey.asInstanceOf[DateTime].getMillis.toString results
}.toMap
}.toMap
val keys = aggs.values.flatMap(_.keys).toSet
Expand Down

0 comments on commit a2f8592

Please sign in to comment.