diff --git a/reference/api/documents.mdx b/reference/api/documents.mdx index 69ad3776d..aed9eb86a 100644 --- a/reference/api/documents.mdx +++ b/reference/api/documents.mdx @@ -256,6 +256,7 @@ This endpoint accepts the following content types: | :----------------- | :------------ | :-------------------------------------------------------------------------------------------------------------------------------------- | | **`primaryKey`** | `null` | [Primary key](/learn/getting_started/primary_key#primary-field) of the index | | **`csvDelimiter`** | `","` | Configure the character separating CSV fields. Must be a string containing [one ASCII character](https://www.rfc-editor.org/rfc/rfc20). | +| **`customMetadata`** | `null` | An arbitrary string accessible via the [generated task object](/reference/api/tasks#custommetadata) | 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: | :----------------- | :------------ | :-------------------------------------------------------------------------------------------------------------------------------------- | | **`primaryKey`** | `null` | [Primary key](/learn/getting_started/primary_key#primary-field) of the documents | | **`csvDelimiter`** | `","` | Configure the character separating CSV fields. Must be a string containing [one ASCII character](https://www.rfc-editor.org/rfc/rfc20). | +| **`customMetadata`** | `null` | An arbitrary string accessible via the [generated task object](/reference/api/tasks#custommetadata) | Configuring `csvDelimiter` and sending data with a content type other than CSV will cause Meilisearch to throw an error. @@ -451,6 +453,7 @@ curl \ | **`function`** | `null` | A string containing a RHAI function | | **`filter`** | `null` | A string containing a filter expression | | **`context`** | `null` | An object with data Meilisearch should make available for the editing function | +| **`customMetadata`** | `null` | An arbitrary string accessible via the [generated task object](/reference/api/tasks#custommetadata) | #### `function` @@ -487,6 +490,12 @@ Delete all documents in the specified index. | :---------------- | :----- | :--------------------------------------------------------------------- | | **`index_uid`** * | String | [`uid`](/learn/getting_started/indexes#index-uid) of the requested index | +### Query parameters + +| Query Parameter | Default Value | Description | +| :----------------- | :------------ | :-------------------------------------------------------------------------------------------------------------------------------------- | +| **`customMetadata`** | `null` | An arbitrary string accessible via the [generated task object](/reference/api/tasks#custommetadata) | + ### Example @@ -518,6 +527,12 @@ Delete one document based on its unique id. | **`index_uid`** * | String | [`uid`](/learn/getting_started/indexes#index-uid) of the requested index | | **`document_id`** * | String/Integer | [Document id](/learn/getting_started/primary_key#document-id) of the requested document | +### Query parameters + +| Query Parameter | Default Value | Description | +| :----------------- | :------------ | :-------------------------------------------------------------------------------------------------------------------------------------- | +| **`customMetadata`** | `null` | An arbitrary string accessible via the [generated task object](/reference/api/tasks#custommetadata) | + ### Example @@ -548,6 +563,12 @@ Delete a set of documents based on a filter. | :---------------- | :----- | :--------------------------------------------------------------------- | | **`index_uid`** * | String | [`uid`](/learn/getting_started/indexes#index-uid) of the requested index | +### Query parameters + +| Query Parameter | Default Value | Description | +| :----------------- | :------------ | :-------------------------------------------------------------------------------------------------------------------------------------- | +| **`customMetadata`** | `null` | An arbitrary string accessible via the [generated task object](/reference/api/tasks#custommetadata) | + ### Body 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. | :---------------- | :----- | :--------------------------------------------------------------------- | | **`index_uid`** * | String | [`uid`](/learn/getting_started/indexes#index-uid) of the requested index | +### Query parameters + +| Query Parameter | Default Value | Description | +| :----------------- | :------------ | :-------------------------------------------------------------------------------------------------------------------------------------- | +| **`customMetadata`** | `null` | An arbitrary string accessible via the [generated task object](/reference/api/tasks#custommetadata) | + ### Body An array of numbers containing the unique ids of the documents to be deleted. diff --git a/reference/api/tasks.mdx b/reference/api/tasks.mdx index 6dbfd5ab2..daa0e05fe 100644 --- a/reference/api/tasks.mdx +++ b/reference/api/tasks.mdx @@ -187,9 +187,7 @@ The `details` object is set to `null` for `snapshotCreation` tasks. | **`type`** | The [error type](/reference/errors/overview#errors) | | **`link`** | A link to the relevant section of the documentation | -### `network` - - +### `network` **Type**: Object
**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 \ ``` - - ### `duration` **Type**: String
@@ -250,6 +246,11 @@ curl \ **Type**: String
**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 +### `customMetadata` + +**Type**: String
+**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. + ### Summarized task object When an API request triggers an asynchronous process, Meilisearch returns a summarized task object. This object contains the following fields: diff --git a/snippets/samples/code_samples_get_documents_1.mdx b/snippets/samples/code_samples_get_documents_1.mdx index f391ceffa..199e8fe7c 100644 --- a/snippets/samples/code_samples_get_documents_1.mdx +++ b/snippets/samples/code_samples_get_documents_1.mdx @@ -13,7 +13,10 @@ client.index('movies').getDocuments({ ``` ```python Python -client.index('movies').get_documents({'limit':2, 'filter': 'genres=action'}) +client.index('movies').get_documents({ + 'limit':2, 'filter': 'genres=action', + 'sort': ['rating:desc', 'release_date:asc'] # list format +}) ``` ```php PHP diff --git a/snippets/samples/code_samples_get_documents_post_1.mdx b/snippets/samples/code_samples_get_documents_post_1.mdx index a507357f0..6fac124c5 100644 --- a/snippets/samples/code_samples_get_documents_post_1.mdx +++ b/snippets/samples/code_samples_get_documents_post_1.mdx @@ -23,7 +23,8 @@ client.index('books').getDocuments({ client.index('books').get_documents({ 'limit':3, 'fields': ['title', 'genres', 'rating', 'language'], - 'filter': '(rating > 3 AND (genres=Adventure OR genres=Fiction)) AND language=English' + 'filter': '(rating > 3 AND (genres=Adventure OR genres=Fiction)) AND language=English', + 'sort': 'rating:desc, title:asc' # comma-separated string format }) ```