From 48f1ce00d6f26c6ec821e377627ccc12883d2e37 Mon Sep 17 00:00:00 2001 From: Ali Tauquir Date: Mon, 5 May 2014 12:38:00 +0530 Subject: [PATCH 1/2] named function for source filtering. --- lib/Elastica/Query.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/Elastica/Query.php b/lib/Elastica/Query.php index d9c5e5f664..b729654dae 100755 --- a/lib/Elastica/Query.php +++ b/lib/Elastica/Query.php @@ -387,6 +387,18 @@ public function setRescore($rescore) { $this->setParam('rescore', $rescore->toArray()); } + + /** + * Sets the _source field to be returned with every hit + * + * @param array $fields Fields to be returned + * @return \Elastica\Query Current object + * @link http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-request-source-filtering.html + */ + public function setSource(array $fields) + { + return $this->setParam('_source', $fields); + } } From 08083d2b303b2d3a9267f568fec6adc01c2ee8cd Mon Sep 17 00:00:00 2001 From: Ali Tauquir Date: Mon, 5 May 2014 12:41:36 +0530 Subject: [PATCH 2/2] changes.txt updated. --- changes.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/changes.txt b/changes.txt index 4f74f67a60..fb74dd0ce7 100755 --- a/changes.txt +++ b/changes.txt @@ -1,5 +1,8 @@ CHANGES +2014-05-05 +- Added named function for source filtering #605 + 2014-04-28 - Typo fixes #600, #602 - Remove unreachable return statement #598