File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -71,9 +71,9 @@ The recommended method to install _Elasticsearch-PHP_ is through [Composer](http
71
71
72
72
```php
73
73
<?php
74
-
74
+
75
75
use Elasticsearch\ClientBuilder;
76
-
76
+
77
77
require 'vendor/autoload.php';
78
78
79
79
$client = ClientBuilder::create()->build();
@@ -170,6 +170,19 @@ Array
170
170
)
171
171
```
172
172
173
+ If you want to retrieve the ` _source ` field directly, there is the ` getSource ` method:
174
+
175
+ ``` php
176
+ $params = [
177
+ 'index' => 'my_index',
178
+ 'type' => 'my_type',
179
+ 'id' => 'my_id'
180
+ ];
181
+
182
+ $source = $client->getSource($params);
183
+ doSomething($source);
184
+ ```
185
+
173
186
### Search for a document
174
187
175
188
Searching is a hallmark of Elasticsearch, so let's perform a search. We are going to use the Match query as a demonstration:
You can’t perform that action at this time.
0 commit comments