A new month means a new version of Meilisearch, and November is no different. This release introduces a feature that makes Meilisearch easier to set up and use: implicit index creation. We have also improved the design around dumps and snapshots.

As always, our number one goal for these features is simplicity of use. We want to make Meilisearch as accessible and intuitive as it can be without sacrificing speed, power, or flexibility. With that in mind, let's dive in!

Implicit index creation

Previously, adding documents to Meilisearch required you to first create an index using the create index endpoint. Only afterwards could you add documents by providing the index name.

As of this release, that first step is no longer necessary: documents can be added directly without having to previously create the index.

$ curl \
  -X POST 'http://localhost:7700/indexes/movies/documents' \
  --data '[{
      "id": 287947,
      "title": "Shazam",
      "overview": "A boy is given the ability to become an adult superhero in times of need with a single magic word.",
  }]'
The index movies will be created if it does not already exist.

In the above example, we call the add documents endpoint and provide movies as the index destination. If an index called movies already existed, the above command would simply add the documents there. However, since in this example the index movies was not previously created, it will instead create a new index titled movies and add the provided documents there.

TL;DR: If the provided index does not already exist during document addition, the index will be automatically created.

Improvements to dumps and snapshots

After experimenting with dumps and snapshots over the last month, we have decided to make some changes to the API design (and fix a few bugs while we're at it).

If you'd like to learn more about dumps and snapshots, check out this guide.

Dumps

  • The three possibles statuses for dumps have had their names changed for clarity. They are now processing, failed, and done.
  • The dump status body will now include the usual error body in case of an error.
{
    "uid": "20201008-105011897",
    "status": "failed",
    "message": "Dump process failed",
    "errorCode": "dump_process_failed",
    "errorType": "internal_error",
    "errorLink": "https://docs.meilisearch.com/errors#dump_process_failed"
}
A typical dump error.
  • We have chosen to remove the environment variable MEILI_IMPORT_DUMP. The --import-dump launch option remains unchanged.
  • The --dumps-folder option has been changed to --dumps-dir.
  • The environment variable MEILI_DUMPS_FOLDER has been changed to MEILI_DUMPS_DIR.
  • Dump files now have the extension .dump rather than .tar.gz.

Snapshots

  • The --snapshot-path launch option has been changed to --snapshot-dir.
  • The environment variable MEILI_SNAPSHOT_PATH has been changed to MEILI_SNAPSHOT_DIR.
  • Previously, the --snapshot-folder option was used to activate snapshots. Now, --snapshot-folder has a default value of /snapshots and --schedule-snapshot is the new way to activate snapshot creation.
$ meilisearch --schedule-snapshot=true
Activates creation of regular snapshots in the default /snapshots folder.
  • --load-from-snapshot has been renamed to --import-snapshot
  • Snapshot files now have the extension .snapshot rather than .tar.gz.
  • The following environment variables have been removed: MEILI_IMPORT_SNAPSHOT , MEILI_IGNORE_MISSING_SNAPSHOT, and MEILI_SNAPSHOT_IF_DB_EXISTS. Their equivalent CLI options are unchanged.

Bug fixes

Contributions

Thanks to @akrantz01 for his contribution on the urlEncode issue, and to @jcohlmeyer for taking the time to explain the issue.

Thanks to @gorogoroumaru for his contribution to fixing the display order of the displayedAttributes and fieldsDistribution keys.

We are always eager to hear more feedback from our users and contributors! Feel free to come talk with us using the method you prefer.

We are also thrilled by the supportiveness of our community, which seems to be constantly growing in both stars and users. Let's keep it up!

Thank you for using our search engine! If you like it, consider starring us on github.