| @@ 80-103 (lines=24) @@ | ||
| 77 | * |
|
| 78 | * @return mixed |
|
| 79 | */ |
|
| 80 | public function visitFilter(Criterion $criterion, Dispatcher $dispatcher, array $languageFilter) |
|
| 81 | { |
|
| 82 | $filter = array( |
|
| 83 | 'nested' => array( |
|
| 84 | 'path' => 'fields_doc', |
|
| 85 | 'filter' => array( |
|
| 86 | 'query' => $this->getCondition($criterion), |
|
| 87 | ), |
|
| 88 | ), |
|
| 89 | ); |
|
| 90 | ||
| 91 | $fieldFilter = $this->getFieldFilter($languageFilter); |
|
| 92 | ||
| 93 | if ($fieldFilter !== null) { |
|
| 94 | $filter['nested']['filter'] = array( |
|
| 95 | 'and' => array( |
|
| 96 | $fieldFilter, |
|
| 97 | $filter['nested']['filter'], |
|
| 98 | ), |
|
| 99 | ); |
|
| 100 | } |
|
| 101 | ||
| 102 | return $filter; |
|
| 103 | } |
|
| 104 | } |
|
| 105 | ||
| @@ 94-117 (lines=24) @@ | ||
| 91 | * |
|
| 92 | * @return mixed |
|
| 93 | */ |
|
| 94 | public function visitFilter(Criterion $criterion, Dispatcher $dispatcher, array $languageFilter) |
|
| 95 | { |
|
| 96 | $filter = array( |
|
| 97 | 'nested' => array( |
|
| 98 | 'path' => 'fields_doc', |
|
| 99 | 'filter' => array( |
|
| 100 | 'query' => $this->getCondition($criterion), |
|
| 101 | ), |
|
| 102 | ), |
|
| 103 | ); |
|
| 104 | ||
| 105 | $fieldFilter = $this->getFieldFilter($languageFilter); |
|
| 106 | ||
| 107 | if ($fieldFilter !== null) { |
|
| 108 | $filter['nested']['filter'] = array( |
|
| 109 | 'and' => array( |
|
| 110 | $fieldFilter, |
|
| 111 | $filter['nested']['filter'], |
|
| 112 | ), |
|
| 113 | ); |
|
| 114 | } |
|
| 115 | ||
| 116 | return $filter; |
|
| 117 | } |
|
| 118 | ||
| 119 | /** |
|
| 120 | * Map field value to a proper Elasticsearch query representation. |
|
| @@ 137-160 (lines=24) @@ | ||
| 134 | * |
|
| 135 | * @return mixed |
|
| 136 | */ |
|
| 137 | public function visitFilter(Criterion $criterion, Dispatcher $dispatcher, array $languageFilter) |
|
| 138 | { |
|
| 139 | $filter = array( |
|
| 140 | 'nested' => array( |
|
| 141 | 'path' => 'fields_doc', |
|
| 142 | 'filter' => array( |
|
| 143 | 'or' => $this->getCondition($criterion), |
|
| 144 | ), |
|
| 145 | ), |
|
| 146 | ); |
|
| 147 | ||
| 148 | $fieldFilter = $this->getFieldFilter($languageFilter); |
|
| 149 | ||
| 150 | if ($languageFilter !== null) { |
|
| 151 | $filter['nested']['filter'] = array( |
|
| 152 | 'and' => array( |
|
| 153 | $fieldFilter, |
|
| 154 | $filter['nested']['filter'], |
|
| 155 | ), |
|
| 156 | ); |
|
| 157 | } |
|
| 158 | ||
| 159 | return $filter; |
|
| 160 | } |
|
| 161 | ||
| 162 | /** |
|
| 163 | * Map field value to a proper Elasticsearch query representation. |
|
| @@ 116-141 (lines=26) @@ | ||
| 113 | * |
|
| 114 | * @return mixed |
|
| 115 | */ |
|
| 116 | public function visitFilter(Criterion $criterion, Dispatcher $dispatcher, array $languageFilter) |
|
| 117 | { |
|
| 118 | $filter = array( |
|
| 119 | 'nested' => array( |
|
| 120 | 'path' => 'fields_doc', |
|
| 121 | 'filter' => array( |
|
| 122 | 'query' => $this->getCondition($criterion), |
|
| 123 | ), |
|
| 124 | ), |
|
| 125 | ); |
|
| 126 | ||
| 127 | $fieldFilter = $this->getFieldFilter($languageFilter); |
|
| 128 | ||
| 129 | if ($languageFilter !== null) { |
|
| 130 | $filter['nested']['filter'] = array( |
|
| 131 | 'bool' => array( |
|
| 132 | 'must' => array( |
|
| 133 | $fieldFilter, |
|
| 134 | $filter['nested']['filter'], |
|
| 135 | ), |
|
| 136 | ), |
|
| 137 | ); |
|
| 138 | } |
|
| 139 | ||
| 140 | return $filter; |
|
| 141 | } |
|
| 142 | ||
| 143 | /** |
|
| 144 | * Map field value to a proper Elasticsearch query representation. |
|
| @@ 107-132 (lines=26) @@ | ||
| 104 | * |
|
| 105 | * @return mixed |
|
| 106 | */ |
|
| 107 | public function visitFilter(Criterion $criterion, Dispatcher $dispatcher, array $languageFilter) |
|
| 108 | { |
|
| 109 | $filter = array( |
|
| 110 | 'nested' => array( |
|
| 111 | 'path' => 'fields_doc', |
|
| 112 | 'filter' => array( |
|
| 113 | 'query' => $this->getCondition($criterion), |
|
| 114 | ), |
|
| 115 | ), |
|
| 116 | ); |
|
| 117 | ||
| 118 | $fieldFilter = $this->getFieldFilter($languageFilter); |
|
| 119 | ||
| 120 | if ($languageFilter !== null) { |
|
| 121 | $filter['nested']['filter'] = array( |
|
| 122 | 'bool' => array( |
|
| 123 | 'must' => array( |
|
| 124 | $fieldFilter, |
|
| 125 | $filter['nested']['filter'], |
|
| 126 | ), |
|
| 127 | ), |
|
| 128 | ); |
|
| 129 | } |
|
| 130 | ||
| 131 | return $filter; |
|
| 132 | } |
|
| 133 | ||
| 134 | /** |
|
| 135 | * Map field value to a proper Elasticsearch query representation. |
|