elasticsearch - Migrating to Aggregations from Date histogram facet builder with querystring -
i trying migrate aggregations date histogram facet builder going through following url.
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-facets-migrating-to-aggs.html
i able convert few queries aggregations , got proper results, throwing exception while converting following facet query aggregations query.
facet :
{ "facets": { "lapp442.corp.com:timer_micro.99percentile": { "date_histogram": { "key_field": "@timestamp", "value_field": "timer_micro.99percentile", "interval": "30s" }, "facet_filter": { "query": { "filtered": { "query": { "query_string": { "query": "lapp442.corp.com" } }, "filter": { "bool": { "must": { "range": { "@timestamp": { "from": "1433145224508", "to": "now", "include_lower": true, "include_upper": true } } } } } } } }, "global": true }, "lapp425.corp.com:timer_micro.99percentile": { "date_histogram": { "key_field": "@timestamp", "value_field": "timer_micro.99percentile", "interval": "30s" }, "facet_filter": { "query": { "filtered": { "query": { "query_string": { "query": "lapp425.corp.com" } }, "filter": { "bool": { "must": { "range": { "@timestamp": { "from": "1433145224508", "to": "now", "include_lower": true, "include_upper": true } } } } } } } }, "global": true } } }
aggregation :
{ "aggregations": { "lapp442.corp.com:timer_micro.99percentile": { "date_histogram": { "field": "@timestamp", "interval": "30s" }, "aggregations": { "metricstats": { "stats": { "field": "timer_micro.99percentile" } }, "host-filter": { "filter": { "query": { "filtered": { "query": { "query_string": { "query": "lapp442.corp.com" } }, "filter": { "bool": { "must": { "range": { "@timestamp": { "from": "1433145293851", "to": "now", "include_lower": true, "include_upper": true } } } } } } } } } } }, "lapp425.corp.com:timer_micro.99percentile": { "date_histogram": { "field": "@timestamp", "interval": "30s" }, "aggregations": { "metricstats": { "stats": { "field": "timer_micro.99percentile" } }, "host-filter": { "filter": { "query": { "filtered": { "query": { "query_string": { "query": "lapp425.corp.com" } }, "filter": { "bool": { "must": { "range": { "@timestamp": { "from": "1433145293851", "to": "now", "include_lower": true, "include_upper": true } } } } } } } } } } } } }
please correct me if query construction wrong while migrating facet query aggregation query.
Comments
Post a Comment