Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -365,14 +365,6 @@ search_guide_1: |-
search_guide_2: |-
$ curl 'http://localhost:7700/indexes/movies/search' \
--data '{ "q": "Avengers", "filters": "release_date > 795484800" }'
getting_started_create_index_md: |-
```bash
$ curl \
-X POST 'http://127.0.0.1:7700/indexes' \
--data '{
"uid" : "movies"
}'
```
getting_started_add_documents_md: |-
```bash
$ curl \
Expand Down
2 changes: 1 addition & 1 deletion .vuepress/components/glossary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const glossary = {
'primary field':
'A special field containing the primary key and a unique document id. <br><br> Every document must possess a correctly formatted primary field in order to be indexed.',
'primary key':
'The attribute of the primary field. The primary key\'s associated value is a unique document id. An index possesses only one primary key, which is shared among all its documents. <br><br> Example: in a document with the primary field <code>"movie_id": "Abc_012"</code>, "movie_id" is the primary key.',
'An attribute that must be present in every document of a given index, used to identify and distinguish documents.<br><br> Example: In a document with the primary field <code>"id": "Abc_012"</code>, "id" is the index\'s primary key and "Abc_012" is the document\'s unique identifier.',
'document id':
'The value of the primary field. The document id acts as a unique identifier for storing documents. <br><br> Example: in a document with the primary field <code>"movie_id": "Abc_012"</code>, "Abc_012" is the document id.',
schemaless:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019-2020 Meili SAS
Copyright (c) 2019-2021 Meili SAS

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
16 changes: 14 additions & 2 deletions guides/advanced_guides/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,18 @@ Here is the list of [all the options and how to use them](/guides/advanced_guide

## Updating MeiliSearch

Updating MeiliSearch is a straightforward process, simply get and install the latest binary with your preferred method (see installation above).
Getting the latest version of MeiliSearch is a straightforward process: simply fetch and install the latest binary with your preferred method (see [installation](/guides/advanced_guides/installation.md#download-and-launch) above).

Note that all MeiliSearch versions are not compatible with each other, and you may need to re-index your documents. If you get the error `Cannot open database, expected MeiliSearch engine version: X.X.X, current engine version Y.Y.Y`, delete your database folder (defaults to `data.ms`), and re-index all your documents.
However, please note that prior to our official release (`v1.0`), all minor updates (`v0.X`) are considered breaking. Therefore, **MeiliSearch databases are not compatible across versions** for as long as we are in beta.

If you want to transfer your database from an outdated MeiliSearch instance to the most recent version, we recommend following [the below guide](/guides/advanced_guides/installation.md#migrating-a-database-to-a-later-version).

If you get the error `Cannot open database, expected MeiliSearch engine version: X.X.X, current engine version Y.Y.Y`, simply delete your database folder (defaults to `data.ms`), and re-index all your documents.

### Migrating a Database to a Later Version

Using [dumps](/guides/advanced_guides/snapshots_and_dumps.md#dumps), you can export your MeiliSearch data—all indexes, documents, and settings contained in your database—into a transferrable state. Then, you can re-import this data after updating MeiliSearch to the latest version.

Since the content is exported in a way that guarantees mobility, it needs to be re-indexed. If your database is large, this process can take a long time. Nonetheless, this process guarantees **to migrate all settings and documents between two different versions of MeiliSearch**.

If you want a complete guide on how to update MeiliSearch on DigitalOcean, please [look at this GitHub issue](https://github.com/meilisearch/MeiliSearch/discussions/1187#discussioncomment-278125).
1 change: 0 additions & 1 deletion guides/introduction/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Contents :

- 🚀 Getting Started
- [Download and launch MeiliSearch](/guides/introduction/quick_start_guide.md#download-and-launch)
- [Create your index](/guides/introduction/quick_start_guide.md#create-your-index)
- [Add documents](/guides/introduction/quick_start_guide.md#add-documents)
- [Search!](/guides/introduction/quick_start_guide.md#search)
- 👩‍🚀 [What's next?](/guides/introduction/whats_next.md)
29 changes: 16 additions & 13 deletions guides/introduction/quick_start_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,29 @@ Now that your MeiliSearch server is up and running, you should be able to commun

Communication to the server is done through a [RESTful API](/references/README.md) or one of our [SDKs](/resources/sdks.md).

## Create your Index

In MeiliSearch, the information is subdivided into indexes. Each [index](/guides/main_concepts/indexes.md) contains a data structure and associated documents.
Indexes can be comparable to SQL tables. Since MeiliSearch is <clientGlossary word="schemaless"/>, there's no need to define any attributes or data type when creating a table.
## Add Documents

In order to be able to store your documents in an index, it is required you create one first.
To add documents to MeiliSearch you must provide:

<CodeSamples id="getting_started_create_index_md" />
- [Documents](/guides/main_concepts/documents.md) in the form of `JSON objects`.
- An [index](/guides/main_concepts/indexes.md) name (_uid_). An index is where the documents are stored.

[API references](/references/indexes.md)
> _If the index does not exist, MeiliSearch creates it when you first add documents._

## Add Documents
To be processed, all documents must share one common <clientGlossary word="field" /> which will serve as [<clientGlossary word="primary key" />](/guides/main_concepts/documents.md#primary-key) for the document. Values in that field must always be **unique**.

Once the index has been created, the next step is to fill it with [documents](/guides/main_concepts/documents.md). These documents will be used and returned when search queries will be performed on MeiliSearch.

Documents are represented in `JSON format`.
```json
{
"id": "123",
"title": "Superman"
}
```

To be processed, all documents must share one common <clientGlossary word="field" /> which will serve as [primary key](/guides/main_concepts/documents.md#primary-key) for the document. Values in that field must always be **unique**.
> The primary key is `id`, the document's unique identifier is `123`.

There are [several ways to let MeiliSearch know what the primary key](/guides/main_concepts/documents.md#primary-key) is. The easiest one is to have an <clientGlossary word="attribute" /> that contains the string `id` in a case-insensitive manner.

Below is an example to showcase how to add documents using the following test dataset: [movies.json](https://github.com/meilisearch/MeiliSearch/blob/master/datasets/movies/movies.json).
Below is an example to showcase how to add documents to an index called `movies` using the following test dataset: [movies.json](https://github.com/meilisearch/MeiliSearch/blob/master/datasets/movies/movies.json).

<CodeSamples id="getting_started_add_documents_md" />

Expand All @@ -61,6 +62,8 @@ You can check the status of the operation via the `updateId` and the [get update

Checking the update status is not a mandatory step to search through your documents but could prove useful in tracing the origin of errors or unexpected behaviors.

[API references](/references/updates.md)

## Search

Now that your documents have been ingested into MeiliSearch, you are able to [search them](/guides/main_concepts/search.md).
Expand Down
4 changes: 2 additions & 2 deletions guides/main_concepts/indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ An index is created the first time documents are added to it or manually using t

#### Example

Working on a fresh MeiliSearch instance with no indexes, let's add documents using the [add or replace documents endpoint](/references/documents.md#add-or-replace-documents).
We provide `movie` as our index name. Because there's currently no index of that name in our MeiliSearch instance, using the following code will:
In a new MeiliSearch instance without any index, let's add documents using the [add or replace documents endpoint](/references/documents.md#add-or-replace-documents).
We provide `movies` as our index. Because that index was not previously created, using the following code will:

1. Create the `movie` index.
2. Add the documents to it.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"devDependencies": {
"babel-eslint": "^10.1.0",
"bent": "^7.3.12",
"eslint": "^7.17.0",
"eslint": "^7.18.0",
"eslint-config-prettier": "^7.1.0",
"eslint-config-standard": "^16.0.2",
"eslint-plugin-import": "^2.22.1",
Expand Down
4 changes: 2 additions & 2 deletions references/documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Documents are ordered by MeiliSearch depending on the hash of their id.

<RouteHighlighter method="POST" route="/indexes/:index_uid/documents"/>

Add a list of [documents](/guides/main_concepts/documents.md) or replace them if they already exist.
Add a list of [documents](/guides/main_concepts/documents.md) or replace them if they already exist. If the provided index does not exist, it will be created.

If you send an already existing document (same [id](/guides/main_concepts/documents.md#primary-key)) the **whole existing document** will be overwritten by the new document. Fields previously in the document not present in the new document are removed.

Expand Down Expand Up @@ -146,7 +146,7 @@ This `updateId` allows you to [track the current update](/references/updates.md)

<RouteHighlighter method="PUT" route="/indexes/:index_uid/documents"/>

Add a list of documents and update them if they already.
Add a list of documents or update them if they already exist. If the provided index does not exist, it will be created.

If you send an already existing document (same [id](/guides/main_concepts/documents.md#primary-key)) the old document will be only partially updated according to the fields of the new document. Thus, any fields not present in the new document are kept and remained unchanged.

Expand Down
96 changes: 47 additions & 49 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -866,10 +866,10 @@
resolved "https://registry.yarnpkg.com/@braintree/sanitize-url/-/sanitize-url-3.1.0.tgz#8ff71d51053cd5ee4981e5a501d80a536244f7fd"
integrity sha512-GcIY79elgB+azP74j8vqkiXz8xLFfIzbQJdlwOPisgbKT00tviJQuEghOXSMVxJ00HoYJbGswr4kcllUc4xCcg==

"@eslint/eslintrc@^0.2.2":
version "0.2.2"
resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.2.2.tgz#d01fc791e2fc33e88a29d6f3dc7e93d0cd784b76"
integrity sha512-EfB5OHNYp1F4px/LI/FEnGylop7nOqkQ1LRzCM0KccA2U8tvV8w01KBv37LbO7nW4H+YhKyo2LcJhRwjjV17QQ==
"@eslint/eslintrc@^0.3.0":
version "0.3.0"
resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.3.0.tgz#d736d6963d7003b6514e6324bec9c602ac340318"
integrity sha512-1JTKgrOKAHVivSvOYw+sJOunkBjUOvjqWk1DPja7ZFhIS2mX/4EgTT8M7eTK9jrKhL/FvXXEbQwIs3pg1xp3dg==
dependencies:
ajv "^6.12.4"
debug "^4.1.1"
Expand All @@ -878,7 +878,7 @@
ignore "^4.0.6"
import-fresh "^3.2.1"
js-yaml "^3.13.1"
lodash "^4.17.19"
lodash "^4.17.20"
minimatch "^3.0.4"
strip-json-comments "^3.1.1"

Expand Down Expand Up @@ -1745,10 +1745,10 @@ autocomplete.js@0.36.0:
dependencies:
immediate "^3.2.3"

autocomplete.js@0.37.1:
version "0.37.1"
resolved "https://registry.yarnpkg.com/autocomplete.js/-/autocomplete.js-0.37.1.tgz#a29a048d827e7d2bf8f7df8b831766e5cc97df01"
integrity sha512-PgSe9fHYhZEsm/9jggbjtVsGXJkPLvd+9mC7gZJ662vVL5CRWEtm/mIrrzCx0MrNxHVwxD5d00UOn6NsmL2LUQ==
autocomplete.js@0.38.0:
version "0.38.0"
resolved "https://registry.yarnpkg.com/autocomplete.js/-/autocomplete.js-0.38.0.tgz#9d49c2f4788fa23960275a6422ca78b310c01ef8"
integrity sha512-xZlqbg0LN9D1cZd4TkPJmir/Bq0+xXnp35X6i87yU2dD2wYv9E7pVU1+QKu0PbBVV2dShppwlKGMsfCYQD9OtA==
dependencies:
immediate "^3.2.3"

Expand All @@ -1775,13 +1775,6 @@ aws4@^1.8.0:
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.10.1.tgz#e1e82e4f3e999e2cfd61b161280d16a111f86428"
integrity sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==

axios@^0.19.2:
version "0.19.2"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.2.tgz#3ea36c5d8818d0d5f8a8a97a6d36b86cdc00cb27"
integrity sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==
dependencies:
follow-redirects "1.5.10"

babel-eslint@^10.1.0:
version "10.1.0"
resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232"
Expand Down Expand Up @@ -2750,6 +2743,13 @@ create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7:
safe-buffer "^5.0.1"
sha.js "^2.4.8"

cross-fetch@^3.0.5:
version "3.0.6"
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.0.6.tgz#3a4040bc8941e653e0e9cf17f29ebcd177d3365c"
integrity sha512-KBPUbqgFjzWlVcURG+Svp9TlhA5uliYtiNx/0r8nv0pdypeQCRJ9IaSIc3q/x3q8t3F75cHuwxVql1HFGHCNJQ==
dependencies:
node-fetch "2.6.1"

cross-spawn@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-3.0.1.tgz#1256037ecb9f0c5f79e3d6ef135e30770184b982"
Expand Down Expand Up @@ -3285,13 +3285,6 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.9:
dependencies:
ms "2.0.0"

debug@=3.1.0, debug@~3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==
dependencies:
ms "2.0.0"

debug@^3.1.1, debug@^3.2.5:
version "3.2.6"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
Expand All @@ -3306,6 +3299,13 @@ debug@^4.0.1, debug@^4.1.0, debug@^4.1.1:
dependencies:
ms "2.1.2"

debug@~3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==
dependencies:
ms "2.0.0"

decamelize@^1.1.2, decamelize@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
Expand Down Expand Up @@ -3492,15 +3492,15 @@ dns-txt@^2.0.2:
buffer-indexof "^1.0.0"

docs-searchbar.js@^1.1:
version "1.1.7"
resolved "https://registry.yarnpkg.com/docs-searchbar.js/-/docs-searchbar.js-1.1.7.tgz#bc2066d2d03242b05d1584e2220946539d7f2d86"
integrity sha512-DqNhqEmpWdmFGLl6SUffBsnuf05VpZHhM6LVyT4P6WkTEWg5K8lHfta2RDfbduvOm0xxGQxCfEVpd1m9JN32gw==
version "1.1.10"
resolved "https://registry.yarnpkg.com/docs-searchbar.js/-/docs-searchbar.js-1.1.10.tgz#29326f6fc2437440ce466072d38eda4cc4b07947"
integrity sha512-FZWdc11b+9spwL4vN70Wz3oUPnUJLPorS7v6dTcEamdV6IRn2EHHJ/UNrD/cfr5AO6hDrR87zMH6zPKNbmzwSg==
dependencies:
autocomplete.js "0.37.1"
autocomplete.js "0.38.0"
concurrently "^5.1.0"
eslint-plugin-eslint-comments "^3.2.0"
hogan.js "^3.0.2"
meilisearch "^0.12.0"
meilisearch "^0.17.0"
request "^2.87.0"
stack-utils "^2.0.2"
to-factory "^1.0.0"
Expand Down Expand Up @@ -3944,13 +3944,13 @@ eslint-visitor-keys@^2.0.0:
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8"
integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==

eslint@^7.17.0:
version "7.17.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.17.0.tgz#4ccda5bf12572ad3bf760e6f195886f50569adb0"
integrity sha512-zJk08MiBgwuGoxes5sSQhOtibZ75pz0J35XTRlZOk9xMffhpA9BTbQZxoXZzOl5zMbleShbGwtw+1kGferfFwQ==
eslint@^7.18.0:
version "7.18.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.18.0.tgz#7fdcd2f3715a41fe6295a16234bd69aed2c75e67"
integrity sha512-fbgTiE8BfUJZuBeq2Yi7J3RB3WGUQ9PNuNbmgi6jt9Iv8qrkxfy19Ds3OpL1Pm7zg3BtTVhvcUZbIRQ0wmSjAQ==
dependencies:
"@babel/code-frame" "^7.0.0"
"@eslint/eslintrc" "^0.2.2"
"@eslint/eslintrc" "^0.3.0"
ajv "^6.10.0"
chalk "^4.0.0"
cross-spawn "^7.0.2"
Expand All @@ -3974,7 +3974,7 @@ eslint@^7.17.0:
js-yaml "^3.13.1"
json-stable-stringify-without-jsonify "^1.0.1"
levn "^0.4.1"
lodash "^4.17.19"
lodash "^4.17.20"
minimatch "^3.0.4"
natural-compare "^1.4.0"
optionator "^0.9.1"
Expand Down Expand Up @@ -4359,13 +4359,6 @@ flush-write-stream@^1.0.0:
inherits "^2.0.3"
readable-stream "^2.3.6"

follow-redirects@1.5.10:
version "1.5.10"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a"
integrity sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==
dependencies:
debug "=3.1.0"

follow-redirects@^1.0.0:
version "1.13.0"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db"
Expand Down Expand Up @@ -6082,12 +6075,12 @@ media-typer@0.3.0:
resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=

meilisearch@^0.12.0:
version "0.12.0"
resolved "https://registry.yarnpkg.com/meilisearch/-/meilisearch-0.12.0.tgz#051b728e2df07bdaf4321a98f6aa8dd7a89803e8"
integrity sha512-5bvw+zg8yh4ZXtXgz1VDAd0A/Ng1ZCagIiQyZKfyp7nyqOYafxIAU+wNigPcUdplyAunTXj2F6z/2GXeHge5VA==
meilisearch@^0.17.0:
version "0.17.0"
resolved "https://registry.yarnpkg.com/meilisearch/-/meilisearch-0.17.0.tgz#695914c929a57166a99e14549c22ab1216a62ed1"
integrity sha512-fKBNS1VtX8xl9WCK+3Uo60uLsJO6esoPXXOt6nq9lavWURmgRn7HC4em9S8N6P1kYCyb/BFMUOYZBm3rgq1zAw==
dependencies:
axios "^0.19.2"
cross-fetch "^3.0.5"

memory-fs@^0.4.1:
version "0.4.1"
Expand Down Expand Up @@ -6414,6 +6407,11 @@ no-case@^2.2.0:
dependencies:
lower-case "^1.1.1"

node-fetch@2.6.1:
version "2.6.1"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052"
integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==

node-forge@^0.10.0:
version "0.10.0"
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.10.0.tgz#32dea2afb3e9926f02ee5ce8794902691a676bf3"
Expand Down Expand Up @@ -8503,9 +8501,9 @@ stack-utils@^1.0.1:
integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA==

stack-utils@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.2.tgz#5cf48b4557becb4638d0bc4f21d23f5d19586593"
integrity sha512-0H7QK2ECz3fyZMzQ8rH0j2ykpfbnd20BFtfg/SqVC2+sCTtcw0aDTGB7dk+de4U4uUeuz6nOtJcrkFFLG1B0Rg==
version "2.0.3"
resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.3.tgz#cd5f030126ff116b78ccb3c027fe302713b61277"
integrity sha512-gL//fkxfWUsIlFL2Tl42Cl6+HFALEaB1FU76I/Fy+oZjRreP7OPMXFlGbxM7NQsI0ZpUfw76sHnv0WNYuTb7Iw==
dependencies:
escape-string-regexp "^2.0.0"

Expand Down