ES查询产生弹性:错误400(错误请求)

时间:2019-05-22 12:32:46

标签: elasticsearch go

我正在编写一个与Go中的ES交互的处理程序。这是我正在使用的查询

{
    "bool": {
        "filter": [{
            "match": {
                "client": "android"
            }
        }, {
            "range": {
                "_createdAt": {
                    "from": "2019-05-20",
                    "include_lower": true,
                    "include_upper": true,
                    "to": "2019-05-21"
                }
            }
        }, {
            "match": {
                "isActive": true
            }
        }, {
            "match": {
                "formId": ""
            }
        }]
    }
}

这是我得到的错误"elastic: Error 400 (Bad Request): request does not support [Query] [type=parsing_exception]",

这是我的请求正文

{
    "organizationId": "5ce39e03551b6b4fa757e4fb",
    "dateField": "_createdAt",
    "startDate": "2019-05-20",
    "endDate": "2019-05-21"
}

这是我的代码count, err := r.connection.Count(indexName).BodyJson(query).Do(ctx)

0 个答案:

没有答案