Re: date_histogram not returning key_as_string

2014-06-16 Thread Tim Heikell
Thank you Alexander, but I got it figured out. I was storing 
sessionStartTime as a Unix timestamp but did not provide any mapping, so 
the field type was set to be a double. Once I explicitly mapped 
sessionStartTime to be a date my query results started including the 
key_as_string field.

Tim


On Monday, June 16, 2014 5:38:42 AM UTC-7, Alexander Reelsen wrote:
>
> Hey,
>
> can you create a full gist to reproduce this? Should work out of the box 
> (dont see anything wrong here), also on 1.1.0
>
>
> --Alex
>
>
> On Thu, Jun 5, 2014 at 8:06 PM, Tim Heikell  > wrote:
>
>> Sorry for the noob question, but is there some setting I am missing? It's 
>> not clear to me why I'm not getting a key_as_string field in my results. 
>> I'm running v1.1.0, here is my search:
>>
>> GET /_all/_search
>> {
>>   "aggs": {
>> "totalsByHour": {
>>   "date_histogram": {
>> "field": "sessionStartTime",
>> "interval": "day",
>> "format": "-MM-dd"
>>   }
>> }
>>   }
>> }
>>
>> and here are my results:
>>
>>"aggregations": {
>>   "totalsByHour": {
>>  "buckets": [
>> {
>>"key": 140166720,
>>"doc_count": 15973
>> },
>> {
>>"key": 140175360,
>>"doc_count": 11996
>> },
>> {
>>"key": 140184000,
>>"doc_count": 14
>> },
>> {
>>"key": 140192640,
>>"doc_count": 4031
>> }
>>  ]
>>   }
>>}
>>  
>> -- 
>> 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 elasticsearc...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/elasticsearch/0acca250-ab7f-48a8-a73a-648f7f544dcd%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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/2fbead94-8471-43e9-9544-9e23f3d2d1b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: date_histogram not returning key_as_string

2014-06-16 Thread Alexander Reelsen
Hey,

can you create a full gist to reproduce this? Should work out of the box
(dont see anything wrong here), also on 1.1.0


--Alex


On Thu, Jun 5, 2014 at 8:06 PM, Tim Heikell 
wrote:

> Sorry for the noob question, but is there some setting I am missing? It's
> not clear to me why I'm not getting a key_as_string field in my results.
> I'm running v1.1.0, here is my search:
>
> GET /_all/_search
> {
>   "aggs": {
> "totalsByHour": {
>   "date_histogram": {
> "field": "sessionStartTime",
> "interval": "day",
> "format": "-MM-dd"
>   }
> }
>   }
> }
>
> and here are my results:
>
>"aggregations": {
>   "totalsByHour": {
>  "buckets": [
> {
>"key": 140166720,
>"doc_count": 15973
> },
> {
>"key": 140175360,
>"doc_count": 11996
> },
> {
>"key": 140184000,
>"doc_count": 14
> },
> {
>"key": 140192640,
>"doc_count": 4031
> }
>  ]
>   }
>}
>
> --
> 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/0acca250-ab7f-48a8-a73a-648f7f544dcd%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAGCwEM_aj0JhVsn6e7qxSF6VuLG8%2BnE3x5RxONWWFuLstz8GkQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.