diff --git a/README.md b/README.md index fb6835fed..35c60a2ff 100644 --- a/README.md +++ b/README.md @@ -71,9 +71,9 @@ The recommended method to install _Elasticsearch-PHP_ is through [Composer](http ```php build(); @@ -170,6 +170,19 @@ Array ) ``` +If you want to retrieve the `_source` field directly, there is the `getSource` method: + +```php +$params = [ + 'index' => 'my_index', + 'type' => 'my_type', + 'id' => 'my_id' +]; + +$source = $client->getSource($params); +doSomething($source); +``` + ### Search for a document Searching is a hallmark of Elasticsearch, so let's perform a search. We are going to use the Match query as a demonstration: