2017-04-21 2 views
3

AWS Elasticsearch 5.1에 대해이 쿼리를 실행하고 조작 된 쿼리 오류가 발생했습니다. 다음은 요청의 본문입니다. 기본적으로 필드가 시간 범위 내에 존재하는지 확인하고 있습니다.쿼리가 잘못되었으므로 쿼리 이름 뒤에 start_object가 없습니다.

{ 
    "query": { 
    "bool": { 
     "filter": { 
     "bool": { 
      "must": [ 
      { 
       "range": { 
       "@timestamp": { 
        "gt": "2017-03-21T15:37:08.595919Z", 
        "lte": "2017-04-21T15:52:08.595919Z" 
       } 
       } 
      }, 
      { 
       "query": [ 
       { 
        "query_string": { 
        "query": "_exists_: $event.supplier" 
        } 
       } 
       ] 
      } 
      ] 
     } 
     } 
    } 
    }, 
    "sort": [ 
    { 
     "@timestamp": { 
     "order": "asc" 
     } 
    } 
    ] 
} 

답변

4

두 번째 must 문이 잘못되었습니다 :

{ 
    "query": { 
    "bool": { 
     "filter": { 
     "bool": { 
      "must": [ 
      { 
       "range": { 
       "@timestamp": { 
        "gt": "2017-03-21T15:37:08.595919Z", 
        "lte": "2017-04-21T15:52:08.595919Z" 
       } 
       } 
      }, 
      { 
       "query_string": { 
       "query": "_exists_: $event.supplier" 
       } 
      } 
      ] 
     } 
     } 
    } 
    }, 
    "sort": [ 
    { 
     "@timestamp": { 
     "order": "asc" 
     } 
    } 
    ] 
}