Elasticsearch [bool]格式错误的查询,预期[END_OBJECT]但找到[FIELD_NAME]

时间:2017-08-03 09:08:21

标签: elasticsearch

我对elasticsearch查询有一些问题。 当我使用查询代码时,它会反馈消息 [bool]格式错误的查询,预计[END_OBJECT]但找到了[FIELD_NAME]

POST /_search
{
  "query": {
    "bool": {
     "must": {
      "match": {
       "_index": "ntopng-2017.07.26" 
      }
    },
      "filter": {
       "term": {
        "IPV4_DST_ADDR": "192.168.0.1"
    }
  }

} ,
"aggs" : {
    "IN_PKTS" : { "sum" : { "field" :"IN_PKTS" } },
    "IN_BYTES" : {"sum" : { "field":"IN_BYTES"} } ,
    "OUT_BYTES" : {"sum" : { "field":"OUT_BYTES"} }, 
    "OUT_PKTS" : { "sum" : { "field" :"OUT_PKTS" } }

   } 
  }
}

1 个答案:

答案 0 :(得分:0)

aggs 放错了地方。试试这个:

def confirmation
  @order = Order.new(params[:order])
end