date format for minimum / maximum aggs in beta2

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

date format for minimum / maximum aggs in beta2

Michael Sick
Trying to get the min / max dates for a query. Would aggregates be the right way to do so? Should the min / max aggs respect the "format": "date_time" property that date histogram does? The Sense query:

GET /vitals/vital/_search
{
    "size": 0,
    "query": {
                "match_all": {}
    },
    "aggs": {
        "min_time" : { 
            "min" : { 
                "field" : "recorded_time",
                "format": "date_time"
            }         
        }, 
       "max_time" : { 
            "max" : { "field" : "recorded_time" }         
        }
    }
}

produces:

{
   "took": 4474,
   "timed_out": false,
   "_shards": {
      "total": 103,
      "successful": 103,
      "failed": 0
   },
   "hits": {
      "total": 129870443,
      "max_score": 1,
      "hits": []
   },
   "aggregations": {
      "max_time": {
         "value": 1732417139462
      },
      "min_time": {
         "value": 1386850080000
      }
   }
}

Which I know is a long response time - my laptop is pretty loaded up at the moment. Gist @ https://gist.github.com/mikeasick/7964683

If this should be a bug or feature request, let me know and I'll create. Advice much appreciated. Thanks --Mike



Michael Sick | Big Data Architect
Serene Software Inc.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAP8axnBG6oZBLkxczR%3DPgHFmcvwHU1VrT9PM5yHAa9eodzW%2BhA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: date format for minimum / maximum aggs in beta2

uboness
Hi Michael,

Yes, please open an official issue for it on github.

Thanks,
Uri

On Saturday, December 14, 2013 12:44:32 PM UTC-8, Michael Sick wrote:
Trying to get the min / max dates for a query. Would aggregates be the right way to do so? Should the min / max aggs respect the "format": "date_time" property that date histogram does? The Sense query:

GET /vitals/vital/_search
{
    "size": 0,
    "query": {
                "match_all": {}
    },
    "aggs": {
        "min_time" : { 
            "min" : { 
                "field" : "recorded_time",
                "format": "date_time"
            }         
        }, 
       "max_time" : { 
            "max" : { "field" : "recorded_time" }         
        }
    }
}

produces:

{
   "took": 4474,
   "timed_out": false,
   "_shards": {
      "total": 103,
      "successful": 103,
      "failed": 0
   },
   "hits": {
      "total": 129870443,
      "max_score": 1,
      "hits": []
   },
   "aggregations": {
      "max_time": {
         "value": 1732417139462
      },
      "min_time": {
         "value": 1386850080000
      }
   }
}

Which I know is a long response time - my laptop is pretty loaded up at the moment. Gist @ <a href="https://gist.github.com/mikeasick/7964683" target="_blank" onmousedown="this.href='https://www.google.com/url?q\75https%3A%2F%2Fgist.github.com%2Fmikeasick%2F7964683\46sa\75D\46sntz\0751\46usg\75AFQjCNFvfr1KQUsDFW1H5ZFYwKtoQjTBIA';return true;" onclick="this.href='https://www.google.com/url?q\75https%3A%2F%2Fgist.github.com%2Fmikeasick%2F7964683\46sa\75D\46sntz\0751\46usg\75AFQjCNFvfr1KQUsDFW1H5ZFYwKtoQjTBIA';return true;">https://gist.github.com/mikeasick/7964683

If this should be a bug or feature request, let me know and I'll create. Advice much appreciated. Thanks --Mike



Michael Sick | Big Data Architect
Serene Software Inc.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/f27a8402-d425-4bb3-9390-2e8b3a42cf7c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: date format for minimum / maximum aggs in beta2

Michael Sick
Done - thanks!


On Mon, Dec 16, 2013 at 10:32 AM, uboness <[hidden email]> wrote:
Hi Michael,

Yes, please open an official issue for it on github.

Thanks,
Uri


On Saturday, December 14, 2013 12:44:32 PM UTC-8, Michael Sick wrote:
Trying to get the min / max dates for a query. Would aggregates be the right way to do so? Should the min / max aggs respect the "format": "date_time" property that date histogram does? The Sense query:

GET /vitals/vital/_search
{
    "size": 0,
    "query": {
                "match_all": {}
    },
    "aggs": {
        "min_time" : { 
            "min" : { 
                "field" : "recorded_time",
                "format": "date_time"
            }         
        }, 
       "max_time" : { 
            "max" : { "field" : "recorded_time" }         
        }
    }
}

produces:

{
   "took": 4474,
   "timed_out": false,
   "_shards": {
      "total": 103,
      "successful": 103,
      "failed": 0
   },
   "hits": {
      "total": 129870443,
      "max_score": 1,
      "hits": []
   },
   "aggregations": {
      "max_time": {
         "value": 1732417139462
      },
      "min_time": {
         "value": 1386850080000
      }
   }
}

Which I know is a long response time - my laptop is pretty loaded up at the moment. Gist @ https://gist.github.com/mikeasick/7964683

If this should be a bug or feature request, let me know and I'll create. Advice much appreciated. Thanks --Mike



Michael Sick | Big Data Architect
Serene Software Inc.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/f27a8402-d425-4bb3-9390-2e8b3a42cf7c%40googlegroups.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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAP8axnBMHe-pRGhTfVvso8_htV3FnKP8gU0Qez9ChAdxstd31w%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.