Date Histogram Facets

I am currently storing dates in the format: yyyyMMdd'T'HH:mm:ss. (same
format used in the overview video) So my current time looks like this:
20130625T11:20:00.

My mapping for the date field looks like this:
"date" : {
"type" : "date",
"format" : "dateOptionalTime"
},

My date_histogram search is this:
{
"query": {
"match_all": {}
},
"facets": {
"histo1": {
"date_histogram": {
"field": "date",
"interval": "day"
}
}
}
}

I am trying to use the date_histogram and I seem to get very weird
timestamps. All my dates are just a few days old, so there is no timestamp
that is older than the 20th of June, 2013 nor is their any timestamps that
are after todays date. However in the date histogram facet results I get
are like this:

  • {
    • time: 634245916608000000
    • count: 3
      }
  • {
    • time: 634245979766400000
    • count: 15
      }
  • {
    • time: 634246042838400000
    • count: 6
      }
  • {

Any idea as to why the timestamps are so far in the future? A range query
works pretty well, but not the date_histogram.

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hey,

I think your date format does not match 'dateOptionalTime', see

Can you set it explicitely in the mapping or try with a real ISO8601 date?

--Alex

On Tue, Jun 25, 2013 at 8:26 PM, Christopher H cphartfield@gmail.comwrote:

I am currently storing dates in the format: yyyyMMdd'T'HH:mm:ss. (same
format used in the overview video) So my current time looks like this:
20130625T11:20:00.

My mapping for the date field looks like this:
"date" : {
"type" : "date",
"format" : "dateOptionalTime"
},

My date_histogram search is this:
{
"query": {
"match_all": {}
},
"facets": {
"histo1": {
"date_histogram": {
"field": "date",
"interval": "day"
}
}
}
}

I am trying to use the date_histogram and I seem to get very weird
timestamps. All my dates are just a few days old, so there is no timestamp
that is older than the 20th of June, 2013 nor is their any timestamps that
are after todays date. However in the date histogram facet results I get
are like this:

  • {
    • time: 634245916608000000
    • count: 3
      }
  • {
    • time: 634245979766400000
    • count: 15
      }
  • {
    • time: 634246042838400000
    • count: 6
      }
  • {

Any idea as to why the timestamps are so far in the future? A range query
works pretty well, but not the date_histogram.

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.