@@ -13,11 +13,17 @@ |
||
13 | 13 | $this->hits = Arr::get($response, 'inner_hits', []); |
14 | 14 | } |
15 | 15 | |
16 | + /** |
|
17 | + * @param string $parentType |
|
18 | + */ |
|
16 | 19 | public function getParentId($parentType) |
17 | 20 | { |
18 | 21 | return Arr::get($this->hits, $parentType . '.hits.hits.0._id'); |
19 | 22 | } |
20 | 23 | |
24 | + /** |
|
25 | + * @param string $parentType |
|
26 | + */ |
|
21 | 27 | public function getParent($parentType) |
22 | 28 | { |
23 | 29 | return Arr::get($this->hits, $parentType . '.hits.hits.0._source'); |
@@ -72,7 +72,7 @@ |
||
72 | 72 | /** |
73 | 73 | * Delete index. |
74 | 74 | * |
75 | - * @param mixed $index |
|
75 | + * @param string $index |
|
76 | 76 | */ |
77 | 77 | protected function deleteIndex($index) |
78 | 78 | { |
@@ -18,7 +18,7 @@ |
||
18 | 18 | /** |
19 | 19 | * Put response. |
20 | 20 | * |
21 | - * @param array $response |
|
21 | + * @param callable $response |
|
22 | 22 | */ |
23 | 23 | public function response(array $response) |
24 | 24 | { |
@@ -4,9 +4,9 @@ |
||
4 | 4 | |
5 | 5 | use Elasticsearch\Client; |
6 | 6 | use Elasticsearch\Common\Exceptions\Missing404Exception; |
7 | +use Isswp101\Persimmon\CollectionParser\ElasticsearchCollectionParser; |
|
7 | 8 | use Isswp101\Persimmon\Collection\ElasticsearchCollection; |
8 | 9 | use Isswp101\Persimmon\Collection\IElasticsearchCollection; |
9 | -use Isswp101\Persimmon\CollectionParser\ElasticsearchCollectionParser; |
|
10 | 10 | use Isswp101\Persimmon\Contracts\Storable; |
11 | 11 | use Isswp101\Persimmon\Exceptions\ClassTypeErrorException; |
12 | 12 | use Isswp101\Persimmon\Exceptions\ModelNotFoundException; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | /** |
87 | 87 | * Set _source to search query. |
88 | 88 | * |
89 | - * @param mixed $fields |
|
89 | + * @param boolean $fields |
|
90 | 90 | * @return $this |
91 | 91 | */ |
92 | 92 | public function fields($fields = false) |
@@ -238,6 +238,10 @@ discard block |
||
238 | 238 | return $this->lessThanOrEquals($field, $start); |
239 | 239 | } |
240 | 240 | |
241 | + /** |
|
242 | + * @param string $field |
|
243 | + * @param string $value |
|
244 | + */ |
|
241 | 245 | public function match($field, $value) |
242 | 246 | { |
243 | 247 | $query = ['query' => ['match' => [$field => $value]]]; |
@@ -252,6 +256,10 @@ discard block |
||
252 | 256 | return $this; |
253 | 257 | } |
254 | 258 | |
259 | + /** |
|
260 | + * @param string $field |
|
261 | + * @param string $value |
|
262 | + */ |
|
255 | 263 | public function orMatch($field, $value) |
256 | 264 | { |
257 | 265 | $query = ['query' => ['match' => [$field => $value]]]; |