2013-03-12 7 views
1

패싯 탐색을 사용할 때 패싯 필터를 적용 할 때 다음 결과 집합에 더 이상 패싯이 포함되지 않는다는 점에서 탄성 탐색 DSL에 문제가 있습니다. 그들.elasticsearch facets OR filter

{ 
"sort": { 
    "_score": {}, 
    "salesQuantity": { 
     "order": "asc" 
    } 
}, 
"query": { 
    "filtered": { 
     "query": { 
      "match": { 
       "categoryTree": "D01" 
      } 
     }, 
     "filter": { 
      "term": { 
       "publicwebEnabled": true, 
       "parentID": 0 
      }, 
      "or": [ 
       { 
        "range": { 
         "Retail_Price": { 
          "to": "49.99", 
          "from": "0" 
         } 
        } 
       } 
      ] 
     } 
    } 
}, 
"facets": { 
    "delivery_locations": { 
     "terms": { 
      "field": "delivery_locations", 
      "all_terms": true 
     } 
    }, 
    "categories": { 
     "terms": { 
      "field": "categoryTree", 
      "all_terms": true 
     } 
    }, 
    "collectable": { 
     "terms": { 
      "field": "collectable", 
      "all_terms": true 
     } 
    } 
}, 
"from": 0, 
"size": 12} 
: 다음과 같이 필터를 적용

{ 
"sort": { 
    "_score": {}, 
    "salesQuantity": { 
     "order": "asc" 
    } 
}, 
"query": { 
    "filtered": { 
     "query": { 
      "match": { 
       "categoryTree": "D01" 
      } 
     }, 
     "filter": { 
      "term": { 
       "publicwebEnabled": true, 
       "parentID": 0 
      } 
     } 
    } 
}, 
"facets": { 
    "delivery_locations": { 
     "terms": { 
      "field": "delivery_locations", 
      "all_terms": true 
     } 
    }, 
    "categories": { 
     "terms": { 
      "field": "categoryTree", 
      "all_terms": true 
     } 
    }, 
    "collectable": { 
     "terms": { 
      "field": "collectable", 
      "all_terms": true 
     } 
    } 
}, 
"from": 0, 
"size": 12} 

는, 결과는 내가 다시 얻을 측면을 포함하지 않는 : 나는 초기 검색을 수행 할 때

, 나는 다시 원하는 결과를 얻을

참고 위 필터는 사용자가 여러 가격대를 선택하여 필터링 할 수 있기 때문에 위의 OR 필터를 추가합니다.

내가 잘못 했나요?

나는

+0

나는 똑같은 것을보고 있습니다. 내 쿼리 블록에 "필터링 된"부분이 포함되어 있으면 결과에 패싯이 돌아 가지 않습니다. – svrist

답변

0

가 또는 필터 내부에 원래의 용어 필터를 추가하거나 포장하는 다른 부울 필터를 추가 ... 새로운면 분명 다른면의면 수를 변화시키는 가격을 변경 반환합니다 부울 식 내부의 전체 필터. 나는 두 필터를 쉼표로 추가 할 수 있다고 생각하지 않는다.

+0

쿼리가 작동합니다. 내가 예상했던 결과를 얻었지만 반환하는 JSON에는 패싯 객체가 없습니다 (모두에서). – Tom

+0

좀 더 조사하겠습니다. – Tom