@@ -121,17 +121,17 @@ discard block |
||
| 121 | 121 | public function highlight($fields = [], $settings = []): self |
| 122 | 122 | { |
| 123 | 123 | |
| 124 | - if (count($fields) === 0 && count($settings)===0) { |
|
| 125 | - $this->params['highlight'] = new \stdClass(); |
|
| 124 | + if (count($fields) === 0 && count($settings) === 0) { |
|
| 125 | + $this->params['highlight'] = new \stdClass(); |
|
| 126 | 126 | return $this; |
| 127 | 127 | } |
| 128 | 128 | $this->params['highlight'] = []; |
| 129 | 129 | if (count($fields) > 0) { |
| 130 | - $this->params['highlight']['fields'] =$fields; |
|
| 130 | + $this->params['highlight']['fields'] = $fields; |
|
| 131 | 131 | } |
| 132 | - if (count($settings)>0) { |
|
| 132 | + if (count($settings) > 0) { |
|
| 133 | 133 | foreach ($settings as $name => $value) { |
| 134 | - $this->params['highlight'][$name] =$value; |
|
| 134 | + $this->params['highlight'][$name] = $value; |
|
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | return $this; |
@@ -196,9 +196,9 @@ discard block |
||
| 196 | 196 | |
| 197 | 197 | if ($boolean === self::FILTER_AND) { |
| 198 | 198 | $this->query->must($attr); |
| 199 | - } else if($boolean === self::FILTER_OR) { |
|
| 199 | + } else if ($boolean === self::FILTER_OR) { |
|
| 200 | 200 | $this->query->should($attr); |
| 201 | - } else if($boolean === self::FILTER_NOT) { |
|
| 201 | + } else if ($boolean === self::FILTER_NOT) { |
|
| 202 | 202 | $this->query->mustNot($attr); |
| 203 | 203 | } |
| 204 | 204 | |
@@ -237,10 +237,10 @@ discard block |
||
| 237 | 237 | $group = $field; |
| 238 | 238 | } |
| 239 | 239 | $terms = ['field'=>$field]; |
| 240 | - if ($limit !==null) { |
|
| 240 | + if ($limit !== null) { |
|
| 241 | 241 | $terms['size'] = $limit; |
| 242 | 242 | } |
| 243 | - $this->params['aggs'][$group] =['terms' =>$terms]; |
|
| 243 | + $this->params['aggs'][$group] = ['terms' =>$terms]; |
|
| 244 | 244 | return $this; |
| 245 | 245 | } |
| 246 | 246 | |