Skip to content

Commit af2c8a8

Browse files
add info on custom metadata for document tasks
1 parent a039555 commit af2c8a8

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
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 in 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 in 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 in 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 in 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 in 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 in 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 in 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: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ The `/tasks` route gives information about the progress of [asynchronous operati
3535
"duration": "PT0.001192S",
3636
"enqueuedAt": "2022-08-04T12:28:15.159167Z",
3737
"startedAt": "2022-08-04T12:28:15.161996Z",
38-
"finishedAt": "2022-08-04T12:28:15.163188Z"
38+
"finishedAt": "2022-08-04T12:28:15.163188Z",
39+
"customMetadata": null
3940
}
4041
```
4142

@@ -250,6 +251,11 @@ curl \
250251
**Type**: String<br />
251252
**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
252253

254+
### `customMetadata`
255+
256+
**Type**: String<br />
257+
**Description**: An arbitrary string optionally configured for `/document`-related tasks. Commonly used to keep track of which documents were processed in a specific task.
258+
253259
### Summarized task object
254260

255261
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)