You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Resources/doc/find_functions.md
+14
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,20 @@ $content = $repo->find(1); // 5 is the document _uid in the elasticsearch.
19
19
20
20
> All `find` methods return an object. If you want to get raw result use `execute($search, Result::RESULTS_RAW)`.
21
21
22
+
## Find multiple documents by ID
23
+
24
+
If multiple documents need to be found by their IDs, `findByIds()` method can be used. It accepts an array of document IDs
25
+
and returns `DocumentIterator` with found documents:
26
+
27
+
```php
28
+
29
+
$documents = $repo->findByIds(['26', '8', '11']);
30
+
31
+
```
32
+
33
+
For this functionality the `Repository` uses
34
+
[elasticsearch multi get API](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html).
35
+
22
36
## Find by field
23
37
24
38
Find by field uses [query_string query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html) to fetch results by a specified field value.
0 commit comments