>
> Can you give examples of the documents and the queries you use?
>
> Docs look like this:

{
"duration" : "74",
"caller" : "128287",
"session_id" : "12312",
"id" : "901",
"position" : "1",
"parameters" : "ffff",
"operation" : "export",
"timestamp" : "2014-01-15T14:17:06.245+01:00"
}

And this is the query:

{
    "query": {
        "filtered": {
            "query": {
                "match_all": {}
            },
            "filter": {
                "bool": {
                    "must": [
                        {
                            "range": {
                                "timestamp": {
                                    "ge": "2013-12-31T23:00:00.000Z",
                                    "lt": "2014-12-31T23:00:00.000Z"
                                }
                            }
                        },
                        {
                            "term": {
                                "_type": "export-op"
                            }
                        }
                    ]
                }
            }
        }
    },
    "aggregations": {
        "duration-not-empty": {
            "filter": {
                "bool": {
                    "must": [
                        {
                            "not": {
                                "filter": {
                                    "missing": {
                                        "field": "duration"
                                    }
                                }
                            }
                        },
                        {
                            "range": {
                                "duration": {
                                    "gt": "0"
                                }
                            }
                        }
                    ]
                }
            },
            "aggregations": {
                "durations": {
                    "date_histogram": {
                        "field": "timestamp",
                        "interval": "1M"
                    },
                    "aggregations": {
                        "duration-stats": {
                            "extended_stats": {
                                "field": "duration"
                            }
                        }
                    }
                }
            }
        }
    },
    "size": 0
}

The extended_stats seems to be expensive. Instead using min/max/avg will 
save some seconds. Also excluding _type from query has no effect, but i 
think thos restriction is applied to url, too.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/83e0e265-2fa1-46a8-ad5f-c64981919fd5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to