ElasticSearch上的查询

时间:2015-02-13 11:07:33

标签: elasticsearch

我有一个看起来像这样的文件,

{
    "_index": "w3-commsvc",
    "_type": "message",
    "_id": "h98yv662",
    "_score": 1,
    "_source": {
        "messageId": "h98yv662",
        "campaignName": "src_checkoutAbandon",
        "campaignId": "cId_w3_website",
        "states": [
            {
                "Delivered": 790709218
            },
            {
                "open": 1288775055
            },
            {
                "click": 319518555
            },
            {
                "DEFERRED": 2137606534
            }
        ],
        "clientName": "w3_website",
        "templateId": "test",
        "opens": [
            {
                "url": "www.something.com",
                "id": "t26jj783",
                "userAgent": {
                    "browser": {
                        "family": "IE",
                        "version": "11.0",
                        "major": "11",
                        "minor": "0",
                        "patch": null
                    },
                    "os": {
                        "family": "Windows_XP",
                        "version": null,
                        "versionPopularName": null,
                        "major": null,
                        "minor": null,
                        "patch": null,
                        "patchMinor": null
                    },
                    "device": {
                        "family": "Other",
                        "type": "Computer"
                    }
                },
                "timestamp": "1372366437"
            },
            {
                "url": "www.something.com",
                "id": "t98ef285",
                "userAgent": {
                    "browser": {
                        "family": "IE",
                        "version": "11.0",
                        "major": "11",
                        "minor": "0",
                        "patch": null
                    },
                    "os": {
                        "family": "Windows_XP",
                        "version": null,
                        "versionPopularName": null,
                        "major": null,
                        "minor": null,
                        "patch": null,
                        "patchMinor": null
                    },
                    "device": {
                        "family": "Other",
                        "type": "Computer"
                    }
                },
                "timestamp": "717918284"
            }
        ],
        "clicks": [
            {
                "url": "www.something.com",
                "id": " j60te707",
                "userAgent": {
                    "browser": {
                        "family": "IE",
                        "version": "11.0",
                        "major": "11",
                        "minor": "0",
                        "patch": null
                    },
                    "os": {
                        "family": "Windows_XP",
                        "version": null,
                        "versionPopularName": null,
                        "major": null,
                        "minor": null,
                        "patch": null,
                        "patchMinor": null
                    },
                    "device": {
                        "family": "Other",
                        "type": "Computer"
                    }
                },
                "timestamp": "1293320728"
            },
            {
                "url": "www.something.com",
                "id": " c63bc623",
                "userAgent": {
                    "browser": {
                        "family": "IE",
                        "version": "11.0",
                        "major": "11",
                        "minor": "0",
                        "patch": null
                    },
                    "os": {
                        "family": "Windows_XP",
                        "version": null,
                        "versionPopularName": null,
                        "major": null,
                        "minor": null,
                        "patch": null,
                        "patchMinor": null
                    },
                    "device": {
                        "family": "Other",
                        "type": "Computer"
                    }
                },
                "timestamp": "624917313"
            },
            {
                "url": "www.something.com",
                "id": " f10qm",
                "userAgent": {
                    "browser": {
                        "family": "Firefox",
                        "version": "11.0",
                        "major": "11",
                        "minor": "0",
                        "patch": null
                    },
                    "os": {
                        "family": "Windows_XP",
                        "version": null,
                        "versionPopularName": null,
                        "major": null,
                        "minor": null,
                        "patch": null,
                        "patchMinor": null
                    },
                    "device": {
                        "family": "Other",
                        "type": "Computer"
                    }
                },
                "timestamp": "334734507"
            }
        ]
    }
}

现在使用上述文件,我需要以下答案进行以下查询,

1 - 我需要某个clientName的每个州的术语计数 2 - 文档中每个打开数组的总长度 3 - 打开并单击每个浏览器的统计信息。

0 个答案:

没有答案