Skip to content

Commit 3cf27c6

Browse files
Merge branch 'v0.28' into v0.28-faceting-settings
2 parents c93be15 + 4a53358 commit 3cf27c6

33 files changed

+667
-559
lines changed

.code-samples.meilisearch.yaml

Lines changed: 57 additions & 59 deletions
Large diffs are not rendered by default.

.vuepress/public/postman/meilisearch-collection.json

Lines changed: 222 additions & 81 deletions
Large diffs are not rendered by default.

.vuepress/public/sample-template.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ delete_all_documents_1: |-
1616
delete_one_document_1: |-
1717
delete_documents_1: |-
1818
search_post_1: |-
19-
get_task_by_index_1: |-
2019
get_all_tasks_1: |-
2120
get_task_1: |-
22-
get_all_tasks_by_index_1: |-
21+
get_all_tasks_filtering_1: |-
22+
get_all_tasks_filtering_2: |-
23+
get_all_tasks_paginating_1: |-
24+
get_all_tasks_paginating_2: |-
2325
get_one_key_1: |-
2426
get_all_keys_1: |-
2527
create_a_key_1: |-
@@ -65,7 +67,7 @@ search_parameter_guide_limit_1: |-
6567
search_parameter_guide_retrieve_1: |-
6668
search_parameter_guide_crop_1: |-
6769
search_parameter_guide_highlight_1: |-
68-
search_parameter_guide_matches_1: |-
70+
search_parameter_guide_show_matches_position_1: |-
6971
settings_guide_synonyms_1: |-
7072
settings_guide_stop_words_1: |-
7173
settings_guide_ranking_rules_1: |-
@@ -90,11 +92,10 @@ getting_started_sorting: |-
9092
getting_started_filtering: |-
9193
faceted_search_update_settings_1: |-
9294
faceted_search_filter_1: |-
93-
faceted_search_facets_distribution_1: |-
95+
faceted_search_facets_1: |-
9496
faceted_search_walkthrough_filter_1: |-
9597
add_movies_json_1: |-
9698
post_dump_1: |-
97-
get_dump_status_1: |-
9899
phrase_search_1: |-
99100
sorting_guide_update_sortable_attributes_1: |-
100101
sorting_guide_update_ranking_rules_1: |-
@@ -140,7 +141,6 @@ updating_guide_get_displayed_attributes_old: |-
140141
updating_guide_reset_displayed_attributes_old: |-
141142
updating_guide_reset_displayed_attributes_new: |-
142143
updating_guide_create_dump: |-
143-
updating_guide_get_dump_status: |-
144144
updating_guide_get_settings_old: |-
145145
updating_guide_retrieve_documents_old: |-
146146
updating_guide_update_settings_old: |-

learn/advanced/asynchronous_operations.md

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,29 @@ For example, updating the `filterableAttributes` index setting will require as m
1010

1111
Currently, these are Meilisearch's asynchronous operations:
1212

