Skip to content

Commit ab1c001

Browse files
/documents API reference: address review feedback
1 parent ad9b84f commit ab1c001

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

.code-samples.meilisearch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ delete_an_index_1: |-
2727
-X DELETE 'http://localhost:7700/indexes/movies'
2828
get_one_document_1: |-
2929
curl \
30-
-X GET 'http://localhost:7700/indexes/movies/documents/25684'
30+
-X GET 'http://localhost:7700/indexes/movies/documents/25684?fields=id,title,poster,release_date'
3131
get_documents_1: |-
3232
curl \
3333
-X GET 'http://localhost:7700/indexes/movies/documents?limit=2'

reference/api/documents.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ The `/documents` route allows you to create, manage, and delete documents.
1010

1111
Get one [document](/learn/core_concepts/documents.md) using its unique id. Both the index [`uid`](/learn/core_concepts/indexes.md#index-uid) and [document id](/learn/core_concepts/primary_key.md#document-id) are required.
1212

13+
You can use the optional `fields` query parameter to specify which document fields Meilisearch should include in the response body. `fields` accepts a case-sensitive list of document fields separated by a comma.
14+
15+
#### Query parameters
16+
17+
| Query Parameter | Description | Default Value |
18+
| ------------------------ | ------------------------------ | :-----------: |
19+
| **fields** | Document attributes to show | \* |
20+
1321
### Example
1422

1523
<CodeSamples id="get_one_document_1" />
@@ -21,7 +29,6 @@ Get one [document](/learn/core_concepts/documents.md) using its unique id. Both
2129
"id": 25684,
2230
"title": "American Ninja 5",
2331
"poster": "https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg",
24-
"overview": "When a scientists daughter is kidnapped, American Ninja, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the ninja.",
2532
"release_date": "1993-01-01"
2633
}
2734
```
@@ -42,9 +49,9 @@ Documents are ordered by Meilisearch depending on the hash of their id.
4249

4350
| Query Parameter | Description | Default Value |
4451
| ------------------------ | ------------------------------ | :-----------: |
45-
| **offset** | number of documents to skip | 0 |
46-
| **limit** | number of documents to return | 20 |
47-
| **fields** | document attributes to show | \* |
52+
| **offset** | Number of documents to skip | 0 |
53+
| **limit** | Number of documents to return | 20 |
54+
| **fields** | Document attributes to show | \* |
4855

4956
### Example
5057

0 commit comments

Comments
 (0)