2014-04-17 2 views
0

빈 필드를 쿼리하려고합니다. 나는 다음과 같은 일을 해요빈 값에 대한 필드 쿼리

select * from cars where cartype="Auto" and make="Ferrari" and color="" and model="" and seats in ["", "bench"] 

,하지만 난 오류

{ 
    "query": { 
     "bool": { 
      "must": [ 
       { 
        "match": { 
         "CarType": "Auto" 
        } 
       }, 
       { 
        "match": { 
         "Make": "Ferrari" 
        } 
       } 
      ], 
      "must_not": [ 
       { 
        "existence": true, 
        "field": "Color", 
        "null_value": true 
       }, 
       { 
        "existence": true, 
        "field": "Model", 
        "null_value": true 
       } 
      ] 
     } 
    } 
} 

받고 있어요하지만 다음 얻을 : SQL 말투에서 다음 작업을 수행 할 것 "실패를 구문 분석을 [에 실패 구문 분석 소스 .... nexted : 쿼리 here

답변

0

같은 시도

나는 예를 다음과 같은거야 "잘못된

{ 
"query": { 
    "bool": { 
     "must": [ 

       { 
       "match": { 
        "CarType": "Auto" 
       } 
       } 
      , 
      { 
       "match": { 
        "Make": "Ferrari" 
       } 

      } 
     ], "must_not": [ 
      { 
       "missing":{ 
         "field":"Model", 
         "existence":true, 
          "null_value":true 
         } 
      }, 
      { 
       "missing":{ 
         "field":"Color", 
         "existence":true, 
          "null_value":true 
         } 
      } 
     ] 
    } 
} 
} 
관련 문제