13-
- Updating index settings
14-
- Adding documents to an index
15-
- Updating documents in an index
1613
- Creating an index
1714
- Updating an index
1815
- Deleting an index
1916
- Updating index settings
2017
- Adding documents to an index
2118
- Updating documents in an index
2219
- Deleting documents from an index
23-
- [Creating a dump](#dumps)
20+
- Creating a dump
2421

2522
## Understanding tasks
2623

27-
Most of Meilisearch's asynchronous operations belong to a category called "tasks". After you have requested an asynchronous operation, you can use the [task API](/reference/api/tasks.md) to find the detailed status of your request. To do so, you will need your task's `uid`.
24+
All of Meilisearch's asynchronous operations belong to a category called "tasks". After you have requested an asynchronous operation, you can use the [task API](/reference/api/tasks.md) to find the detailed status of your request. To do so, you will need the task's unique identifier.
2825

29-
### Response
26+
### Task API response
3027

3128
The response from the [task API](/reference/api/tasks.md) will always include the following fields in the stated order:
3229

3330
| Field | Type | Description |
3431
|--------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------|
3532
| `uid` | integer | The unique sequential identifier of the task |
36-
| `indexUid` | string | The unique index identifier |
33+
| `indexUid` | string | The unique index identifier (always `null` for dumps) |
3734
| `status` | string | The status of the task. Possible values are `enqueued`, `processing`, `succeeded`, `failed` |
38-
| `type` | string | The type of task. Possible values are `indexCreation`, `indexUpdate`, `indexDeletion`, `documentAddition`, `documentPartial`, `documentDeletion`, `settingsUpdate`, `clearAll` |
35+
| `type` | string | The type of task. Possible values are `indexCreation`, `indexUpdate`, `indexDeletion`, `documentAdditionOrUpdate`, `documentPartial`, `documentDeletion`, `settingsUpdate`, `clearAll`, `dumpCreation` |
3936
| `details` | object | Detailed information on the task payload |
4037
| `error` | object | Error details and context. Only present when a task has the `failed` status |
4138
| `duration` | string | The total elapsed time the task spent in the `processing` state, in ISO 8601 format |
@@ -47,17 +44,17 @@ If a task fails due to an error, all error fields will be appended to the task r
4744

4845
### Summarized task objects
4946

50-
All asynchronous operations return a summarized version of the [`task` object](#response). It contains the following fields in the stated order:
47+
All asynchronous operations return a summarized version of [the full `task` object](#task-api-response). It contains the following fields in the stated order:
5148

5249
| Field | Type | Description |
5350
|------------|---------|--------------------------------- |
5451
| `uid` | integer | Unique sequential identifier |
55-
| `indexUid` | string | Unique index identifier |
52+
| `indexUid` | string | Unique index identifier (always `null` for dumps) |
5653
| `status` | string | Status of the task. Value is `enqueued` |
5754
| `type` | string | Type of task |
5855
| `enqueuedAt` | string | Represents the date and time in the RFC 3339 format when the task has been `enqueued` |
5956

60-
You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
57+
You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
6158

6259
### Task `status`
6360

@@ -70,16 +67,16 @@ Task responses always contain a field indicating the request's current `status`.
7067

7168
### Examples
7269

73-
Suppose you add a new document to your instance using the [add documents endpoint](/reference/api/documents.md#add-or-replace-documents) and receive a `uid` in response.
70+
Suppose you add a new document to your instance using the [add documents endpoint](/reference/api/documents.md#add-or-replace-documents) and receive a `taskUid` in response.
7471

75-
When you query the task endpoint using this `uid`, you see that it has been enqueued:
72+
When you query the [get task endpoint](/reference/api/tasks.md#get-one-task) using this value, you see that it has been enqueued:
7673

7774
```json
7875
{
7976
"uid": 1,
8077
"indexUid": "movies",
8178
"status": "enqueued",
82-
"type": "documentAddition",
79+
"type": "documentAdditionOrUpdate",
8380
"details": {
8481
"receivedDocuments": 67493,
8582
"indexedDocuments": null
@@ -98,7 +95,7 @@ Later, you check the request's status one more time. It was successfully process
9895
"uid": 1,
9996
"indexUid": "movies",
10097
"status": "succeeded",
101-
"type": "documentAddition",
98+
"type": "documentAdditionOrUpdate",
10299
"details": {
103100
"receivedDocuments": 67493,
104101
"indexedDocuments": 67493
@@ -117,7 +114,7 @@ Had the task failed, the response would have included an `error` object:
117114
"uid": 1,
118115
"indexUid": "movies",
119116
"status": "failed",
120-
"type": "documentAddition",
117+
"type": "documentAdditionOrUpdate",
121118
"details": {
122119
"receivedDocuments": 67493,
123120
"indexedDocuments": 0
@@ -137,16 +134,12 @@ Had the task failed, the response would have included an `error` object:
137134

138135
## Task workflow
139136

140-
1. When you make a task request, Meilisearch puts it in the task queue, sets the task's `status` to `enqueued` and returns a [`task` object](/learn/advanced/asynchronous_operations.md#response)
137+
1. When you make an [asynchronous request](#which-operations-are-async), Meilisearch puts it in the task queue, sets the task's `status` to `enqueued` and returns a [summarized `task` object](/learn/advanced/asynchronous_operations.md#summarized-task-objects)
141138
2. When your task reaches the front of the queue, Meilisearch begins working on it and changes the request `status` to `processing`
142139
3. Once the task has completed processing, Meilisearch marks it as `succeeded`, if it was successful, or `failed`, if there was an error.
143-
4. Tasks marked as `succeeded` or `failed` are not deleted and will remain visible in [the task list](/reference/api/tasks.md#get-all-tasks)
144-
145-
### Dumps
146-
147-
While dumps and tasks are both asynchronous operations, they use separate queues and behave differently. For instance, creating a new dump will freeze the task queue until the dump has been generated.
140+
4. Tasks marked as `succeeded` or `failed` are not deleted and will remain visible in [the task list](/reference/api/tasks.md#get-tasks)
148141

149-
[You can read more about dumps in our dedicated guide.](/learn/advanced/dumps.md)
142+
Tasks are processed in the order they were enqueued, with one exception: `dumpCreation`. Dumps are prioritized over all other tasks in the queue. Their task `uid` still reflects when they were enqueued relative to other tasks.
150143

151144
## Terminate Meilisearch while a task is being processed
152145

@@ -156,8 +149,8 @@ Meilisearch's asynchronous tasks are atomic. This means that all operations conc
156149

157150
What happens to an asynchronous operation when Meilisearch is terminated changes depending on the request's `status`:
158151

159-
- `enqueued`: the task will remain enqueued and will be processed as usual once is restarted
160-
- `processing`: there will be no consequences, since no part of the task has been committed to the database. After restarting, will treat the task as `enqueued`
152+
- `enqueued`: the task will remain enqueued and will be processed as usual once Meilisearch has been restarted
153+
- `processing`: there will be no consequences, since no part of the task has been committed to the database. After restarting, the task will be treated as `enqueued`
161154
- `succeeded`: there will be no data loss since the request was successfully completed
162155
- `failed`: the task failed and nothing has been altered in the database
163156

learn/advanced/dumps.md

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,61 @@
11
# Dumps
22

3-
A dump is a compressed file containing an export of your Meilisearch instance. It contains all your indexes, documents, and settings, but in a raw unprocessed form. A dump isn't an exact copy of your database—it is closer to a blueprint that allows you to create an identical dataset. A dump can be imported when launching Meilisearch, but be advised that it may take some time to index all the documents within.
3+
A dump is a compressed file containing an export of your Meilisearch instance. It contains all your indexes, documents, and settings, but in a raw unprocessed form. A dump isn't an exact copy of your database—it is closer to a blueprint that allows you to create an identical dataset.
4+
5+
A dump can be imported when launching Meilisearch, but be advised that it may take some time to index.
46

57
## Creating a dump
68

79
To create a dump of your dataset, you need to use the appropriate HTTP route: [`POST /dumps`](/reference/api/dump.md#create-a-dump). The dump creation process is an asynchronous task that takes time proportional to the size of your dataset.
810

911
<CodeSamples id="post_dump_1" />
1012

11-
The above code triggers a dump creation process. It also returns an object containing information about the dump:
13+
The above code triggers a dump creation process. It also returns a [summarized task object](/learn/advanced/asynchronous_operations.md#summarized-task-objects) that you can use to check the status of your dump.
1214

13-
```
15+
```json
1416
{
15-
"uid": "20200929-114144097",
16-
"status": "in_progress",
17-
"startedAt": "2020-09-29T11:41:44.392327Z"
17+
"taskUid": 1,
18+
"indexUid": null,
19+
"status": "enqueued",
20+
"type": "dumpCreation",
21+
"enqueuedAt": "2022-06-21T16:10:29.217688Z"
1822
}
1923
```
2024

21-
You can use the returned `uid` (unique identifier indicating when the dump was triggered) to track its progress with the [get dump status route](/reference/api/dump.md#get-dump-status). The returned status could be:
22-
23-
- `in_progress`: Dump creation is in progress
24-
- `failed`: An error occurred during dump process, and the task was aborted
25-
- `done`: Dump creation is finished and was successful
25+
In the below command, replace `1` with the `taskUid` returned by the previous command.
2626

27-
<CodeSamples id="get_dump_status_1" />
27+
<CodeSamples id="get_task_1" />
2828

29-
The above code sample returns an object with the following details about the dump:
29+
This command should return an object with detailed information about the dump operation:
3030

31-
```
31+
```json
3232
{
33-
"uid": "20200929-114144097",
34-
"status": "done",
35-
"startedAt": "2020-09-29T11:41:44.392327Z",
36-
"finishedAt": "2020-09-29T11:41:50.792147Z"
33+
"uid": 1,
34+
"indexUid": null,
35+
"status": "succeeded",
36+
"type": "dumpCreation",
37+
"details": {
38+
"dumpUid": "20220621-161029217"
39+
},
40+
"duration": "PT0.025872S",
41+
"enqueuedAt": "2022-06-21T16:10:29.217688Z",
42+
"startedAt": "2022-06-21T16:10:29.218297Z",
43+
"finishedAt": "2022-06-21T16:10:29.244169Z"
3744
}
3845
```
3946

40-
After dump creation is finished, the dump file is added to the dump directory. By default, this folder is named `dumps` and can be found in the same directory as your Meilisearch binary. You can customize [this using the `--dumps-dir` configuration option](/learn/configuration/instance_options.md#dumps-destination). **If the dump directory does not already exist when the dump creation process is called, Meilisearch will create it.**
47+
After dump creation is finished—when `status` is `succeeded`the dump file is added to the dump directory. By default, this folder is named `dumps` and can be found in the same directory as your Meilisearch binary. You can customize [this using the `--dumps-dir` configuration option](/learn/configuration/instance_options.md#dumps-destination). **If the dump directory does not already exist when the dump creation process is called, Meilisearch will create it.**
4148

4249
If a dump file is visible in the file system, the dump process was successfully completed. **Meilisearch will never create a partial dump file**, even if you interrupt an instance while it is generating a dump.
4350

44-
::: note
45-
Unlike [tasks](/learn/advanced/asynchronous_operations.md), dumps have no queue. **Meilisearch only processes one dump at a time.** If you attempt to create a dump while another dump is still processing, Meilisearch will throw an [error](/reference/api/error_codes.md#dump-already-processing).
46-
47-
Meilisearch does not process tasks during dump creation, but you can still add new requests to the task queue. This is also true for [snapshots](/learn/advanced/snapshots.md#snapshots).
48-
:::
49-
50-
::: warning
51-
If you restart Meilisearch after creating a dump, you will not be able to use the dumps endpoint to find out that dump's `status`. This has no effect on the dump file itself.
52-
:::
53-
5451
## Importing a dump
5552

5653
When a dump is being imported, the API is not available to the task queue. As a result, no read or write operations can be performed until the importing process is complete.
5754

58-
Dumps in v0.20.0 and below are no longer compatible with the new versions. Before you start importing, check your [Meilisearch version](/reference/api/version.md#example) and proceed accordingly.
55+
Dumps from v0.20.0 and below are no longer compatible with the new versions. Before you start importing, check your [Meilisearch version](/reference/api/version.md#example) and proceed accordingly.
5956

6057
::: note
61-
We do not recommend using dumps from a new Meilisearch version to import an older version.
58+
We do not recommend using dumps to migrate from a new Meilisearch version to an older one.
6259

6360
For example, you can import a dump from Meilisearch v0.21 into v0.22 without any problems. Importing a dump generated in v0.22 into a v0.21 instance, however, can lead to unexpected behavior.
6461
:::
@@ -79,4 +76,4 @@ If you are using Meilisearch v0.20 or below, migration should be done in two ste
7976

8077
## Use cases
8178

82-
Dumps are used to restore your database after [updating Meilisearch](/learn/advanced/updating.md) or to copy your database to other Meilisearch instances without having to worry about their respective versions.
79+
Dumps are used to restore your database after [updating Meilisearch](/learn/advanced/updating.md) or to copy your database to other Meilisearch instances without having to worry about their respective versions. For more on this subject, see a [comparison of snapshots and dumps](/learn/advanced/snapshots_vs_dumps.md).

0 commit comments

Comments
 (0)