Skip to content

Commit 01e17ef

Browse files
committed
Allow bool in TopHits::setSource. Closes #1012
1 parent a4100e5 commit 01e17ef

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ All notable changes to this project will be documented in this file based on the
77
### Backward Compatibility Breaks
88

99
### Bugfixes
10-
- Function score query: corrected the `score_method` `average` to `avg` #975
10+
- Function score query: corrected the `score_method` `average` to `avg` #975
1111
- Set `json_decode()` assoc parameter to true in `Elastica\Response` #1005
1212
- Add `bigintConversion` to keys passed to connection config in `Elastica\Client` #1005
1313
- Use POST instead of PUT to send bulk requests #1010
@@ -19,6 +19,7 @@ All notable changes to this project will be documented in this file based on the
1919

2020
### Improvements
2121
- More info on Elastica\Exception\PartialShardFailureException. Not just number of failed shards.
22+
- Allow bool in TopHits::setSource function #1012
2223

2324
### Deprecated
2425
- Elastica\Query\Filtered triggers E_USER_DEPRECATED error because filtered query is deprecated since ES 2.0.0-beta1. Use BoolQuery instead.

lib/Elastica/Aggregation/TopHits.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ public function setSort(array $sortArgs)
6666
/**
6767
* Allows to control how the _source field is returned with every hit.
6868
*
69-
* @param array $fields
69+
* @param array|bool $params Fields to be returned or false to disable source
7070
*
7171
* @return $this
7272
*/
73-
public function setSource(array $fields)
73+
public function setSource($params)
7474
{
75-
return $this->setParam('_source', $fields);
75+
return $this->setParam('_source', $params);
7676
}
7777

7878
/**

0 commit comments

Comments
 (0)