Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Source Filtering. #606

Merged
merged 2 commits into from
May 10, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changes.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 12 additions & 0 deletions lib/Elastica/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}


Expand Down