Skip to content

Commit

Permalink
v1.5 (#2612)
Browse files Browse the repository at this point in the history
* Update `/metrics` with HTTP API activation info (#2614)

* v1.5: Add Khmer to list of officially supported languages (#2617)

* Bump docker version (#2618)

* v1.5: Postman collection (#2619)

* v1.5: Puffin reports (#2613)

* v1.5: New `/snapshots` API route (#2616)

---------

Co-authored-by: Clément Renault <[email protected]>
  • Loading branch information
guimachiavelli and Kerollmops authored Nov 20, 2023
1 parent 67d5a89 commit a8a4576
Show file tree
Hide file tree
Showing 15 changed files with 170 additions and 43 deletions.
3 changes: 3 additions & 0 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1144,3 +1144,6 @@ update_dictionary_1: |-
reset_dictionary_1: |-
curl \
-X DELETE 'http://localhost:7700/indexes/books/settings/dictionary'
create_snapshot_1: |-
curl \
-X POST 'http://localhost:7700/snapshots'
49 changes: 47 additions & 2 deletions assets/misc/meilisearch-collection-postman.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"info": {
"_postman_id": "ca046707-e482-4e2c-a524-0574bd10dd5f",
"name": "Meilisearch v1.4",
"_postman_id": "5ac31b23-8cd6-41d5-b1ed-a47123edc334",
"name": "Meilisearch v1.5",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
Expand Down Expand Up @@ -2437,6 +2437,51 @@
}
]
},
{
"name": "Snapshots",
"item": [
{
"name": "Create a snapshot",
"protocolProfileBehavior": {
"disabledSystemHeaders": {}
},
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "{{url}}/snapshots",
"host": [
"{{url}}"
],
"path": [
"snapshots"
]
}
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
]
},
{
"name": "Facet search",
"item": [
Expand Down
5 changes: 5 additions & 0 deletions config/sidebar-learn.json
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,11 @@
"label": "Metrics",
"slug": "metrics"
},
{
"source": "learn/experimental/puffin_reports.mdx",
"label": "Puffin reports",
"slug": "puffin_reports"
},
{
"source": "learn/experimental/reduce-indexing-memory-usage.mdx",
"label": "Reduce indexing memory usage",
Expand Down
5 changes: 5 additions & 0 deletions config/sidebar-reference.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
"label": "Settings",
"slug": "settings"
},
{
"source": "reference/api/snapshots.mdx",
"label": "Snapshots",
"slug": "snapshots"
},
{
"source": "reference/api/stats.mdx",
"label": "Stats",
Expand Down
16 changes: 8 additions & 8 deletions learn/cookbooks/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Docker is a tool that bundles applications into containers. Docker containers en
Docker containers are distributed in images. To use Meilisearch, use the `docker pull` command to download a Meilisearch image:

```sh
docker pull getmeili/meilisearch:v1.4
docker pull getmeili/meilisearch:v1.5
```

Meilisearch deploys a new Docker image with every release of the engine. Each image is tagged with the corresponding Meilisearch version, indicated in the above example by the text following the `:` symbol. You can see [the full list of available Meilisearch Docker images](https://hub.docker.com/r/getmeili/meilisearch/tags#!) on Docker Hub.
Expand All @@ -31,7 +31,7 @@ After completing the previous step, use `docker run` to launch the Meilisearch i
docker run -it --rm \
-p 7700:7700 \
-v $(pwd)/meili_data:/meili_data \
getmeili/meilisearch:v1.4
getmeili/meilisearch:v1.5
```

### Configure Meilisearch
Expand All @@ -47,7 +47,7 @@ docker run -it --rm \
-p 7700:7700 \
-e MEILI_MASTER_KEY='MASTER_KEY'\
-v $(pwd)/meili_data:/meili_data \
getmeili/meilisearch:v1.4
getmeili/meilisearch:v1.5
```

#### Passing instance options with CLI arguments
Expand All @@ -58,7 +58,7 @@ If you want to pass command-line arguments to Meilisearch with Docker, you must
docker run -it --rm \
-p 7700:7700 \
-v $(pwd)/meili_data:/meili_data \
getmeili/meilisearch:v1.4
getmeili/meilisearch:v1.5
meilisearch --master-key="MASTER_KEY"
```

Expand All @@ -76,7 +76,7 @@ To keep your data intact between reboots, specify a dedicated volume by running
docker run -it --rm \
-p 7700:7700 \
-v $(pwd)/meili_data:/meili_data \
getmeili/meilisearch:v1.4
getmeili/meilisearch:v1.5
```

The example above uses `$(pwd)/meili_data`, which is a directory in the host machine. Depending on your OS, mounting volumes from the host to the container might result in performance loss and is only recommended when developing your application.
Expand All @@ -91,7 +91,7 @@ To import a dump, use Meilisearch's `--import-dump` command-line option and spec
docker run -it --rm \
-p 7700:7700 \
-v $(pwd)/meili_data:/meili_data \
getmeili/meilisearch:v1.4
getmeili/meilisearch:v1.5
meilisearch --import-dump /meili_data/dumps/20200813-042312213.dump
```

Expand All @@ -111,7 +111,7 @@ To generate a Meilisearch snapshot with Docker, launch Meilisearch with `--sched
docker run -it --rm \
-p 7700:7700 \
-v $(pwd)/meili_data:/meili_data \
getmeili/meilisearch:v1.4
getmeili/meilisearch:v1.5
meilisearch --schedule-snapshot --snapshot-dir /meili_data/snapshots
```

Expand All @@ -123,7 +123,7 @@ To import a snapshot, launch Meilisearch with the `--import-snapshot` option:
docker run -it --rm \
-p 7700:7700 \
-v $(pwd)/meili_data:/meili_data \
getmeili/meilisearch:v1.4
getmeili/meilisearch:v1.5
meilisearch --import-snapshot /meili_data/snapshots/data.ms.snapshot
```

Expand Down
34 changes: 21 additions & 13 deletions learn/data_backup/snapshots.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,43 @@ Since databases are bound to the Meilisearch version that created them and snaps

## Creating snapshots

To create snapshots, use the [`--schedule-snapshot` configuration option](/learn/configuration/instance_options#schedule-snapshot-creation):
### Creating a single snapshot

Use [the `/snapshots` route](/reference/api/snapshots) to generate a single snapshot:

<CodeSamples id="create_snapshot_1" />

This will return a summarized task object. Use [the `/tasks` route](/reference/api/tasks) to monitor the status of this operation.

### Scheduling periodic snapshots

Use the [`--schedule-snapshot` configuration option](/learn/configuration/instance_options#schedule-snapshot-creation) to create snapshots at regular time intervals:

```bash
meilisearch --schedule-snapshot
```

By default, Meilisearch creates snapshots in a directory called `snapshots/` at the root of your Meilisearch.
The first snapshot is created on launching Meilisearch. After that, snapshots are created on a set interval until you deactivate snapshots by ending the Meilisearch instance. By default, one snapshot is taken every 24 hours.

The destination can be modified with [`--snapshot-dir`](/learn/configuration/instance_options#snapshot-destination):
Modify the interval between each new snapshot by providing an integer to [`--schedule-snapshot`](/learn/configuration/instance_options#schedule-snapshot-creation):

```bash
meilisearch --schedule-snapshot --snapshot-dir mySnapShots/
meilisearch --schedule-snapshot=3600
```

Now snapshots are created in `mySnapShots/` directory.
[Learn more about snapshots flags and environment variables.](/learn/configuration/instance_options#schedule-snapshot-creation)

### Snapshot directory

The first snapshot is created on launching Meilisearch. After that, snapshots are created routinely on a set interval until you deactivate snapshots by ending the Meilisearch instance. By default, one snapshot is taken every 24 hours.
By default, Meilisearch creates snapshots in a directory called `snapshots/` at the root of your project.

The interval between each new snapshot can be modified by providing an integer to [`--schedule-snapshot`](/learn/configuration/instance_options#schedule-snapshot-creation):
The destination can be modified with [`--snapshot-dir`](/learn/configuration/instance_options#snapshot-destination):

```bash
meilisearch --schedule-snapshot=3600
meilisearch --schedule-snapshot --snapshot-dir mySnapShots/
```

After running the above code, a snapshot is created every hour (3600 seconds).

During snapshot creation, old snapshots are **automatically overwritten**. This means only the most recent snapshot should be present in the folder at any given time.

[More about snapshots flags and environment variables](/learn/configuration/instance_options#schedule-snapshot-creation)
Old snapshots are **automatically overwritten** during snapshot creation. Only the most recent snapshot will be present in the folder at any given time.

## Starting from a snapshot

Expand Down
3 changes: 2 additions & 1 deletion learn/experimental/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ Activating or deactivating experimental features this way does not require you t

| Name | Description | How to configure |
|----------------------------------------------------------------------------------|------------------------------------------------------------|---------------------------------------------------|
| [Metrics API](/learn/experimental/metrics) | Exposes Prometheus-compatible analytics data | At launch with a CLI flag or environment variable |
| [Metrics API](/learn/experimental/metrics) | Exposes Prometheus-compatible analytics data | At launch with a CLI flag or environment variable, during runtime with the API route |
| [Ranking score details](/learn/experimental/ranking_rule_score_details) | Exposes advanced result ranking score data | During runtime with the API route |
| [Reduce indexing memory usage](/learn/experimental/reduce-indexing-memory-usage) | Optimizes indexing performance | At launch with a CLI flag or environment variable |
| [Vector search](/learn/experimental/vector_search) | Allows Meilisearch to function as a vector embedding store | During runtime with the API route |
| [Puffin reports](/learn/experimental/puffin_reports) | Export profiler data to diagnose performance issues | During runtime with the API route |
18 changes: 18 additions & 0 deletions learn/experimental/puffin_reports.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Puffin reports — Meilisearch documentation
description: Puffin is an instrumentation profiler for Rust applications. Use this experimental feature when trying to diagnose performance issues during indexing.
---

# Puffin reports

Puffin is an instrumentation profiler for Rust applications. Use this feature when trying to diagnose performance issues during indexing. Avoid enabling Puffin reports in production, as it might affect the performance and memory usage of other Meilisearch operations.

[Visit the GitHub discussion to learn how to use this feature](https://github.com/meilisearch/product/discussions/693).

Are you using this feature? Meilisearch wants to hear from you! Tell us about your experience in the [GitHub discussion](https://github.com/meilisearch/product/discussions/693). All feedback is useful and helps make Meilisearch better and easier to use.

<Capsule intent="warning">
Exporting Puffin reports is an experimental feature. Experimental features are unstable: their API might significantly change and become incompatible between releases. Meilisearch does not recommend using experimental features in a production environment.

Meilisearch makes experimental features available expecting they will become stable in a future release. However, it is not possible to guarantee when and if this will happen.
</Capsule>
4 changes: 2 additions & 2 deletions learn/getting_started/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ These commands launch the **latest stable release** of Meilisearch.

```bash
# Fetch the latest version of Meilisearch image from DockerHub
docker pull getmeili/meilisearch:v1.4
docker pull getmeili/meilisearch:v1.5

# Launch Meilisearch in development mode with a master key
docker run -it --rm \
-p 7700:7700 \
-e MEILI_ENV='development' \
-v $(pwd)/meili_data:/meili_data \
getmeili/meilisearch:v1.4
getmeili/meilisearch:v1.5
# Use ${pwd} instead of $(pwd) in PowerShell
```

Expand Down
10 changes: 2 additions & 8 deletions learn/inner_workings/tokenization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ We can break down the tokenization process like so:
1. Crawl the document(s), splitting each field by script
2. Go back over the documents part-by-part, running the corresponding tokenization pipeline, if it exists

Pipelines include many language-specific operations. Currently, we have five pipelines:
Pipelines include many language-specific operations. Currently, we have a number of pipelines, including a default pipeline for languages that use whitespace to separate words, and dedicated pipelines for Chinese, Japanese, Hebrew, Thai, and Khmer.

1. A default Meilisearch pipeline for languages that use whitespace to separate words. Uses [Unicode segmenter](https://github.com/unicode-rs/unicode-segmentation)
2. A specialized Chinese pipeline using [Jieba](https://github.com/messense/jieba-rs)
3. A specialized Japanese and Korean pipeline using [Lindera](https://github.com/lindera-morphology/lindera)
4. A specialized Hebrew pipeline based off the default Meilisearch pipeline. Uses [Niqqud](https://docs.rs/niqqud/latest/niqqud/) for normalization
5. A specialized Thai pipeline using [dictionary-based](https://github.com/PyThaiNLP/nlpo3) segmentation

For more details, check out the [tokenizer contribution guide](https://github.com/meilisearch/charabia/blob/main/CONTRIBUTING.md).
For more details, check out the [tokenizer contribution guide](https://github.com/meilisearch/charabia).
1 change: 1 addition & 0 deletions learn/what_is_meilisearch/language.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Meilisearch is multilingual, featuring optimized support for:
- Chinese
- Hebrew
- Japanese
- Khmer
- Korean
- Thai

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "documentation",
"version": "1.4.0",
"version": "1.5.0",
"description": "",
"main": "index.js",
"dependencies": {},
Expand Down
23 changes: 15 additions & 8 deletions reference/api/experimental_features.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@ The experimental API route is not compatible with all experimental features. Con

```json
{
"metrics": false,
"scoreDetails": false,
"vectorSearch": false
"vectorSearch": false,
"exportPuffinReports": false
}
```

| Name | Type | Description |
| :----------------- | :------ | :--------------------------------------------- |
| **`scoreDetails`** | Boolean | `true` if feature is active, `false` otherwise |
| **`vectorSearch`** | Boolean | `true` if feature is active, `false` otherwise |

| Name | Type | Description |
| :------------------------ | :------ | :--------------------------------------------- |
| **`metrics`** | Boolean | `true` if feature is active, `false` otherwise |
| **`scoreDetails`** | Boolean | `true` if feature is active, `false` otherwise |
| **`vectorSearch`** | Boolean | `true` if feature is active, `false` otherwise |
| **`exportPuffinReports`** | Boolean | `true` if feature is active, `false` otherwise |

## Get all experimental features

Expand All @@ -42,8 +45,10 @@ Get a list of all experimental features that can be activated via the `/experime

```json
{
"metrics": false,
"scoreDetails": false,
"vectorSearch": false
"vectorSearch": false,
"exportPuffinReports": false
}
```

Expand All @@ -67,7 +72,9 @@ Setting a field to `null` leaves its value unchanged.

```json
{
"metrics": false,
"scoreDetails": true,
"vectorSearch": false
"vectorSearch": false,
"exportPuffinReports": false
}
```
1 change: 1 addition & 0 deletions reference/api/keys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ For security reasons, we do not recommend creating keys that can perform all act
| **`settings.update`** | Provides access to the [update settings](/reference/api/settings#update-settings) and [reset settings](/reference/api/settings#reset-settings) endpoints and equivalents for all subroutes |
| **`stats.get`** | Provides access to the [get stats of an index](/reference/api/stats#get-stats-of-an-index) endpoint and the [get stats of all indexes](/reference/api/stats#get-stats-of-all-indexes) endpoint. For the latter, **non-authorized `indexes` are omitted from the response** |
| **`dumps.create`** | Provides access to the [create dump](/reference/api/dump#create-a-dump) endpoint. **Not restricted by `indexes`** |
| **`snapshots.create`** | Provides access to the [create snapshot](/reference/api/snapshots#create-a-snapshot) endpoint. **Not restricted by `indexes`** |
| **`version`** | Provides access to the [get Meilisearch version](/reference/api/version#get-version-of-meilisearch) endpoint |
| **`keys.get`** | Provides access to the [get all keys](#get-all-keys) endpoint |
| **`keys.create`** | Provides access to the [create key](#create-a-key) endpoint |
Expand Down
39 changes: 39 additions & 0 deletions reference/api/snapshots.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: Snapshots — Meilisearch API reference
description: The /snapshots route creates database snapshots. Use snapshots to backup your Meilisearch data.
---

# Snapshots

The `/snapshot` route allows you to create database snapshots. Snapshots are `.snapshot` files that can be used to make quick backups of Meilisearch data.

[Learn more about snapshots.](/learn/advanced/snapshots)

## Create a snapshot

<RouteHighlighter method="POST" route="/snapshots"/>

Triggers a snapshot creation task. Once the process is complete, Meilisearch creates a snapshot in the [snapshot directory](/learn/configuration/instance_options#snapshot-destination). If the snapshot directory does not exist yet, it will be created.

Snapshot tasks take priority over other tasks in the queue.

[Learn more about asynchronous operations](/learn/async/asynchronous_operations).

### Example

<CodeSamples id="create_snapshot_1" />

#### Response: `202 Accepted`

```json
{
"taskUid": 1,
"indexUid": null,
"status": "enqueued",
"type": "snapshotCreation",
"enqueuedAt": "2023-06-21T11:09:36.417758Z"
}
```

You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks#get-one-task)

0 comments on commit a8a4576

Please sign in to comment.