Skip to content

Commit 8dd73c7

Browse files
Add info on custom metadata for document tasks (#3401)
1 parent 5280199 commit 8dd73c7

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

reference/api/documents.mdx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ This endpoint accepts the following content types:
256256
| :----------------- | :------------ | :-------------------------------------------------------------------------------------------------------------------------------------- |
257257
| **`primaryKey`** | `null` | [Primary key](/learn/getting_started/primary_key#primary-field) of the index |
258258
| **`csvDelimiter`** | `","` | Configure the character separating CSV fields. Must be a string containing [one ASCII character](https://www.rfc-editor.org/rfc/rfc20). |
259+
| **`customMetadata`** | `null` | An arbitrary string accessible via the [generated task object](/reference/api/tasks#custommetadata) |
259260

260261
<Warning>
261262
Configuring `csvDelimiter` and sending data with a content type other than CSV will cause Meilisearch to throw an error.
@@ -378,6 +379,7 @@ This endpoint accepts the following content types:
378379
| :----------------- | :------------ | :-------------------------------------------------------------------------------------------------------------------------------------- |
379380
| **`primaryKey`** | `null` | [Primary key](/learn/getting_started/primary_key#primary-field) of the documents |
380381
| **`csvDelimiter`** | `","` | Configure the character separating CSV fields. Must be a string containing [one ASCII character](https://www.rfc-editor.org/rfc/rfc20). |
382+
| **`customMetadata`** | `null` | An arbitrary string accessible via the [generated task object](/reference/api/tasks#custommetadata) |
381383

382384
<Warning>
383385
Configuring `csvDelimiter` and sending data with a content type other than CSV will cause Meilisearch to throw an error.
@@ -451,6 +453,7 @@ curl \
451453
| **`function`** | `null` | A string containing a RHAI function |
452454
| **`filter`** | `null` | A string containing a filter expression |
453455
| **`context`** | `null` | An object with data Meilisearch should make available for the editing function |
456+
| **`customMetadata`** | `null` | An arbitrary string accessible via the [generated task object](/reference/api/tasks#custommetadata) |
454457

455458
#### `function`
456459

@@ -487,6 +490,12 @@ Delete all documents in the specified index.
487490
| :---------------- | :----- | :--------------------------------------------------------------------- |
488491
| **`index_uid`** * | String | [`uid`](/learn/getting_started/indexes#index-uid) of the requested index |
489492

493+
### Query parameters
494+
495+
| Query Parameter | Default Value | Description |
496+
| :----------------- | :------------ | :-------------------------------------------------------------------------------------------------------------------------------------- |
497+
| **`customMetadata`** | `null` | An arbitrary string accessible via the [generated task object](/reference/api/tasks#custommetadata) |
498+
490499
### Example
491500

492501
<CodeSamplesDeleteAllDocuments1 />
@@ -518,6 +527,12 @@ Delete one document based on its unique id.
518527
| **`index_uid`** * | String | [`uid`](/learn/getting_started/indexes#index-uid) of the requested index |
519528
| **`document_id`** * | String/Integer | [Document id](/learn/getting_started/primary_key#document-id) of the requested document |
520529

530+
### Query parameters
531+
532+
| Query Parameter | Default Value | Description |
533+
| :----------------- | :------------ | :-------------------------------------------------------------------------------------------------------------------------------------- |
534+
| **`customMetadata`** | `null` | An arbitrary string accessible via the [generated task object](/reference/api/tasks#custommetadata) |
535+
521536
### Example
522537

523538
<CodeSamplesDeleteOneDocument1 />
@@ -548,6 +563,12 @@ Delete a set of documents based on a filter.
548563
| :---------------- | :----- | :--------------------------------------------------------------------- |
549564
| **`index_uid`** * | String | [`uid`](/learn/getting_started/indexes#index-uid) of the requested index |
550565

566+
### Query parameters
567+
568+
| Query Parameter | Default Value | Description |
569+
| :----------------- | :------------ | :-------------------------------------------------------------------------------------------------------------------------------------- |
570+
| **`customMetadata`** | `null` | An arbitrary string accessible via the [generated task object](/reference/api/tasks#custommetadata) |
571+
551572
### Body
552573

553574
A filter expression written as a string or array of array of strings for the documents to be deleted.
@@ -594,6 +615,12 @@ Delete a set of documents based on an array of document ids.
594615
| :---------------- | :----- | :--------------------------------------------------------------------- |
595616
| **`index_uid`** * | String | [`uid`](/learn/getting_started/indexes#index-uid) of the requested index |
596617

618+
### Query parameters
619+
620+
| Query Parameter | Default Value | Description |
621+
| :----------------- | :------------ | :-------------------------------------------------------------------------------------------------------------------------------------- |
622+
| **`customMetadata`** | `null` | An arbitrary string accessible via the [generated task object](/reference/api/tasks#custommetadata) |
623+
597624
### Body
598625

599626
An array of numbers containing the unique ids of the documents to be deleted.

reference/api/tasks.mdx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,7 @@ The `details` object is set to `null` for `snapshotCreation` tasks.
187187
| **`type`** | The [error type](/reference/errors/overview#errors) |
188188
| **`link`** | A link to the relevant section of the documentation |
189189

190-
### `network`
191-
192-
<NoticeTag type="experimental" label="experimental" />
190+
### `network` <NoticeTag type="experimental" label="experimental" />
193191

194192
**Type**: Object<br />
195193
**Description**: If the task was replicated from another remote or to other remotes, `network` will contain information about the remote task uids corresponding to this task. Otherwise, missing in task object.
@@ -228,8 +226,6 @@ curl \
228226
```
229227
</Note>
230228

231-
232-
233229
### `duration`
234230

235231
**Type**: String<br />
@@ -250,6 +246,11 @@ curl \
250246
**Type**: String<br />
251247
**Description**: The date and time when the task finished `processing`, whether `failed`, `succeeded`, or `canceled`, in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format
252248

249+
### `customMetadata`
250+
251+
**Type**: String<br />
252+
**Description**: An arbitrary string optionally configured for tasks adding, updating, and deleting documents. Commonly used to keep track of which documents were processed in a specific task.
253+
253254
### Summarized task object
254255

255256
When an API request triggers an asynchronous process, Meilisearch returns a summarized task object. This object contains the following fields:

0 commit comments

Comments
 (0)