Skip to content

v0.30.0 🦫

Compare
Choose a tag to compare
@curquiza curquiza released this 28 Nov 13:17
0aa3f66

This release introduces index deployment with zero downtime and adds task management features. It also brings the capability to navigate search results by page selection.

Thanks to Hacktoberfest, tons of updates and bug fixes have been done by the fantastic Meilisearch community. You were more present than ever, and words cannot do justice to just how grateful we are for your support. A big thank you from the whole Meilisearch team! ❤️

🧰 Most integrations (SDKs, clients, libraries) will be compatible with this version within four hours of the release. Sometimes this can take up to 48 hours, depending on the issues we encounter during the release.

Here is the exhaustive list of integrations not immediately compatible with v0.30.0:

  • meilisearch-dart and meilisearch-swift: though you can still use both libraries with v0.30.0, the new available features are not yet available. Let us know if you really need it—and contributions are always welcome!
  • meilisearch-java: Our team is still working on refactoring the code; this is reaching the end, but the SDK cannot be used with v0.30.0 yet. Follow the repository to know when it will be compatible.

New features and improvements 🔥

Improve search result navigation: exhaustive number of search results

When paginating search results with offset and limit, Meilisearch only returns an estimate of the total number of results. Since estimatedTotalHits can change, creating reliable pagination interfaces with numbered page selectors is challenging.

v0.30 introduces two new search parameters, page and hitsPerPage. Queries with these parameters return an exhaustive number of totalHits and totalPages, which you can then use to create UI elements such as numbered page selectors.

The following example fetches the second page of results for a given query:

curl \
  -X POST 'http://localhost:7700/indexes/movies/search' \
  -H 'Content-Type: application/json' \
  --data-binary '{ "q": "shifu", "page": "2", "hitsPerPage": "10" }'
{
    "hits": [
        // … 10 hits
    ],
    // …
    "page": 2,
    "hitsPerPage": 10,
    "totalHits": 2100,
    "totalPages": 210
}

Done in #2601 by @ManyTheFish.

Cancel processing and enqueued tasks

Meilisearch now allows you to cancel enqueued or processing tasks through a new API route, /tasks/cancel. This can be useful when you need to interrupt a task that is taking too much time to be completed or enqueued by mistake.

To cancel tasks, filter them by specifying one of the following query parameters: uids, statuses, types, or indexUids.

Tasks can be filtered by date fields:

  • beforeEnqueuedAt / afterEnqueuedAt
  • beforeStartedAt / afterStartedAt

For example, to cancel tasks by uid:

curl \
  -X POST 'http://localhost:7700/tasks/cancel?uids=1,2'
{
  "taskUid": 1,
  "indexUid": "null",
  "status": "enqueued",
  "type": "taskCancelation",
  "enqueuedAt": "2021-08-12T10:00:00.000000Z"
}

To cancel all enqueued tasks across all indexes in an instance:

curl \
  -X POST 'http://localhost:7700/tasks/cancel?statuses=enqueued'

Read more about cancelling tasks.

Done in #2763 by @irevoire, @Kerollmops and @loiclec.

Delete the task history

This release introduces a new DELETE endpoint to the /tasks route. You can use it to remove finished tasks (succeeded, failed or canceled) from Meilisearch's task history. This can be helpful in reducing the amount of occupied disk space.

To delete finished tasks, filter them by specifying one of the following query parameters: uids, statuses, types, indexUids, or canceledBy.

Tasks can be filtered by date fields:

  • beforeEnqueuedAt / afterEnqueuedAt
  • beforeStartedAt / afterStartedAt
  • beforeFinishedAt / afterFinishedAt

For example, to delete tasks by uid:

curl \
  -X DELETE 'http://localhost:7700/tasks?uids=1,2'
{
  "taskUid": 3,
  "indexUid": null,
  "status": "enqueued",
  "type": "taskDeletion",
  "enqueuedAt": "2021-08-12T10:00:00.000000Z"
}

To delete all finished tasks in an instance:

curl \
  -X DELETE 'http://localhost:7700/tasks?statuses=failed,succeeded,canceled'

Read more about deleting finished tasks.

Done in #2763 by @irevoire, @Kerollmops, and @loiclec.

Deploy indexes with zero downtime

Deploy new indexes version with zero downtime to the search clients. Meilisearch now provides a seamless way to deploy multiple indexes atomically with the new swap indexes API.

To swap indexes, use the new /swap-indexes route:

curl \
  -X POST 'http://localhost:7700/swap-indexes'\
  -H 'Content-Type: application/json' \
  --data-binary '[
      { "indexes": ["indexA", "indexB"] }
  ]'
{
  "taskUid": 3,
  "indexUid": null,
  "status": "enqueued",
  "type": "indexSwap",
  "enqueuedAt": "2021-08-12T10:00:00.000000Z"
}

Read more about swapping indexes.

Done in #2763 by @irevoire, @Kerollmops, and @loiclec.

Configuration file support

You can now use a configuration file to set instance options.

By default, Meilisearch will search the working directory for a file named ./config.toml.

You can use the --config-file-path option if you want to keep your configuration file in another directory:

meilisearch --config-file-path="./my-config.toml"

Example of configuration file:

env = "production"
master_key = "MY_MASTER_KEY"
schedule_snapshot = true

You can download a default configuration file from our repository:

curl https://raw.githubusercontent.com/meilisearch/meilisearch/main/config.toml > config.toml

Read more about customizing Meilisearch with a configuration file.

Done in #2745, #2928, #2804, #2841, and #2961 by @mlemesle, @choznerol, @arriven, @LunarMarathon and @curquiza,

Other improvements

  • The fresh new filters are also availabe for the GET /tasks: uids, canceledBy, beforeEnqueuedAt, afterEnqueuedAt, beforeStartedAt, afterStartedAt, beforeFinishedAt, afterFinishedAt.
  • Full support for compressed API requests (Gzip, Brotli, Zlib) (#2876) @mou
  • Significant indexing speed improvements (#2763, meilisearch/milli#639, meilisearch/milli#619) @loiclec
  • Change default bind address from 127.0.0.1 to localhost, making the default address available in IPv4 and IPv6 (#2861) @Fall1ngStar
  • Provide Apple Silicon binaries (#2837) @jeertmans
  • Add missing environment variables for dump and snapshot features (#2738) @gmourier
  • Increase max concurrent readers from 126 to 1024 (#2830) @arriven
  • Reduce the size of the Meilisearch binary: allow excluding specialized tokenizations when building binaries (#2773) @jirutka
  • Introduce the snapshotCreation task type: snapshot tasks are added to the task list, for more transparency (#2763) @Kerollmops
  • Reduce the size taken by Meilisearch on the disk space (#2763, meilisearch/milli#639) @loiclec
  • canceledBy and error fields are now always part of the task object (#2763) @irevoire, @Kerollmops, and @loiclec

Behavior changes ⚠️

  • Rename receivedDocumentIds into providedIds in the task object when performing a delete-batch action (#2826) @Ugzuzg
  • Return a new error when using /keys without any master key set: missing_master_key instead of invalid_api_key (#2922) @vishalsodani
  • Some names of filter parameters for /tasks and some error codes have been renamed (#3023) @Kerollmops @loiclec
    • indexUid query parameter is renamed indexUids
    • type query parameter is renamed types
    • status query parameter is renamed statuses
    • invalid_task_type error is renamed invalid_task_types_filter
    • invalid_task_status error is renamed invalid_task_statuses_filter

Fixes 🐞

Misc

❤️ Thanks again to our external contributors: