diff --git a/.code-samples.meilisearch.yaml b/.code-samples.meilisearch.yaml
index 047cb60b9f..975db0ed95 100644
--- a/.code-samples.meilisearch.yaml
+++ b/.code-samples.meilisearch.yaml
@@ -8,7 +8,7 @@ get_one_index_1: |-
-X GET 'http://localhost:7700/indexes/movies'
list_all_indexes_1: |-
curl \
- -X GET 'http://localhost:7700/indexes'
+ -X GET 'http://localhost:7700/indexes?limit=3'
create_an_index_1: |-
curl \
-X POST 'http://localhost:7700/indexes' \
@@ -19,7 +19,7 @@ create_an_index_1: |-
}'
update_an_index_1: |-
curl \
- -X PUT 'http://localhost:7700/indexes/movies' \
+ -X PATCH 'http://localhost:7700/indexes/movies' \
-H 'Content-Type: application/json' \
--data-binary '{ "primaryKey": "id" }'
delete_an_index_1: |-
@@ -27,7 +27,7 @@ delete_an_index_1: |-
-X DELETE 'http://localhost:7700/indexes/movies'
get_one_document_1: |-
curl \
- -X GET 'http://localhost:7700/indexes/movies/documents/25684'
+ -X GET 'http://localhost:7700/indexes/movies/documents/25684?fields=id,title,poster,release_date'
get_documents_1: |-
curl \
-X GET 'http://localhost:7700/indexes/movies/documents?limit=2'
@@ -79,25 +79,31 @@ search_post_1: |-
search_get_1: |-
curl \
-X GET 'http://localhost:7700/indexes/movies/search?q=american%20ninja'
-get_task_by_index_1: |-
- curl \
- -X GET 'http://localhost:7700/indexes/movies/tasks/1'
get_all_tasks_1: |-
curl \
-X GET 'http://localhost:7700/tasks'
get_task_1: |-
curl \
-X GET 'http://localhost:7700/tasks/1'
-get_all_tasks_by_index_1: |-
+get_all_tasks_filtering_1: |-
+ curl \
+ -X GET 'http://localhost:7700/tasks?indexUid=movies'
+get_all_tasks_filtering_2: |-
+ curl \
+ -X GET 'http://localhost:7700/tasks?status=succeeded,failed&type=documentAdditionOrUpdate'
+get_all_tasks_paginating_1: |-
+ curl \
+ -X GET 'http://localhost:7700/tasks?limit=2&from=10
+get_all_tasks_paginating_2: |-
curl \
- -X GET 'http://localhost:7700/indexes/movies/tasks'
+ -X GET 'http://localhost:7700/tasks?limit=2&from=8
get_one_key_1: |-
curl \
- -X GET 'http://localhost:7700/keys/d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4' \
+ -X GET 'http://localhost:7700/keys/6062abda-a5aa-4414-ac91-ecd7944c0f8d' \
-H 'Authorization: Bearer MASTER_KEY'
get_all_keys_1: |-
curl \
- -X GET 'http://localhost:7700/keys' \
+ -X GET 'http://localhost:7700/keys?limit=3' \
-H 'Authorization: Bearer MASTER_KEY'
create_a_key_1: |-
curl \
@@ -112,31 +118,23 @@ create_a_key_1: |-
}'
update_a_key_1: |-
curl \
- -X PATCH 'http://localhost:7700/keys/d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4' \
+ -X PATCH 'http://localhost:7700/keys/6062abda-a5aa-4414-ac91-ecd7944c0f8d' \
-H 'Authorization: Bearer MASTER_KEY' \
-H 'Content-Type: application/json' \
--data-binary '{
- "description": "Manage documents: Products/Reviews API key",
- "actions": [
- "documents.add",
- "documents.delete"
- ],
- "indexes": [
- "products",
- "reviews"
- ],
- "expiresAt": "2042-04-02T00:42:42Z"
+ "name": "Products/Reviews API key",
+ "description": "Manage documents: Products/Reviews API key"
}'
delete_a_key_1: |-
curl \
- -X DELETE 'http://localhost:7700/keys/d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4' \
+ -X DELETE 'http://localhost:7700/keys/6062abda-a5aa-4414-ac91-ecd7944c0f8d' \
-H 'Authorization: Bearer MASTER_KEY'
get_settings_1: |-
curl \
-X GET 'http://localhost:7700/indexes/movies/settings'
update_settings_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings' \
+ -X PATCH 'http://localhost:7700/indexes/movies/settings' \
-H 'Content-Type: application/json' \
--data-binary '{
"rankingRules": [
@@ -183,6 +181,12 @@ update_settings_1: |-
"twoTypos": 10
},
"disableOnAttributes": ["title"]
+ },
+ "pagination": {
+ "maxTotalHits": 5000
+
+ "faceting": {
+ "maxValuesPerFacet": 200
}
}'
reset_settings_1: |-
@@ -193,7 +197,7 @@ get_synonyms_1: |-
-X GET 'http://localhost:7700/indexes/movies/settings/synonyms'
update_synonyms_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings/synonyms' \
+ -X PUT 'http://localhost:7700/indexes/movies/settings/synonyms' \
-H 'Content-Type: application/json' \
--data-binary '{
"wolverine": [
@@ -214,7 +218,7 @@ get_stop_words_1: |-
-X GET 'http://localhost:7700/indexes/movies/settings/stop-words'
update_stop_words_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings/stop-words' \
+ -X PUT 'http://localhost:7700/indexes/movies/settings/stop-words' \
-H 'Content-Type: application/json' \
--data-binary '[
"the",
@@ -229,7 +233,7 @@ get_ranking_rules_1: |-
-X GET 'http://localhost:7700/indexes/movies/settings/ranking-rules'
update_ranking_rules_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings/ranking-rules' \
+ -X PUT 'http://localhost:7700/indexes/movies/settings/ranking-rules' \
-H 'Content-Type: application/json' \
--data-binary '[
"words",
@@ -249,7 +253,7 @@ get_distinct_attribute_1: |-
-X GET 'http://localhost:7700/indexes/shoes/settings/distinct-attribute'
update_distinct_attribute_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/shoes/settings/distinct-attribute' \
+ -X PUT 'http://localhost:7700/indexes/shoes/settings/distinct-attribute' \
-H 'Content-Type: application/json' \
--data-binary '"skuid"'
reset_distinct_attribute_1: |-
@@ -260,7 +264,7 @@ get_filterable_attributes_1: |-
-X GET 'http://localhost:7700/indexes/movies/settings/filterable-attributes'
update_filterable_attributes_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings/filterable-attributes' \
+ -X PUT 'http://localhost:7700/indexes/movies/settings/filterable-attributes' \
-H 'Content-Type: application/json' \
--data-binary '[
"genres",
@@ -274,7 +278,7 @@ get_searchable_attributes_1: |-
-X GET 'http://localhost:7700/indexes/movies/settings/searchable-attributes'
update_searchable_attributes_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings/searchable-attributes' \
+ -X PUT 'http://localhost:7700/indexes/movies/settings/searchable-attributes' \
-H 'Content-Type: application/json' \
--data-binary '[
"title",
@@ -289,7 +293,7 @@ get_displayed_attributes_1: |-
-X GET 'http://localhost:7700/indexes/movies/settings/displayed-attributes'
update_displayed_attributes_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings/displayed-attributes' \
+ -X PUT 'http://localhost:7700/indexes/movies/settings/displayed-attributes' \
-H 'Content-Type: application/json' \
--data-binary '[
"title",
@@ -314,12 +318,12 @@ get_version_1: |-
-X GET 'http://localhost:7700/version'
distinct_attribute_guide_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/jackets/settings' \
+ -X PUT 'http://localhost:7700/indexes/jackets/settings' \
-H 'Content-Type: application/json' \
--data-binary '{ "distinctAttribute": "product_id" }'
field_properties_guide_searchable_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings' \
+ -X PUT 'http://localhost:7700/indexes/movies/settings' \
-H 'Content-Type: application/json' \
--data-binary '{
"searchableAttributes": [
@@ -330,7 +334,7 @@ field_properties_guide_searchable_1: |-
}'
field_properties_guide_displayed_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings' \
+ -X PUT 'http://localhost:7700/indexes/movies/settings' \
-H 'Content-Type: application/json' \
--data-binary '{
"displayedAttributes": [
@@ -432,17 +436,17 @@ search_parameter_guide_highlight_tag_1: |-
"highlightPreTag": "",
"highlightPostTag": ""
}'
-search_parameter_guide_matches_1: |-
+search_parameter_guide_show_matches_position_1: |-
curl \
-X POST 'http://localhost:7700/indexes/movies/search' \
-H 'Content-Type: application/json' \
--data-binary '{
"q": "winter feast",
- "matches": true
+ "showMatchesPosition": true
}'
settings_guide_synonyms_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/tops/settings' \
+ -X PUT 'http://localhost:7700/indexes/tops/settings' \
-H 'Content-Type: application/json' \
--data-binary '{
"synonyms": {
@@ -452,7 +456,7 @@ settings_guide_synonyms_1: |-
}'
settings_guide_stop_words_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings' \
+ -X PUT 'http://localhost:7700/indexes/movies/settings' \
-H 'Content-Type: application/json' \
--data-binary '{
"stopWords": [
@@ -463,7 +467,7 @@ settings_guide_stop_words_1: |-
}'
settings_guide_ranking_rules_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings' \
+ -X PUT 'http://localhost:7700/indexes/movies/settings' \
-H 'Content-Type: application/json' \
--data-binary '{
"rankingRules": [
@@ -479,12 +483,12 @@ settings_guide_ranking_rules_1: |-
}'
settings_guide_distinct_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/jackets/settings' \
+ -X PUT 'http://localhost:7700/indexes/jackets/settings' \
-H 'Content-Type: application/json' \
--data-binary '{ "distinctAttribute": "product_id" }
settings_guide_searchable_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings' \
+ -X PUT 'http://localhost:7700/indexes/movies/settings' \
-H 'Content-Type: application/json' \
--data-binary '{
"searchableAttributes": [
@@ -495,7 +499,7 @@ settings_guide_searchable_1: |-
}'
settings_guide_displayed_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings' \
+ -X PUT 'http://localhost:7700/indexes/movies/settings' \
-H 'Content-Type: application/json' \
--data-binary '{
"displayedAttributes": [
@@ -507,7 +511,7 @@ settings_guide_displayed_1: |-
}'
settings_guide_sortable_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/books/settings' \
+ -X PUT 'http://localhost:7700/indexes/books/settings' \
-H 'Content-Type: application/json' \
--data-binary '{
"sortableAttributes": [
@@ -529,7 +533,7 @@ getting_started_add_documents_md: |-
```
getting_started_check_task_status: |-
curl \
- -X GET 'http://localhost:7700/indexes/movies/tasks/0'
+ -X GET 'http://localhost:7700/tasks/0'
getting_started_search_md: |-
```bash
curl \
@@ -544,7 +548,7 @@ getting_started_add_meteorites: |-
--data-binary @meteorites.json
getting_started_update_ranking_rules: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings/ranking-rules' \
+ -X PUT 'http://localhost:7700/indexes/movies/settings/ranking-rules' \
-H 'Content-Type: application/json' \
--data-binary '[
"exactness",
@@ -558,7 +562,7 @@ getting_started_update_ranking_rules: |-
]'
getting_started_update_displayed_attributes: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings/displayed-attributes' \
+ -X PUT 'http://localhost:7700/indexes/movies/settings/displayed-attributes' \
-H 'Content-Type: application/json' \
--data-binary '[
"title",
@@ -567,17 +571,17 @@ getting_started_update_displayed_attributes: |-
]'
getting_started_update_searchable_attributes: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings/searchable-attributes' \
+ -X PUT 'http://localhost:7700/indexes/movies/settings/searchable-attributes' \
-H 'Content-Type: application/json' \
--data-binary '["title"]'
getting_started_update_stop_words: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings/stop-words' \
+ -X PUT 'http://localhost:7700/indexes/movies/settings/stop-words' \
-H 'Content-Type: application/json' \
--data-binary '["the"]'
getting_started_synonyms: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings/synonyms' \
+ -X PUT 'http://localhost:7700/indexes/movies/settings/synonyms' \
-H 'Content-Type: application/json' \
--data-binary '{
"winnie": ["piglet"],
@@ -608,7 +612,7 @@ getting_started_sorting: |-
}'
getting_started_configure_settings: |-
curl \
- -X POST 'http://localhost:7700/indexes/meteorites/settings' \
+ -X PUT 'http://localhost:7700/indexes/meteorites/settings' \
-H 'Content-Type: application/json' \
--data-binary '{
"filterableAttributes": [
@@ -626,7 +630,7 @@ getting_started_communicating_with_a_protected_instance: |-
-H 'Authorization: Bearer API_KEY'
faceted_search_update_settings_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings' \
+ -X PUT 'http://localhost:7700/indexes/movies/settings' \
-H 'Content-Type: application/json' \
--data-binary '{
"filterableAttributes": [
@@ -648,13 +652,13 @@ faceted_search_filter_1: |-
"director = \"Jordan Peele\""
]
}'
-faceted_search_facets_distribution_1: |-
+faceted_search_facets_1: |-
curl \
-X POST 'http://localhost:7700/indexes/movies/search' \
-H 'Content-Type: application/json' \
--data-binary '{
"q": "Batman",
- "facetsDistribution": ["genres"]
+ "facets": ["genres"]
}'
faceted_search_walkthrough_filter_1: |-
curl \
@@ -672,9 +676,6 @@ faceted_search_walkthrough_filter_1: |-
post_dump_1: |-
curl \
-X POST 'http://localhost:7700/dumps'
-get_dump_status_1: |-
- curl \
- -X GET 'http://localhost:7700/dumps/20201101-110357260/status'
phrase_search_1: |-
curl \
-X POST 'http://localhost:7700/indexes/movies/search' \
@@ -686,7 +687,7 @@ authorization_header_1: |-
-H 'Authorization: Bearer MASTER_KEY'
sorting_guide_update_sortable_attributes_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/books/settings/sortable-attributes' \
+ -X PUT 'http://localhost:7700/indexes/books/settings/sortable-attributes' \
-H 'Content-Type: application/json' \
--data-binary '[
"author",
@@ -694,7 +695,7 @@ sorting_guide_update_sortable_attributes_1: |-
]'
sorting_guide_update_ranking_rules_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/books/settings/ranking-rules' \
+ -X PUT 'http://localhost:7700/indexes/books/settings/ranking-rules' \
-H 'Content-Type: application/json' \
--data-binary '[
"words",
@@ -725,7 +726,7 @@ get_sortable_attributes_1: |-
-X GET 'http://localhost:7700/indexes/books/settings/sortable-attributes'
update_sortable_attributes_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/books/settings/sortable-attributes' \
+ -X PUT 'http://localhost:7700/indexes/books/settings/sortable-attributes' \
-H 'Content-Type: application/json' \
--data-binary '[
"price",
@@ -744,7 +745,7 @@ search_parameter_guide_sort_1: |-
}'
geosearch_guide_filter_settings_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/restaurants/settings/filterable-attributes' \
+ -X PUT 'http://localhost:7700/indexes/restaurants/settings/filterable-attributes' \
-H 'Content-type:application/json' \
--data-binary '["_geo"]'
geosearch_guide_filter_usage_1: |-
@@ -759,7 +760,7 @@ geosearch_guide_filter_usage_2: |-
--data-binary '{ "filter": "_geoRadius(45.472735, 9.184019, 2000) AND type = pizza" }'
geosearch_guide_sort_settings_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/restaurants/settings/sortable-attributes' \
+ -X PUT 'http://localhost:7700/indexes/restaurants/settings/sortable-attributes' \
-H 'Content-type:application/json' \
--data-binary '["_geo"]'
geosearch_guide_sort_usage_1: |-
@@ -783,10 +784,10 @@ security_guide_search_key_1: |-
-H 'Authorization: Bearer API_KEY'
security_guide_update_key_1: |-
curl \
- -X PATCH 'http://localhost:7700/keys/d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4' \
+ -X PATCH 'http://localhost:7700/keys/74c9c733-3368-4738-bbe5-1d18a5fecb37 \
-H 'Authorization: Bearer MASTER_KEY' \
-H 'Content-Type: application/json' \
- --data-binary '{ "indexes": ["doctors"] }'
+ --data-binary '{ "description": "Default Search API Key" }'
security_guide_create_key_1: |-
curl \
-X POST 'http://localhost:7700/keys' \
@@ -804,7 +805,7 @@ security_guide_list_keys_1: |-
-H 'Authorization: Bearer MASTER_KEY'
security_guide_delete_key_1: |-
curl \
- -X DELETE 'http://localhost:7700/keys/d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4' \
+ -X DELETE 'http://localhost:7700/keys/ac5cd97d-5a4b-4226-a868-2d0eb6d197ab' \
-H 'Authorization: Bearer MASTER_KEY'
primary_field_guide_create_index_primary_key: |-
curl \
@@ -832,7 +833,7 @@ primary_field_guide_add_document_primary_key: |-
]'
primary_field_guide_update_document_primary_key: |-
curl \
- -X PUT 'http://localhost:7700/indexes/books' \
+ -X PATCH 'http://localhost:7700/indexes/books' \
-H 'Content-Type: application/json' \
--data-binary '{ "primaryKey": "title" }'
tenant_token_guide_search_no_sdk_1: |-
@@ -844,7 +845,7 @@ get_typo_tolerance_1: |-
-X GET 'http://localhost:7700/indexes/books/settings/typo-tolerance'
update_typo_tolerance_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/books/settings/typo-tolerance' \
+ -X PATCH 'http://localhost:7700/indexes/books/settings/typo-tolerance' \
-H 'Content-Type: application/json' \
--data-binary '{
"minWordSizeForTypos": {
@@ -858,17 +859,17 @@ reset_typo_tolerance_1: |-
-X DELETE 'http://localhost:7700/indexes/books/settings/typo-tolerance'
typo_tolerance_guide_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings/typo-tolerance' \
+ -X PATCH 'http://localhost:7700/indexes/movies/settings/typo-tolerance' \
-H 'Content-Type: application/json' \
--data-binary '{ "enabled": false }'
typo_tolerance_guide_2: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings/typo-tolerance' \
+ -X PATCH 'http://localhost:7700/indexes/movies/settings/typo-tolerance' \
-H 'Content-Type: application/json' \
--data-binary '{ "disableOnAttributes": ["title"] }'
typo_tolerance_guide_3: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings/typo-tolerance' \
+ -X PATCH 'http://localhost:7700/indexes/movies/settings/typo-tolerance' \
-H 'Content-Type: application/json' \
--data-binary '{
"disableOnWords": [
@@ -877,7 +878,7 @@ typo_tolerance_guide_3: |-
}'
typo_tolerance_guide_4: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings/typo-tolerance' \
+ -X PATCH 'http://localhost:7700/indexes/movies/settings/typo-tolerance' \
-H 'Content-Type: application/json' \
--data-binary '{
"minWordSizeForTypos": {
@@ -887,7 +888,7 @@ typo_tolerance_guide_4: |-
}'
settings_guide_typo_tolerance_1: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings/typo-tolerance' \
+ -X PATCH 'http://localhost:7700/indexes/movies/settings/typo-tolerance' \
-H 'Content-Type: application/json' \
--data-binary '{
"minWordSizeForTypos": {
@@ -924,11 +925,6 @@ updating_guide_create_dump: |-
curl \
-X POST 'http://localhost:7700/dumps' \
-H 'Authorization: Bearer API_KEY'
-updating_guide_get_dump_status: |-
- # replace {dump_uid} with the uid returned by the previous command
- curl \
- -X GET 'http://localhost:7700/dumps/{dump_uid}/status' \
- -H 'Authorization: Bearer API_KEY'
updating_guide_get_settings_old: |-
# the -o option saves the output as a local file
curl \
@@ -953,8 +949,48 @@ updating_guide_add_documents_old: |-
-H 'X-Meili-API-Key: API_KEY'
getting_started_typo_tolerance: |-
curl \
- -X POST 'http://localhost:7700/indexes/movies/settings/typo-tolerance' \
+ -X PATCH 'http://localhost:7700/indexes/movies/settings/typo-tolerance' \
-H 'Content-Type: application/json' \
--data-binary '{
"minWordSizeForTypos": { "oneTypo": 4 }
}'
+settings_guide_pagination_1: |-
+ curl \
+ -X PATCH 'http://localhost:7700/indexes/movies/settings/pagination' \
+ -H 'Content-Type: application/json' \
+ --data-binary '{
+ "maxTotalHits": 50
+ }'
+get_pagination_settings_1: |-
+ curl \
+ -X GET 'http://localhost:7700/indexes/books/settings/pagination'
+update_pagination_settings_1: |-
+ curl \
+ -X PATCH 'http://localhost:7700/indexes/books/settings/pagination' \
+ -H 'Content-Type: application/json' \
+ --data-binary '{
+ "maxTotalHits": 100
+ }'
+reset_pagination_settings_1: |-
+ curl \
+ -X DELETE 'http://localhost:7700/indexes/books/settings/pagination'
+get_faceting_settings_1: |-
+ curl \
+ -X GET 'http://localhost:7700/indexes/books/settings/faceting'
+update_faceting_settings_1: |-
+ curl \
+ -X PATCH 'http://localhost:7700/indexes/books/settings/faceting' \
+ -H 'Content-Type: application/json' \
+ --data-binary '{
+ "maxValuesPerFacet": 2
+ }'
+reset_faceting_settings_1: |-
+ curl \
+ -X DELETE 'http://localhost:7700/indexes/books/settings/faceting'
+settings_guide_faceting_1: |-
+ curl \
+ -X PATCH 'http://localhost:7700/indexes/movies/settings/faceting' \
+ -H 'Content-Type: application/json' \
+ --data-binary '{
+ "maxValuesPerFacet": 5
+ }'
diff --git a/.vuepress/config.js b/.vuepress/config.js
index a9992b9b14..471dec2e97 100644
--- a/.vuepress/config.js
+++ b/.vuepress/config.js
@@ -1,6 +1,6 @@
const ogprefix = 'og: http://ogp.me/ns#'
module.exports = {
- title: 'Meilisearch Documentation v0.27',
+ title: 'Meilisearch Documentation v0.28',
description: 'Open source Instant Search Engine',
theme: 'default-prefers-color-scheme',
themeConfig: {
@@ -174,6 +174,7 @@ module.exports = {
'/learn/advanced/asynchronous_operations',
'/learn/advanced/filtering_and_faceted_search',
'/learn/advanced/geosearch',
+ '/learn/advanced/pagination',
'/learn/advanced/sorting',
{
title: 'Updating Meilisearch',
@@ -323,7 +324,9 @@ module.exports = {
},
'/reference/api/displayed_attributes',
'/reference/api/distinct_attribute',
+ '/reference/api/faceting',
'/reference/api/filterable_attributes',
+ '/reference/api/pagination',
'/reference/api/ranking_rules',
'/reference/api/searchable_attributes',
'/reference/api/sortable_attributes',
diff --git a/.vuepress/public/postman/meilisearch-collection.json b/.vuepress/public/postman/meilisearch-collection.json
index 5af874b190..176f47bcaf 100644
--- a/.vuepress/public/postman/meilisearch-collection.json
+++ b/.vuepress/public/postman/meilisearch-collection.json
@@ -1,8 +1,9 @@
{
"info": {
- "_postman_id": "157465d2-dee4-4327-b787-6187d51fbe12",
- "name": "Meilisearch v0.27",
- "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
+ "_postman_id": "453f3754-4b37-4654-8fe3-b2b3aef24048",
+ "name": "Meilisearch v0.28",
+ "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
+ "_exporter_id": "8898306"
},
"item": [
{
@@ -23,6 +24,13 @@
"{{indexUID}}",
"documents",
"2"
+ ],
+ "query": [
+ {
+ "key": "fields",
+ "value": "id",
+ "disabled": true
+ }
]
}
},
@@ -55,8 +63,8 @@
"disabled": true
},
{
- "key": "attributesToRetrieve",
- "value": "*",
+ "key": "fields",
+ "value": "id",
"disabled": true
}
]
@@ -278,12 +286,12 @@
"disabled": true
},
{
- "key": "matches",
+ "key": "showMatchesPosition",
"value": "true",
"disabled": true
},
{
- "key": "facetsDistribution",
+ "key": "facets",
"value": "genre",
"disabled": true
},
@@ -358,6 +366,33 @@
],
"path": [
"tasks"
+ ],
+ "query": [
+ {
+ "key": "type",
+ "value": "documentAdditionOrUpdate",
+ "disabled": true
+ },
+ {
+ "key": "status",
+ "value": "failed",
+ "disabled": true
+ },
+ {
+ "key": "indexUid",
+ "value": "books",
+ "disabled": true
+ },
+ {
+ "key": "limit",
+ "value": "2",
+ "disabled": true
+ },
+ {
+ "key": "from",
+ "value": "10",
+ "disabled": true
+ }
]
}
},
@@ -380,45 +415,6 @@
}
},
"response": []
- },
- {
- "name": "Get all tasks of an index",
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "{{url}}/indexes/{{indexUID}}/tasks",
- "host": [
- "{{url}}"
- ],
- "path": [
- "indexes",
- "{{indexUID}}",
- "tasks"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Get one task of an index",
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "{{url}}/indexes/{{indexUID}}/tasks/0",
- "host": [
- "{{url}}"
- ],
- "path": [
- "indexes",
- "{{indexUID}}",
- "tasks",
- "0"
- ]
- }
- },
- "response": []
}
]
},
@@ -426,7 +422,7 @@
"name": "Indexes",
"item": [
{
- "name": "List all indexes",
+ "name": "Get indexes",
"request": {
"method": "GET",
"header": [],
@@ -437,6 +433,18 @@
],
"path": [
"indexes"
+ ],
+ "query": [
+ {
+ "key": "offset",
+ "value": "0",
+ "disabled": true
+ },
+ {
+ "key": "limit",
+ "value": "2",
+ "disabled": true
+ }
]
}
},
@@ -532,7 +540,7 @@
}
},
"request": {
- "method": "PUT",
+ "method": "PATCH",
"header": [
{
"key": "Content-Type",
@@ -612,7 +620,7 @@
}
},
"request": {
- "method": "POST",
+ "method": "PUT",
"header": [
{
"key": "Content-Type",
@@ -687,7 +695,7 @@
}
},
"request": {
- "method": "POST",
+ "method": "PUT",
"header": [
{
"key": "Content-Type",
@@ -762,7 +770,7 @@
}
},
"request": {
- "method": "POST",
+ "method": "PUT",
"header": [
{
"key": "Content-Type",
@@ -837,7 +845,7 @@
}
},
"request": {
- "method": "POST",
+ "method": "PUT",
"header": [
{
"key": "Content-Type",
@@ -907,7 +915,7 @@
{
"name": "Update synonyms",
"request": {
- "method": "POST",
+ "method": "PUT",
"header": [
{
"key": "Content-Type",
@@ -1005,7 +1013,7 @@
}
},
"request": {
- "method": "POST",
+ "method": "PUT",
"header": [
{
"key": "Content-Type",
@@ -1086,7 +1094,7 @@
}
},
"request": {
- "method": "POST",
+ "method": "PUT",
"header": [
{
"key": "Content-Type",
@@ -1161,7 +1169,7 @@
}
},
"request": {
- "method": "POST",
+ "method": "PUT",
"header": [
{
"key": "Content-Type",
@@ -1236,7 +1244,7 @@
}
},
"request": {
- "method": "POST",
+ "method": "PATCH",
"header": [
{
"key": "Content-Type",
@@ -1246,7 +1254,7 @@
],
"body": {
"mode": "raw",
- "raw": "{\n \"minWordSizeForTypos\": {\n \"oneTypo\": 2,\n \"twoTypos\": 11\n },\n \"disableOnWords\": [\"Prince\"],\n \"disableOnAttributes\": [\"genre\"]\n\n}"
+ "raw": "{\n \"minWordSizeForTypos\": {\n \"oneTypo\": 2,\n \"twoTypos\": 11\n },\n \"disableOnWords\": [\"Prince\"],\n \"disableOnAttributes\": [\"genre\"]\n}"
},
"url": {
"raw": "{{url}}/indexes/{{indexUID}}/settings/typo-tolerance",
@@ -1282,6 +1290,156 @@
}
},
"response": []
+ },
+ {
+ "name": "Get pagination",
+ "request": {
+ "method": "GET",
+ "header": [],
+ "url": {
+ "raw": "{{url}}/indexes/{{indexUID}}/settings/pagination",
+ "host": [
+ "{{url}}"
+ ],
+ "path": [
+ "indexes",
+ "{{indexUID}}",
+ "settings",
+ "pagination"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Update pagination",
+ "protocolProfileBehavior": {
+ "disabledSystemHeaders": {
+ "content-type": true
+ }
+ },
+ "request": {
+ "method": "PATCH",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "type": "text"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"maxTotalHits\": 2000\n}"
+ },
+ "url": {
+ "raw": "{{url}}/indexes/{{indexUID}}/settings/pagination",
+ "host": [
+ "{{url}}"
+ ],
+ "path": [
+ "indexes",
+ "{{indexUID}}",
+ "settings",
+ "pagination"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Reset pagination",
+ "request": {
+ "method": "DELETE",
+ "header": [],
+ "url": {
+ "raw": "{{url}}/indexes/{{indexUID}}/settings/pagination",
+ "host": [
+ "{{url}}"
+ ],
+ "path": [
+ "indexes",
+ "{{indexUID}}",
+ "settings",
+ "pagination"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Get faceting",
+ "request": {
+ "method": "GET",
+ "header": [],
+ "url": {
+ "raw": "{{url}}/indexes/{{indexUID}}/settings/faceting",
+ "host": [
+ "{{url}}"
+ ],
+ "path": [
+ "indexes",
+ "{{indexUID}}",
+ "settings",
+ "faceting"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Update faceting",
+ "protocolProfileBehavior": {
+ "disabledSystemHeaders": {
+ "content-type": true
+ }
+ },
+ "request": {
+ "method": "PATCH",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "type": "text"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"maxValuesPerFacet\": 3000\n}"
+ },
+ "url": {
+ "raw": "{{url}}/indexes/{{indexUID}}/settings/faceting",
+ "host": [
+ "{{url}}"
+ ],
+ "path": [
+ "indexes",
+ "{{indexUID}}",
+ "settings",
+ "faceting"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Reset faceting",
+ "request": {
+ "method": "DELETE",
+ "header": [],
+ "url": {
+ "raw": "{{url}}/indexes/{{indexUID}}/settings/faceting",
+ "host": [
+ "{{url}}"
+ ],
+ "path": [
+ "indexes",
+ "{{indexUID}}",
+ "settings",
+ "faceting"
+ ]
+ }
+ },
+ "response": []
}
]
},
@@ -1312,7 +1470,7 @@
}
},
"request": {
- "method": "POST",
+ "method": "PATCH",
"header": [
{
"key": "Content-Type",
@@ -1380,6 +1538,18 @@
],
"path": [
"keys"
+ ],
+ "query": [
+ {
+ "key": "offset",
+ "value": "0",
+ "disabled": true
+ },
+ {
+ "key": "limit",
+ "value": "10",
+ "disabled": true
+ }
]
}
},
@@ -1416,7 +1586,7 @@
],
"body": {
"mode": "raw",
- "raw": "{\n \"description\": \"Key to add and delete documents, in `books` index.\",\n \"actions\": [\n \"documents.add\",\n \"documents.delete\" \n ],\n \"indexes\": [\n \"books\"\n ],\n \"expiresAt\": null\n}"
+ "raw": "{\n \"name\": \"docs-key\",\n \"description\": \"Key to add and delete documents, in `books` index.\",\n \"actions\": [\n \"documents.add\",\n \"documents.delete\" \n ],\n \"indexes\": [\n \"books\"\n ],\n \"expiresAt\": null\n}"
},
"url": {
"raw": "{{url}}/keys",
@@ -1443,7 +1613,7 @@
],
"body": {
"mode": "raw",
- "raw": "{\n \"description\": \"Key to add and delete documents, but also to create indexes, in `book` index.\",\n \"actions\": [\n \"documents.add\",\n \"documents.delete\",\n \"indexes.create\"\n ]\n}"
+ "raw": "{\n \"description\": \"Key to add and delete documents, but also to create indexes, in `book` index.\"\n}"
},
"url": {
"raw": "{{url}}/keys/wYZjGJyBcdb0621b97999c233246a8ec0a35d0fcd9a6417ef8ccee0c8978b64b123af2dd",
@@ -1562,25 +1732,6 @@
{
"name": "Dumps",
"item": [
- {
- "name": "Get a dump status",
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "{{url}}/dumps/20201001-110357260/status",
- "host": [
- "{{url}}"
- ],
- "path": [
- "dumps",
- "20201001-110357260",
- "status"
- ]
- }
- },
- "response": []
- },
{
"name": "Create a dump",
"protocolProfileBehavior": {
@@ -1661,7 +1812,7 @@
},
{
"key": "indexUID",
- "value": "indexUID"
+ "value": "books"
}
]
}
\ No newline at end of file
diff --git a/.vuepress/public/sample-template.yaml b/.vuepress/public/sample-template.yaml
index 8b52eec657..480fc4328b 100644
--- a/.vuepress/public/sample-template.yaml
+++ b/.vuepress/public/sample-template.yaml
@@ -16,10 +16,12 @@ delete_all_documents_1: |-
delete_one_document_1: |-
delete_documents_1: |-
search_post_1: |-
-get_task_by_index_1: |-
get_all_tasks_1: |-
get_task_1: |-
-get_all_tasks_by_index_1: |-
+get_all_tasks_filtering_1: |-
+get_all_tasks_filtering_2: |-
+get_all_tasks_paginating_1: |-
+get_all_tasks_paginating_2: |-
get_one_key_1: |-
get_all_keys_1: |-
create_a_key_1: |-
@@ -65,7 +67,7 @@ search_parameter_guide_limit_1: |-
search_parameter_guide_retrieve_1: |-
search_parameter_guide_crop_1: |-
search_parameter_guide_highlight_1: |-
-search_parameter_guide_matches_1: |-
+search_parameter_guide_show_matches_position_1: |-
settings_guide_synonyms_1: |-
settings_guide_stop_words_1: |-
settings_guide_ranking_rules_1: |-
@@ -90,11 +92,10 @@ getting_started_sorting: |-
getting_started_filtering: |-
faceted_search_update_settings_1: |-
faceted_search_filter_1: |-
-faceted_search_facets_distribution_1: |-
+faceted_search_facets_1: |-
faceted_search_walkthrough_filter_1: |-
add_movies_json_1: |-
post_dump_1: |-
-get_dump_status_1: |-
phrase_search_1: |-
sorting_guide_update_sortable_attributes_1: |-
sorting_guide_update_ranking_rules_1: |-
@@ -140,9 +141,16 @@ updating_guide_get_displayed_attributes_old: |-
updating_guide_reset_displayed_attributes_old: |-
updating_guide_reset_displayed_attributes_new: |-
updating_guide_create_dump: |-
-updating_guide_get_dump_status: |-
updating_guide_get_settings_old: |-
updating_guide_retrieve_documents_old: |-
updating_guide_update_settings_old: |-
updating_guide_add_documents_old: |-
getting_started_typo_tolerance: |-
+settings_guide_pagination_1: |-
+get_pagination_settings_1: |-
+update_pagination_settings_1: |-
+reset_pagination_settings_1: |-
+get_faceting_settings_1: |-
+update_faceting_settings_1: |-
+reset_faceting_settings_1: |-
+settings_guide_faceting_1: |-
diff --git a/learn/advanced/asynchronous_operations.md b/learn/advanced/asynchronous_operations.md
index 1b2b32f056..c9491fcf3a 100644
--- a/learn/advanced/asynchronous_operations.md
+++ b/learn/advanced/asynchronous_operations.md
@@ -10,9 +10,6 @@ For example, updating the `filterableAttributes` index setting will require as m
Currently, these are Meilisearch's asynchronous operations:
-- Updating index settings
-- Adding documents to an index
-- Updating documents in an index
- Creating an index
- Updating an index
- Deleting an index
@@ -20,22 +17,22 @@ Currently, these are Meilisearch's asynchronous operations:
- Adding documents to an index
- Updating documents in an index
- Deleting documents from an index
-- [Creating a dump](#dumps)
+- Creating a dump
## Understanding tasks
-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`.
+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.
-### Response
+### Task API response
The response from the [task API](/reference/api/tasks.md) will always include the following fields in the stated order:
| Field | Type | Description |
|--------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------|
| `uid` | integer | The unique sequential identifier of the task |
-| `indexUid` | string | The unique index identifier |
+| `indexUid` | string | The unique index identifier (always `null` for dumps) |
| `status` | string | The status of the task. Possible values are `enqueued`, `processing`, `succeeded`, `failed` |
-| `type` | string | The type of task. Possible values are `indexCreation`, `indexUpdate`, `indexDeletion`, `documentAddition`, `documentPartial`, `documentDeletion`, `settingsUpdate`, `clearAll` |
+| `type` | string | The type of task. Possible values are `indexCreation`, `indexUpdate`, `indexDeletion`, `documentAdditionOrUpdate`, `documentPartial`, `documentDeletion`, `settingsUpdate`, `dumpCreation` |
| `details` | object | Detailed information on the task payload |
| `error` | object | Error details and context. Only present when a task has the `failed` status |
| `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
### Summarized task objects
-All asynchronous operations return a summarized version of the [`task` object](#response). It contains the following fields in the stated order:
+All asynchronous operations return a summarized version of [the full `task` object](#task-api-response). It contains the following fields in the stated order:
| Field | Type | Description |
|------------|---------|--------------------------------- |
| `uid` | integer | Unique sequential identifier |
-| `indexUid` | string | Unique index identifier |
+| `indexUid` | string | Unique index identifier (always `null` for dumps) |
| `status` | string | Status of the task. Value is `enqueued` |
| `type` | string | Type of task |
| `enqueuedAt` | string | Represents the date and time in the RFC 3339 format when the task has been `enqueued` |
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
### Task `status`
@@ -70,16 +67,16 @@ Task responses always contain a field indicating the request's current `status`.
### Examples
-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.
+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.
-When you query the task endpoint using this `uid`, you see that it has been enqueued:
+When you query the [get task endpoint](/reference/api/tasks.md#get-one-task) using this value, you see that it has been enqueued:
```json
{
"uid": 1,
"indexUid": "movies",
"status": "enqueued",
- "type": "documentAddition",
+ "type": "documentAdditionOrUpdate",
"details": {
"receivedDocuments": 67493,
"indexedDocuments": null
@@ -98,7 +95,7 @@ Later, you check the request's status one more time. It was successfully process
"uid": 1,
"indexUid": "movies",
"status": "succeeded",
- "type": "documentAddition",
+ "type": "documentAdditionOrUpdate",
"details": {
"receivedDocuments": 67493,
"indexedDocuments": 67493
@@ -117,7 +114,7 @@ Had the task failed, the response would have included an `error` object:
"uid": 1,
"indexUid": "movies",
"status": "failed",
- "type": "documentAddition",
+ "type": "documentAdditionOrUpdate",
"details": {
"receivedDocuments": 67493,
"indexedDocuments": 0
@@ -137,16 +134,12 @@ Had the task failed, the response would have included an `error` object:
## Task workflow
-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)
+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)
2. When your task reaches the front of the queue, Meilisearch begins working on it and changes the request `status` to `processing`
3. Once the task has completed processing, Meilisearch marks it as `succeeded`, if it was successful, or `failed`, if there was an error.
-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)
-
-### Dumps
-
-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.
+4. Tasks marked as `succeeded` or `failed` are not deleted and will remain visible in [the task list](/reference/api/tasks.md#get-tasks)
-[You can read more about dumps in our dedicated guide.](/learn/advanced/dumps.md)
+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.
## Terminate Meilisearch while a task is being processed
@@ -156,8 +149,8 @@ Meilisearch's asynchronous tasks are atomic. This means that all operations conc
What happens to an asynchronous operation when Meilisearch is terminated changes depending on the request's `status`:
-- `enqueued`: the task will remain enqueued and will be processed as usual once is restarted
-- `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`
+- `enqueued`: the task will remain enqueued and will be processed as usual once Meilisearch has been restarted
+- `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`
- `succeeded`: there will be no data loss since the request was successfully completed
- `failed`: the task failed and nothing has been altered in the database
diff --git a/learn/advanced/dumps.md b/learn/advanced/dumps.md
index 3e6b067ade..7bd1819321 100644
--- a/learn/advanced/dumps.md
+++ b/learn/advanced/dumps.md
@@ -1,6 +1,8 @@
# Dumps
-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.
+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.
## Creating a dump
@@ -8,57 +10,52 @@ To create a dump of your dataset, you need to use the appropriate HTTP route: [`
-The above code triggers a dump creation process. It also returns an object containing information about the dump:
+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.
-```
+```json
{
- "uid": "20200929-114144097",
- "status": "in_progress",
- "startedAt": "2020-09-29T11:41:44.392327Z"
+ "taskUid": 1,
+ "indexUid": null,
+ "status": "enqueued",
+ "type": "dumpCreation",
+ "enqueuedAt": "2022-06-21T16:10:29.217688Z"
}
```
-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:
-
-- `in_progress`: Dump creation is in progress
-- `failed`: An error occurred during dump process, and the task was aborted
-- `done`: Dump creation is finished and was successful
+In the below command, replace `1` with the `taskUid` returned by the previous command.
-
+
-The above code sample returns an object with the following details about the dump:
+This command should return an object with detailed information about the dump operation:
-```
+```json
{
- "uid": "20200929-114144097",
- "status": "done",
- "startedAt": "2020-09-29T11:41:44.392327Z",
- "finishedAt": "2020-09-29T11:41:50.792147Z"
+ "uid": 1,
+ "indexUid": null,
+ "status": "succeeded",
+ "type": "dumpCreation",
+ "details": {
+ "dumpUid": "20220621-161029217"
+ },
+ "duration": "PT0.025872S",
+ "enqueuedAt": "2022-06-21T16:10:29.217688Z",
+ "startedAt": "2022-06-21T16:10:29.218297Z",
+ "finishedAt": "2022-06-21T16:10:29.244169Z"
}
```
-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.**
+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.**
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.
-::: note
-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).
-
-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).
-:::
-
-::: warning
-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.
-:::
-
## Importing a dump
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.
-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.
+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.
::: note
-We do not recommend using dumps from a new Meilisearch version to import an older version.
+We do not recommend using dumps to migrate from a new Meilisearch version to an older one.
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.
:::
@@ -79,4 +76,4 @@ If you are using Meilisearch v0.20 or below, migration should be done in two ste
## Use cases
-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.
+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).
diff --git a/learn/advanced/filtering_and_faceted_search.md b/learn/advanced/filtering_and_faceted_search.md
index 5c7e83c362..7e22260db9 100644
--- a/learn/advanced/filtering_and_faceted_search.md
+++ b/learn/advanced/filtering_and_faceted_search.md
@@ -278,30 +278,29 @@ You can then use this filter to search for `thriller`:
### Facets distribution
-When creating a faceted search interface it is often useful to have a count of how many results belong to each facet. This can be done by using the [`facetsDistribution` search parameter](/reference/api/search.md#facets-distribution) in combination with `filter` when searching.
+When creating a faceted search interface it is often useful to have a count of how many results belong to each facet. This can be done by using the [`facets` search parameter](/reference/api/search.md#facets) in combination with `filter` when searching.
::: note
-Meilisearch does not differentiate between facets and filters. This means that, despite its name, `facetsDistribution` can be used with any attributes added to `filterableAttributes`.
+Meilisearch does not differentiate between facets and filters. This means that, despite its name, `facets` can be used with any attributes added to `filterableAttributes`.
:::
-Using `facetsDistribution` will add an extra field to the returned search results containing the number of matching documents distributed among all the values of a given facet.
+Using `facets` will add an extra field to the returned search results containing the number of matching documents distributed among all the values of a given facet.
In the example below, [IMDb](https://www.imdb.com) displays the facet count in parentheses next to each faceted category. This UI gives users a visual clue of the range of results available for each facet.

-#### Using facet distribution
+#### Using `facets`
-[`facetsDistribution` is a search parameter](/reference/api/search.md#facets-distribution) and as such must be added to a search request. It expects an array of strings. Each string is an attribute present in the `filterableAttributes` list.
+[`facets` is a search parameter](/reference/api/search.md#facets) and as such must be added to a search request. It expects an array of strings. Each string is an attribute present in the `filterableAttributes` list.
-Using the `facetsDistribution` search parameter adds two new keys to the returned object: `facetsDistribution` and `exhaustiveFacetsCount`.
+Using the `facets` search parameter adds `facetDistribution` to the returned object.
-`facetsDistribution` contains an object for every given facet. For each of these facets, there is another object containing all the different values and the count of matching documents. Note that zero values will not be returned: if there are no `romance` movies matching the query, `romance` is not displayed.
+`facetDistribution` contains an object for every given facet. For each of these facets, there is another object containing all the different values and the count of matching documents. Note that zero values will not be returned: if there are no `romance` movies matching the query, `romance` is not displayed.
```json
{
- "exhaustiveFacetsCount": false,
- "facetsDistribution" : {
+ "facetDistribution" : {
"genres" : {
"horror": 50,
"comedy": 34
@@ -310,19 +309,17 @@ Using the `facetsDistribution` search parameter adds two new keys to the returne
}
```
-`exhaustiveFacetsCount` is a boolean value that informs the user whether the facet count is exact or just an approximation. For performance reasons, Meilisearch chooses to use approximate facet count values when there are too many documents across several different fields.
-
-::: warning
-`exhaustiveFacetsCount` is not currently implemented in and will always return `false`.
+::: note
+By default, `facets` returns a maximum of 100 facet values for each faceted field. You can change this value using the `maxValuesPerFacet` property of the [`faceting` index settings](/reference/api/faceting.md).
:::
##### Example
You can write a search query that gives you the distribution of `batman` movies per genre:
-
+
-This query would return not only the matching movies, but also the `facetsDistribution` key containing all relevant data:
+This query would return not only the matching movies, but also the `facetDistribution` key containing all relevant data:
```json
{
@@ -330,7 +327,7 @@ This query would return not only the matching movies, but also the `facetsDistri
…
],
…
- "facetsDistribution": {
+ "facetDistribution": {
"genres": {
"action": 273,
"animation": 118,
diff --git a/learn/advanced/geosearch.md b/learn/advanced/geosearch.md
index 20c3578331..c43c23a936 100644
--- a/learn/advanced/geosearch.md
+++ b/learn/advanced/geosearch.md
@@ -8,14 +8,14 @@ In order to start filtering and sorting documents based on their geographic loca
`_geo` is a reserved field. If you include it in your documents, Meilisearch expects its value to conform to a specific format.
-When using JSON and NDJSON, `_geo` must contain an object with two keys: `lat` and `lng`. Both must contain a floating point number indicating, respectively, latitude and longitude:
+When using JSON and NDJSON, `_geo` must contain an object with two keys: `lat` and `lng`. Both fields must contain either a floating point number or a string indicating, respectively, latitude and longitude:
```json
{
…
"_geo": {
"lat": 0.0,
- "lng": 0.0
+ "lng": "0.0"
}
}
```
diff --git a/learn/advanced/known_limitations.md b/learn/advanced/known_limitations.md
index e3743423b2..a383d0420c 100644
--- a/learn/advanced/known_limitations.md
+++ b/learn/advanced/known_limitations.md
@@ -97,6 +97,6 @@ user = 1 OR user = 2 […] OR user = 1500 OR user = 1501 […] OR user = 2000 OR
## Maximum number of results per search
-**Limitation:** Meilisearch returns up to 1000 documents per search.
+**Limitation:** By default, Meilisearch returns up to 1000 documents per search.
-**Explanation:** This non-customizable limit ensures the database is protected from malicious scraping. This limit only applies to the [search route](/reference/api/search.md). If you want to get all documents in your database, you can use the [get documents endpoint](/reference/api/documents.md#get-documents) instead.
+**Explanation:** Meilisearch limits the maximum amount of returned search results to protect your database from malicious scraping. You may change this by using the `maxTotalHits` property of the [pagination index settings](/reference/api/pagination.md#maxtotalhits). `maxTotalHits` only applies to the [search route](/reference/api/search.md) and has no effect on the [get documents endpoint](/reference/api/documents.md#get-documents).
diff --git a/learn/advanced/pagination.md b/learn/advanced/pagination.md
new file mode 100644
index 0000000000..a75d723a8b
--- /dev/null
+++ b/learn/advanced/pagination.md
@@ -0,0 +1,223 @@
+# Search result pagination
+
+In a perfect world, users would not need to look beyond the first search result to find what they were looking for. In practice, however, it is usually necessary to create some kind of pagination interface to browse through long lists of results.
+
+In this guide, we will discuss some of Meilisearch's current limitations, how these limitations impact common pagination interface patterns, and the recommended way of handling pagination when using Meilisearch.
+
+## Choosing the right pagination UI
+
+There are quite a few pagination interfaces you might want to implement in your application. Many common UI patterns have a page selector allowing users to jump to any search results page. To create a page selector, you must know the exact number of total results so you can calculate the precise number of result pages.
+
+For performance reasons, however, Meilisearch cannot provide the exact number of results for a query. Instead, when using the [search endpoint](/reference/api/search.md), responses contain an `estimatedTotalHits` field. As its name indicates, `estimatedTotalHits` is only an estimate of how many documents match your user's query.
+
+Because of this, we do not recommend creating interfaces with page selectors. If page selection is crucial to the software you are developing, see the [last section of this page](#not-recommended-page-selection) for tips that might help you work around Meilisearch's current limitations.
+
+Many other pagination UIs are fully compatible with Meilisearch, such as infinite scrolling and buttons that manually load more results on click. For an experience similar to page selection, we recommend creating pagination interfaces centered around [previous and next buttons](#recommended-previous-and-next-buttons).
+
+## Recommended: "Previous" and "Next" buttons
+
+Using previous and next buttons for pagination means that users can easily navigate through results, but don't have the ability to jump to an arbitrary results page.
+
+Though this approach offers less precision than a full-blown page selector, it does not require knowing the precise number of search results. This makes it a good fit for Meilisearch's current capabilities.
+
+### Implementation
+
+#### `limit` and `offset`
+
+Previous and next buttons can be implemented using the [`limit`](/reference/api/search.md#limit) and [`offset`](/reference/api/search.md#offset) search parameters.
+
+`limit` sets the size of a page. If you set `limit` to `10`, Meilisearch's response will contain a maximum of 10 search results. `offset` skips a number of search results. If you set `offset` to `20`, Meilisearch's response will skip the first 20 search results.
+
+For example, you can use Meilisearch's JavaScript SDK to get the first ten films in a movies database:
+
+```js
+const results = await index.search("tarkovsky", { limit: 10, offset: 0 });
+```
+
+You can use both parameters together to effectively create search pages.
+
+#### Search pages and calculating `offset`
+
+If you set `limit` to `20` and `offset` to `0`, you get the first twenty search results. We can call this our first page.
+
+```js
+const results = await index.search("tarkovsky", { limit: 20, offset: 0 });
+```
+
+Likewise, if you set `limit` to `20` and `offset` to `40`, you skip the first 40 search results and get documents ranked from 40 through 59. We can call this the third results page.
+
+```js
+const results = await index.search("tarkovsky", { limit: 20, offset: 40 });
+```
+
+You can use this formula to calculate a page's offset value: `offset = limit * (target page number - 1)`. In the previous example, the calculation would look like this: `offset = 20 * (3 - 1)`. This gives us `40` as the result: `offset = 20 * 2 = 40`.
+
+Once a query returns fewer `hits` than your configured `limit`, you have reached the last results page.
+
+#### Keeping track of the current page number
+
+Even though this UI pattern does not allow users to jump to a specific page, it is still useful to keep track of the current page number.
+
+The following JavaScript snippet stores the page number in an HTML element, `.pagination`, and updates it every time the user moves to a different search results page:
+
+```js
+function updatePageNumber(elem) {
+ const directionBtn = elem.id
+ // Get the page number stored in the pagination element
+ let pageNumber = parseInt(document.querySelector('.pagination').dataset.pageNumber)
+
+ // Update page number
+ if (directionBtn === 'previous_button') {
+ pageNumber = pageNumber - 1
+ } else if (directionBtn === 'next_button') {
+ pageNumber = pageNumber + 1
+ }
+
+ // Store new page number in the pagination element
+ document.querySelector('.pagination').dataset.pageNumber = pageNumber
+}
+
+// Add data to our HTML element stating the user is on the first page
+document.querySelector('.pagination').dataset.pageNumber = 0
+// Each time a user clicks on the previous or next buttons, update the page number
+document.querySelector('#previous_button').onclick = function () { updatePageNumber(this) }
+document.querySelector('#next_button').onclick = function () { updatePageNumber(this) }
+```
+
+#### Disabling navigation buttons for first and last pages
+
+It is often helpful to disable navigation buttons when the user cannot move to the "next" or "previous" page.
+
+The "Previous" button should be disabled whenever your `offset` is `0`, as this indicates your user is on the first results page.
+
+To know when to disable the "Next" button, we recommend setting your query's `limit` to the number of results you wish to display per page plus one. That extra `hit` should not be shown to the user. Its purpose is to indicate that there is at least one more document to display on the next page.
+
+The following JavaScript snippet runs checks whether we should disable a button every time the user navigates to another search results page:
+
+```js
+function updatePageNumber() {
+ const pageNumber = parseInt(document.querySelector('.pagination').dataset.pageNumber)
+
+ const offset = pageNumber * 20
+ const results = await index.search('x', { limit: 21, offset })
+
+ // If offset equals 0, we're on the first results page
+ if (offset === 0 ) {
+ document.querySelector('#previous_button').disabled = true;
+ }
+
+ // If offset is bigger than 0, we're not on the first results page
+ if (offset > 0 ) {
+ document.querySelector('#previous_button').disabled = false;
+ }
+
+ // If Meilisearch returns 20 items or less,
+ // we are on the last page
+ if (results.hits.length < 21 ) {
+ document.querySelector('#next_button').disabled = true;
+ }
+
+ // If Meilisearch returns exactly 21 results
+ // and our page can only show 20 items at a time,
+ // we have at least one more page with one result in it
+ if (results.hits.length === 21 ) {
+ document.querySelector('#next_button').disabled = false;
+ }
+}
+
+document.querySelector('#previous_button').onclick = function () { updatePageNumber(this) }
+document.querySelector('#next_button').onclick = function () { updatePageNumber(this) }
+```
+
+## Not recommended: Page selection
+
+This type of pagination consists of a numbered list of pages accompanied by next and previous buttons.
+
+This is a common UI pattern that offers users a significant amount of precision when navigating results. However, due to Meilisearch's [limitations](#choosing-the-right-pagination-ui), it is not a good fit for pagination with Meilisearch.
+
+### Implementation
+
+The general implementation of a page selection interface is similar to our [recommended solution](#recommended-previous-and-next-buttons), with one signficant addition: it includes a numbered page list.
+
+To create a numbered page list, however, you must know the exact number of total results. For example, if you have 100 results and your search result pages contain 10 results each, your selector must show a list of numbers going from 1 to 10.
+
+Since Meilisearch can only give you an estimate of total search results, it is difficult to implement page selectors when using Meilisearch.
+
+We recommend two different workarounds to create this kind of pagination interface with Meilisearch.
+
+#### Use `limit` to set a maximum number of search results
+
+By default, a search request returns 20 search results. You can change this value to a much higher number and treat it as the effective maximum of search results you will show a user. Doing so means the size of your `hits` array is the exact number of search results you have to paginate.
+
+For example, if you set `limit` to `300`, every search request made to Meilisearch returns at most 300 documents. If a query returns a `hits` array with 200 items and you want each page to display 20 results, you can create a page selector with 10 pages.
+
+In the following JavaScript snippet, each time a user searches, we make a new query with `limit` set to `300`. Once we receive the search results, we store them in a variable and create a list of numbered pages. When users click on any number in the page list, we display a new page:
+
+```js
+// Retrieve search results and create the page selector
+function getSearchResults(searchTerm) {
+ // The amount of results we want to display in each page
+ const hitsPerPage = 10
+
+ // The maximum amount of results we will display
+ const { hits } = await index.search(searchTerm, { limit: 300 })
+
+ // Clear the previous buttons…
+ const pagination = document.querySelector('.pagination')
+ pagination.innerHTML = ''
+
+ // …and create a new button for each search results page
+ for (let page = 0; page < hits.length; page += hitsPerPage) {
+ const numberBtn = document.createElement('button');
+ numberBtn.innerText = page / hitsPerPage
+
+ // When the user clicks on a page number, show that results page
+ numberBtn.onclick = function () {
+ const pageNumber = parseInt(this.innerText)
+ changePage(pageNumber, hits, hitsPerPage)
+ }
+
+ pagination.appendChild(numberBtn)
+ }
+
+ // Display first search results page
+ changePage(1, hits, hitsPerPage)
+}
+
+// Display a page of search results
+function changePage(pageNumber, hits, hitsPerPage) {
+ const offset = (pageNumber - 1) * hitsPerPage
+ const paginatedHits = hits.slice(offset, offset + hitsPerPage)
+ const resultList = document.querySelector('.results')
+
+ resultList.innerHTML = ''
+
+ paginatedHits.map(hit => {
+ const resultItem = document.createElement('div');
+ resultItem.innerText = hit.title
+ resultList.appendChild(resultItem)
+ })
+}
+
+// Get the search bar and retrieve results every time the user makes a new query
+const searchBar = document.querySelector('.searchBar')
+searchBar.onChange(function () { getSearchResults('tarkovsky') })
+```
+
+This method provides control and reliability. It also prevents users from paginating too far, which might result in performance gains. However, it limits the number of results your users can see. Additionally, we recommend caution when setting high values for `limit` as it can negatively impact performance.
+
+::: note
+By default, Meilisearch returns a maximum of 1000 search results. Consult our [index setting reference](/reference/api/pagination.md) if you need to change this.
+:::
+
+#### Use `estimatedTotalHits`
+
+Though we advise against it, you can use `estimatedTotalHits` to calculate the number of search result pages. This means your number of results and page count are likely to change until Meilisearch retrieves the last search result.
+
+For example, a query's `estimatedTotalHits` might be `100` when you fetch the first page of search results. If you are showing 20 results per page, this means your interface will display a page selector with 5 pages. When you fetch the fifth and last page according to Meilisearch's current estimate, however, `estimatedTotalHits` might change to `300`. Your page list, previously displaying 5 pages, must now show 15 total pages.
+
+This method gives users access to all search results. However, it also results in an interface that might feel unreliable due to constant and unpredictable changes.
+
+## Unsatisfied? Let us know
+
+Is the current state of pagination in Meilisearch creating problems for you? Please share your thoughts with us in this [GitHub discussion](https://github.com/meilisearch/product/discussions/483). We are actively working on improving this aspect of Meilisearch and your input is greatly appreciated.
diff --git a/learn/advanced/tokenization.md b/learn/advanced/tokenization.md
index acf63d63be..8811f136a5 100644
--- a/learn/advanced/tokenization.md
+++ b/learn/advanced/tokenization.md
@@ -8,18 +8,18 @@ This allows Meilisearch to function in several different languages with zero set
## Deep dive: The Meilisearch tokenizer
-
-
-When you add documents to a Meilisearch index, the tokenization process is handled by an abstract interface called an **analyzer**. The analyzer is responsible for determining the primary language of each field based on the scripts (e.g., Latin alphabet, Chinese hanzi, etc.) that are present there. Then, it applies the corresponding **pipeline** to each field.
+When you add documents to a Meilisearch index, the tokenization process is handled by an abstract interface called the tokenizer. The tokenizer is responsible for splitting each field by writing system (e.g. Latin alphabet, Chinese hanzi). It then applies the corresponding pipeline to each part of each document field.
We can break down the tokenization process like so:
-1. Crawl the document(s) and determine the primary language for each field
-2. Go back over the documents field-by-field, running the corresponding tokenization pipeline, if it exists
+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 two pipelines:
+Pipelines include many language-specific operations. Currently, we have four pipelines:
-1. A specialized Chinese pipeline using [Jieba](https://github.com/messense/jieba-rs)
-2. A default Meilisearch pipeline that separates words based on categories. Works with a variety of languages
+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 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
-For more details, check out the [feature specification](https://github.com/meilisearch/specifications/blob/master/text/0001-script-based-tokenizer.md).
+For more details, check out the [tokenizer contribution guide](https://github.com/meilisearch/charabia/blob/main/CONTRIBUTING.md).
diff --git a/learn/advanced/updating.md b/learn/advanced/updating.md
index 508f2a2969..7592b6b867 100644
--- a/learn/advanced/updating.md
+++ b/learn/advanced/updating.md
@@ -102,6 +102,10 @@ docker run -it --rm \
::::
+:::note
+If you are updating to v0.28, keys imported from the old version will have their `key` and `uid` fields regenerated.
+:::
+
### Proceed according to your database version
Now that you know which Meilisearch version your database is compatible with, proceed accordingly:
@@ -138,7 +142,7 @@ If it's something else, then you need to use the [reset displayed attributes end
-This command returns a `uid`. You can use this to [track the status of the operation](/reference/api/tasks.md#get-task). Once the status is `succeeded`, you're good to go.
+This command returns a `taskUid`. You can use this to [track the status of the operation](/reference/api/tasks.md#get-one-task). Once the status is `succeeded`, you're good to go.
Now that all fields are displayed, proceed to the next step.
@@ -206,24 +210,31 @@ The server should return a response that looks like this:
```json
{
- "uid": "20210212-151153878",
- "status": "in_progress",
- "startedAt": "2021-02-12T15:11:53.402327Z"
+ "taskUid": 1,
+ "indexUid": null,
+ "status": "enqueued",
+ "type": "dumpCreation",
+ "enqueuedAt": "2022-06-21T16:10:29.217688Z"
}
```
-This process can take some time. Since dump creation is an [asynchronous operation](/learn/advanced/asynchronous_operations.md), you can use the returned `uid` to [track its status](/reference/api/dump.md#get-dump-status).
-
-
+This command returns a `taskUid`. You can use this to [track the status](/reference/api/tasks.md#get-one-task) of your dump. Keep in mind that the process can take some time to complete.
-Once the response to the previous command looks like this (`"status": "done"`), move on.
+Once the `dumpCreation` task shows `"status": "succeeded"`, you're ready to move on.
```json
{
- "uid": "20200929-114144097",
- "status": "done",
- "startedAt": "2020-09-29T11:41:44.392327Z",
- "finishedAt": "2020-09-29T11:41:50.792147Z"
+ "uid": 1,
+ "indexUid": null,
+ "status": "succeeded",
+ "type": "dumpCreation",
+ "details": {
+ "dumpUid": "20220621-161029217"
+ },
+ "duration": "PT0.025872S",
+ "enqueuedAt": "2022-06-21T16:10:29.217688Z",
+ "startedAt": "2022-06-21T16:10:29.218297Z",
+ "finishedAt": "2022-06-21T16:10:29.244169Z"
}
```
diff --git a/learn/configuration/distinct.md b/learn/configuration/distinct.md
index 02274a3248..fe6b446919 100644
--- a/learn/configuration/distinct.md
+++ b/learn/configuration/distinct.md
@@ -65,8 +65,7 @@ After setting the distinct attribute as shown above, querying for `lee leather j
],
"offset": 0,
"limit": 20,
- "nbHits": 1,
- "exhaustiveNbHits": false,
+ "estimatedTotalHits": 1,
"processingTimeMs": 0,
"query": "lee leather jacket"
}
diff --git a/learn/configuration/settings.md b/learn/configuration/settings.md
index a0380f432d..8c31f449d7 100644
--- a/learn/configuration/settings.md
+++ b/learn/configuration/settings.md
@@ -7,6 +7,8 @@ This page describes the **index-level settings** available in Meilisearch and ho
| **[displayedAttributes](/learn/configuration/settings.md#displayed-attributes)** | Fields displayed in the returned documents | All attributes found in the documents |
| **[distinctAttribute](/learn/configuration/settings.md#distinct-attribute)** | Search returns documents with distinct (different) values of the given field | `null` |
| **[filterableAttributes](/learn/configuration/settings.md#filterable-attributes)** | List of attributes that can be used for filtering | `null` |
+| **[pagination](/learn/advanced/pagination.md)** | Pagination settings | `{}`
+| **[faceting](/learn/advanced/filtering_and_faceted_search.md)** | Faceting settings | `{}`
| **[rankingRules](/learn/configuration/settings.md#ranking-rules)** | List of ranking rules sorted by order of importance | [A list of ordered built-in ranking rules](/learn/core_concepts/relevancy.md#built-in-rules) |
| **[searchableAttributes](/learn/configuration/settings.md#searchable-attributes)** | Fields in which to search for matching query words sorted by order of importance | All attributes found in the documents | |
| **[sortableAttributes](/learn/configuration/settings.md#sortable-attributes)** | List of attributes to use when sorting search results | `[]` |
@@ -95,6 +97,38 @@ To be able to filter search results on `director` and `genres` in a movie databa
+## Pagination
+
+The maximum number of results Meilisearch can return. By default, this value is `1000` which means you cannot access results beyond `1000`.
+
+[Learn more about pagination in our dedicated guide.](/learn/advanced/pagination.md)
+
+### Example
+
+The code sample below updates `maxTotalHits` to `50`:
+
+
+
+::: note
+`maxTotalHits` takes priority over search parameters such as [`limit`](/reference/api/search.md#limit) and [`offset`](/reference/api/search.md#offset).
+:::
+
+## Faceting
+
+The faceting settings of an index. Facets are specific use-cases of filters that can be used to refine search results.
+
+::: tip
+Like filters, you need to add your facets to [`filterableAttributes`](/reference/api/filterable_attributes.md#update-filterable-attributes) in order to use the [`filter`](/reference/api/search.md#filter) search parameter.
+:::
+
+[Learn more about faceting](/learn/advanced/filtering_and_faceted_search.md)
+
+#### Example
+
+The following code sample will return a maximum of `5` facet values for each facet in the `movies` index:
+
+
+
## Ranking rules
Built-in ranking rules that **ensure relevancy in search results**. Ranking rules are applied in a default order which can be changed in the settings. You can add or remove rules and change their order of importance.
diff --git a/learn/core_concepts/indexes.md b/learn/core_concepts/indexes.md
index 36f069949e..c185683248 100644
--- a/learn/core_concepts/indexes.md
+++ b/learn/core_concepts/indexes.md
@@ -29,7 +29,6 @@ The `uid` is the **unique identifier** of an index. It is set when creating the
```json
{
"uid": "movies",
- "name": "movies",
"createdAt": "2019-11-20T09:40:33.711324Z",
"updatedAt": "2019-11-20T10:16:42.761858Z"
}
@@ -59,6 +58,8 @@ You can customize the following index settings:
- [Stop words](#stop-words)
- [Displayed and searchable attributes](#displayed-and-searchable-attributes)
- [Typo tolerance](#typo-tolerance)
+- [Pagination](#pagination)
+- [Faceting](#faceting)
To change index settings, use the [update settings endpoint](/reference/api/settings.md#update-settings) or any of the [child routes](/reference/api/settings.md#all-settings).
@@ -130,3 +131,17 @@ Typo tolerance is a built-in feature that helps you find relevant results even w
You can update the typo tolerance settings using the [update settings endpoint](/reference/api/settings.md#update-settings) or the [update typo tolerance endpoint](/reference/api/typo_tolerance.md#update-typo-tolerance).
[Learn more about typo tolerance](/learn/configuration/typo_tolerance.md)
+
+### Pagination
+
+To protect your database from malicious scraping, Meilisearch only returns up to `1000` results for a search query. You can change this limit using the [update settings endpoint](/reference/api/settings.md#update-settings) or the [update pagination settings endpoint](/reference/api/pagination.md#update-pagination-settings).
+
+[Learn more about pagination](/learn/advanced/pagination.md)
+
+### Faceting
+
+Facets are a specific use-case of filters in Meilisearch: whether something is a facet or filter depends on your UI and UX design. Like filters, you need to add your facets to [`filterableAttributes`](/reference/api/filterable_attributes.md#update-filterable-attributes), then make a search query using the [`filter` search parameter](/reference/api/search.md#filter).
+
+By default, Meilisearch returns `100` facet values for each faceted field. You can change this using the [update settings endpoint](/reference/api/settings.md#update-settings) or the [update faceting settings endpoint](/reference/api/faceting.md#update-faceting-settings).
+
+[Learn more about faceting](/learn/advanced/filtering_and_faceted_search.md)
diff --git a/learn/core_concepts/primary_key.md b/learn/core_concepts/primary_key.md
index 08c6d1fd3a..4eab7f9abc 100644
--- a/learn/core_concepts/primary_key.md
+++ b/learn/core_concepts/primary_key.md
@@ -120,7 +120,7 @@ The code below adds a document to the `books` index and sets `reference_number`
"uid": 1,
"indexUid": "books",
"status": "succeeded",
- "type": "documentAddition",
+ "type": "documentAdditionOrUpdate",
"details":{
"receivedDocuments":1,
"indexedDocuments":1
@@ -177,7 +177,7 @@ This error occurs when you add documents for the first time and Meilisearch [fai
"uid":1,
"indexUid": "books",
"status": "failed",
- "type": "documentAddition",
+ "type": "documentAdditionOrUpdate",
"details":{
"receivedDocuments":5,
"indexedDocuments":null
@@ -204,7 +204,7 @@ This error occurs when your index already has a primary key, but one of the docu
"uid":1,
"indexUid": "books",
"status": "failed",
- "type": "documentAddition",
+ "type": "documentAdditionOrUpdate",
"details":{
"receivedDocuments":1,
"indexedDocuments":null
@@ -231,7 +231,7 @@ This happens when your document id does not have the correct [format](#formattin
"uid":1,
"indexUid": "books",
"status": "failed",
- "type": "documentAddition",
+ "type": "documentAdditionOrUpdate",
"details":{
"receivedDocuments":5,
"indexedDocuments":null
diff --git a/learn/getting_started/algolia_migration.md b/learn/getting_started/algolia_migration.md
index e08bcca0d0..96e20a3922 100644
--- a/learn/getting_started/algolia_migration.md
+++ b/learn/getting_started/algolia_migration.md
@@ -181,7 +181,7 @@ The below table compares Algolia's **API parameters** with the equivalent Meilis
| `query` | `q` |
| `attributesToRetrieve` | `attributesToRetrieve` |
| `filters` | `filter` |
-| `facets` | `facetsDistribution` |
+| `facets` | `facetDistribution` |
| `attributesToHighlight` | `attributesToHighlight` |
| `offset` | `offset` |
| `length` | `limit` |
diff --git a/learn/getting_started/filtering_and_sorting.md b/learn/getting_started/filtering_and_sorting.md
index 7e5c05c9ad..0222a597ef 100644
--- a/learn/getting_started/filtering_and_sorting.md
+++ b/learn/getting_started/filtering_and_sorting.md
@@ -41,8 +41,7 @@ Let's say you only want to view meteorites that weigh less than 200g:
},
…
],
- "nbHits": 114,
- "exhaustiveNbHits": false,
+ "estimatedTotalHits": 114,
"query": "",
"limit": 20,
"offset": 0,
@@ -77,8 +76,7 @@ Let's sort the meteorites in the previous example based on mass:
},
…
],
- "nbHits": 114,
- "exhaustiveNbHits": false,
+ "estimatedTotalHits": 114,
"query": "",
"limit": 20,
"offset": 0,
@@ -132,8 +130,7 @@ Let's say you want to find out which meteorites crashed within a 210km radius of
},
…
],
- "nbHits": 7,
- "exhaustiveNbHits": false,
+ "estimatedTotalHits": 7,
"query": "",
"limit": 20,
"offset": 0,
@@ -180,8 +177,7 @@ The following command sorts meteorites by how close they were to the Taj Mahal:
},
…
]
- "nbHits": 1000,
- "exhaustiveNbHits": false,
+ "estimatedTotalHits": 1000,
"query": "",
"limit": 20,
"offset": 0,
diff --git a/learn/getting_started/quick_start.md b/learn/getting_started/quick_start.md
index 3492b82449..80bdd5bb01 100644
--- a/learn/getting_started/quick_start.md
+++ b/learn/getting_started/quick_start.md
@@ -51,14 +51,14 @@ These commands launch the **latest stable release** of Meilisearch.
```bash
# Fetch the latest version of Meilisearch image from DockerHub
-docker pull getmeili/meilisearch:v0.27.2
+docker pull getmeili/meilisearch:v0.28
# Launch Meilisearch in development mode with a master key
docker run -it --rm \
-p 7700:7700 \
-e MEILI_MASTER_KEY='MASTER_KEY'\
-v $(pwd)/meili_data:/meili_data \
- getmeili/meilisearch:v0.27.2 \
+ getmeili/meilisearch:v0.28 \
meilisearch --env="development"
```
@@ -101,10 +101,10 @@ cd meilisearch
Choose the release you want to use. You can find the full list [here](https://github.com/meilisearch/meilisearch/releases).
-In the cloned repository, run the following command replacing `vX.Y.Z` with the tag you selected:
+In the cloned repository, run the following command to access the most recent version of Meilisearch:
```bash
-git checkout v0.25.2
+git checkout stable
```
Finally, update the rust toolchain, compile the project, and execute the binary.
@@ -188,17 +188,17 @@ The previous command added documents from `movies.json` to a new index called `m
```json
{
- "uid": 0,
+ "taskUid": 0,
"indexUid": "movies",
"status": "enqueued",
- "type": "documentAddition",
+ "type": "documentAdditionOrUpdate",
"enqueuedAt": "2021-08-11T09:25:53.000000Z"
}
```
Most database operations in Meilisearch are [asynchronous](/learn/advanced/asynchronous_operations.md). This means that rather than being processed instantly, **API requests are added to a queue and processed one at a time**.
-Use the returned `uid` to [check the status](/reference/api/tasks.md) of your documents:
+Use the returned `taskUid` to [check the status](/reference/api/tasks.md) of your documents:
@@ -209,7 +209,7 @@ If the document addition is successful, the response should look like this:
"uid": 0,
"indexUid": "movies",
"status": "succeeded",
- "type": "documentAddition",
+ "type": "documentAdditionOrUpdate",
"details":{
"receivedDocuments": 19547,
"indexedDocuments": 19547
@@ -252,8 +252,7 @@ In the above code sample, the parameter `q` represents the search query. The doc
},
…
],
- "nbHits": 66,
- "exhaustiveNbHits": false,
+ "estimatedTotalHits": 66,
"query": "botman",
"limit": 20,
"offset": 0,
diff --git a/learn/security/master_api_keys.md b/learn/security/master_api_keys.md
index cff165cde6..45df62d8e9 100644
--- a/learn/security/master_api_keys.md
+++ b/learn/security/master_api_keys.md
@@ -82,27 +82,39 @@ Exposing your master key can give malicious users complete control over your Mei
Meilisearch gives you fine-grained control over which users can access which indexes, endpoints, and routes. When protecting your instance with a master key, you can ensure only authorized users can carry out sensitive tasks such as adding documents or altering index settings.
-The master key is the only key with access to the [`/keys` route](/reference/api/keys.md). This route allows you to [create](#creating-an-api-key), [update](#updating-an-api-key), [list](#listing-api-keys), and [delete](#deleting-an-api-key) API keys.
+You can access the [`/keys` route](/reference/api/keys.md) using the master key or an API key with access to the `keys.get`, `keys.create`, `keys.update`, or `keys.delete` actions. This `/keys` route allows you to [create](#creating-an-api-key), [update](#updating-an-api-key), [list](#listing-api-keys), and [delete](#deleting-an-api-key) API keys.
Though the default API keys are usually enough to manage the security needs of most applications, this might not be the case when dealing with privacy-sensitive data. In these situations, the fine-grained control offered by the `/keys` endpoint allows you to clearly decide who can access what information and for how long.
+The [`key`](/reference/api/keys.md#key) field is generated by hashing the master key and the [`uid`](/reference/api/keys.md#uid). As a result, `key` values are deterministic between instances sharing the same configuration. Since the `key` field depends on the master key, it is not propagated to dumps and snapshots. If a malicious user ever gets access to your dumps or snapshots, they will not have access to your instance's API keys.
+
+It is, therefore, possible to determine the value of the `key` field by using the following command:
+
+```bash
+echo -n $HYPHENATED_UUID | openssl dgst -sha256 -hmac $MASTER_KEY
+```
+
+This is also useful in continuous deployment processes as you know the value of the `key` field in advance.
+
### Updating an API key
-You can freely update an API key at any time, even after it expires. This includes editing the indexes, endpoints, and routes it can access, as well as its description and expiry date.
+You can only update the `name` and `description` of an API key, even after it expires.
-We can update the `Default Search API Key` so regular users cannot perform search operations in our `patient_medical_records` index:
+For example, we can update the `Default Search API Key` and change its description:
```json
{
+ "name": "Default Search API Key",
"description": "Default Search API Key",
"key": "d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4",
+ "uid":"74c9c733-3368-4738-bbe5-1d18a5fecb37",
"actions": [
"search"
],
"indexes": [
- "doctors"
+ "*"
],
"expiresAt": null,
"createdAt": "2022-01-01T10:00:00Z",
@@ -110,15 +122,15 @@ We can update the `Default Search API Key` so regular users cannot perform searc
}
```
-To update an API key, you must use the [update API key endpoint](/reference/api/keys.md#update-a-key) which can only be accessed with the master key.
+To update an API key, you must use the [update API key endpoint](/reference/api/keys.md#update-a-key), which can only be accessed with the master key or an API key with the `keys.update` action.
-Meilisearch supports partial updates with the `PATCH` route. This means your payload only needs to contain the data you want to update—in this case, `indexes`.
+Meilisearch supports partial updates with the `PATCH` route. This means your payload only needs to contain the data you want to update—in this case, `description`.
### Creating an API key
-You can create API keys by using the [create key endpoint](/reference/api/keys.md#create-a-key). This endpoint is always protected and can only be accessed with the master key.
+You can create API keys by using the [create key endpoint](/reference/api/keys.md#create-a-key). This endpoint is always protected and can only be accessed with the master key or an API key with the `keys.create` action.
-Since we have altered the permissions in our default search key, we need to create a new API key so authorized users can search through out `patient_medical_records` index:
+Let's create a new API key so authorized users can search through out `patient_medical_records` index:
@@ -126,8 +138,10 @@ All [`/keys` endpoints](/reference/api/keys.md) are synchronous, so your key wil
```json
{
+ "name": null,
"description": "Search patient records key",
"key": "d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4",
+ "uid": "ac5cd97d-5a4b-4226-a868-2d0eb6d197ab",
"actions": [
"search"
],
@@ -146,9 +160,9 @@ It is good practice to always set an expiry date when creating a new API key. If
You can use the [list keys endpoint](/reference/api/keys.md) to obtain information on any active key in your Meilisearch instance. This is useful when you need an overview of existing keys and their permissions.
-[`GET /keys`](/reference/api/keys.md#get-all-keys) returns a full list of all existing keys. **Expired keys will appear in the response, but deleted keys will not**. As with creating, deleting, and updating API keys, you need the master key to access this endpoint.
+By default, [`GET /keys`](/reference/api/keys.md#get-all-keys) returns the 20 most recently created keys. You can change this using the [`limit`](/reference/api/keys.md#get-all-keys) query parameter. **Expired keys will appear in the response, but deleted keys will not**. As with creating, deleting, and updating API keys, you either need the master key or an API key with the `keys.get` action to access this endpoint.
-[`GET /keys/{key}`](/reference/api/keys.md#get-one-key) returns information on a single key. `{key}` should be replaced with the full `key` value obtained during key creation.
+[`GET /keys/{key_or_uid}`](/reference/api/keys.md#get-one-key) returns information on a single key. `{key_or_uid}` should be replaced with the full `key` or `uid` value obtained during key creation.
We can query our instance to confirm which active keys can search our `patient_medical_records` index:
@@ -158,34 +172,40 @@ We can query our instance to confirm which active keys can search our `patient_m
{
"results": [
{
- "description": "Default Search API Key (Use it to search from the frontend code)",
- "key": "0a6e572506c52ab0bd6195921575d23092b7f0c284ab4ac86d12346c33057f99",
+ "name": "Default Search API Key",
+ "description": "Use it to search from the frontend",
+ "key": "d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4",
+ "uid":"74c9c733-3368-4738-bbe5-1d18a5fecb37",
"actions": [
- "search"
+ "search"
],
"indexes": [
- "doctors"
+ "*"
],
"expiresAt": null,
- "createdAt": "2021-08-11T10:00:00Z",
- "updatedAt": "2021-08-11T10:00:00Z"
+ "createdAt": "2022-01-01T10:00:00Z",
+ "updatedAt": "2022-01-01T10:00:00Z"
},
{
- "description": "Default Admin API Key (Use it for all other operations. Caution! Do not share it on the client side)",
+ "name": "Default Admin API Key",
+ "description": "Use it for all other than search operations. Caution! Do not expose it on a public frontend",
"key": "380689dd379232519a54d15935750cc7625620a2ea2fc06907cb40ba5b421b6f",
+ "uid": "20f7e4c4-612c-4dd1-b783-7934cc038213",
"actions": [
- "*"
+ "*"
],
"indexes": [
- "*"
+ "*"
],
"expiresAt": null,
"createdAt": "2021-08-11T10:00:00Z",
"updatedAt": "2021-08-11T10:00:00Z"
},
{
+ "name": null,
"description": "Search patient records key",
"key": "d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4",
+ "uid": "ac5cd97d-5a4b-4226-a868-2d0eb6d197ab",
"actions": [
"search"
],
@@ -196,7 +216,10 @@ We can query our instance to confirm which active keys can search our `patient_m
"createdAt": "2022-01-01T10:00:00Z",
"updatedAt": "2022-01-01T10:00:00Z"
}
- ]
+ ],
+ "offset":0,
+ "limit":20,
+ "total":3
}
```
@@ -212,8 +235,6 @@ If we accidentally exposed our `Search patient records key`, we can delete it to
Once a key is past its `expiresAt` date, using it for API authorization will return an error. Expired keys will still be returned by the [list keys endpoint](/reference/api/keys.md#get-all-keys).
-If you must continue using an expired key, you may use the [update key endpoint](/reference/api/keys.md#update-a-key) to set a new `expiresAt` date and effectively reactivate it.
-
## Changing the master key
To change the master key, first terminate your Meilisearch instance. Then relaunch it, [supplying a new value for the master key](#protecting-a-meilisearch-instance).
diff --git a/learn/security/tenant_tokens.md b/learn/security/tenant_tokens.md
index 21939b7087..aff1e6c2fd 100644
--- a/learn/security/tenant_tokens.md
+++ b/learn/security/tenant_tokens.md
@@ -58,6 +58,7 @@ Using a third-party library for tenant token generation is fairly similar to cre
const jwt = require('jsonwebtoken');
const apiKey = 'my_api_key';
+const apiKeyUid = 'ac5cd97d-5a4b-4226-a868-2d0eb6d197ab';
const currentUserID = 'a_user_id';
const tokenPayload = {
@@ -66,18 +67,18 @@ const tokenPayload = {
'filter': `user_id = ${currentUserID}`
}
},
- apiKeyPrefix: apiKey.substring(0, 8),
+ apiKeyUid: apiKeyUid,
exp: parseInt(Date.now() / 1000) + 20 * 60 // 20 minutes
};
const token = jwt.sign(tokenPayload, apiKey, {algorithm: 'HS256'});
```
-`tokenPayload` contains the token payload. It must contain three fields: `searchRules`, `apiKeyPrefix`, and `exp`.
+`tokenPayload` contains the token payload. It must contain three fields: `searchRules`, `apiKeyUid`, and `exp`.
`searchRules` must be a JSON object containing a set of search rules. These rules specify restrictions applied to every query using this web token.
-`apiKeyPrefix` must be the first 8 characters of a valid Meilisearch API key.
+`apiKeyUid` must be the `uid` of a valid Meilisearch API key.
`exp` is the only optional parameter of a tenant token. It must be a UNIX timestamp specifying the expiration date of the token.
@@ -117,7 +118,7 @@ The token payload contains most of the relevant token data. It must be an object
```json
{
"exp": 1646756934,
- "apiKeyPrefix": "12345678",
+ "apiKeyUid": "ac5cd97d-5a4b-4226-a868-2d0eb6d197ab",
"searchRules": {
"patient_medical_records": {
"filter": "user_id = 1"
@@ -188,7 +189,7 @@ The previous rules can be combined in one tenant token:
```json
{
- "apiKeyPrefix": "rkDxFUHd",
+ "apiKeyUid": "ac5cd97d-5a4b-4226-a868-2d0eb6d197ab",
"exp": 1641835850,
"searchRules": {
"*": {
diff --git a/learn/what_is_meilisearch/language.md b/learn/what_is_meilisearch/language.md
index 38c9bf3e56..ea5a004e63 100644
--- a/learn/what_is_meilisearch/language.md
+++ b/learn/what_is_meilisearch/language.md
@@ -1,42 +1,43 @@
# Language
-**Meilisearch is multilingual**, featuring optimized support for:
+Meilisearch is multilingual, featuring optimized support for:
-- **Any language that uses whitespace to separate words**
-- **Chinese** (through [Jieba](https://github.com/messense/jieba-rs))
-- **Japanese** (through [Lindera](https://github.com/lindera-morphology/lindera))
+- Any language that uses whitespace to separate words
+- Chinese
+- Japanese
+- Hebrew
-We aim to provide global language support, and your feedback helps us [move closer to that goal](#improving-our-language-support). If you notice inconsistencies in your search results or the way your documents are processed, please open an issue on our [GitHub repository](https://github.com/meilisearch/meilisearch/issues/new/choose).
+We aim to provide global language support, and your feedback helps us move closer to that goal. If you notice inconsistencies in your search results or the way your documents are processed, please [open an issue in the Meilisearch repository](https://github.com/meilisearch/meilisearch/issues/new/choose).
-If you'd like to learn more about how different languages are processed in Meilisearch, see our [tokenizer documentation](/learn/advanced/tokenization.md).
+[Read more about our tokenizer](/learn/advanced/tokenization.md)
## Improving our language support
-While we have employees from all over the world at Meilisearch, we don't speak every language. In fact, we rely almost entirely on feedback from external contributors to know how our engine is performing across different languages.
+While we have employees from all over the world at Meilisearch, we don't speak every language. We rely almost entirely on feedback from external contributors to understand how our engine is performing across different languages.
-If you'd like to help us create a more global Meilisearch, please consider sharing your tests, results, and general feedback with us through [GitHub issues](https://github.com/meilisearch/Meilisearch/issues). Here are some of the languages that have been requested by users and their corresponding issue:
+If you'd like to request optimized support for a language, please upvote the related [discussion in our product repository](https://github.com/meilisearch/product/discussions?discussions_q=label%3Aproduct%3Acore%3Atokenizer) or [open a new one](https://github.com/meilisearch/product/discussions/new?category=feedback-feature-proposal) if it doesn't exist.
-- [Arabic](https://github.com/meilisearch/meilisearch/issues/554)
-- [Lao](https://github.com/meilisearch/meilisearch/issues/563)
-- [Persian/Farsi](https://github.com/meilisearch/meilisearch/issues/553)
-- [Thai](https://github.com/meilisearch/meilisearch/issues/864)
-
-If you'd like us to add or improve support for a language that isn't in the above list, please create an [issue](https://github.com/meilisearch/meilisearch/issues/new?assignees=&labels=&template=feature_request.md&title=) saying so, and then make a [pull request on the documentation](https://github.com/meilisearch/documentation/edit/master/reference/features/language.md) to add it to the above list.
+If you'd like to help by developing a tokenizer pipeline yourself: first of all, thank you! We recommend that you take a look at the [tokenizer contribution guide](https://github.com/meilisearch/charabia/blob/main/CONTRIBUTING.md) before making a PR.
## FAQ
### What do you mean when you say Meilisearch offers _optimized_ support for a language?
-Under the hood, Meilisearch relies on tokenizers that identify the most important parts of each document in a given dataset. We currently use two tokenization pipelines: one for languages that separate words with spaces and one specifically tailored for Chinese. Languages that delimit their words in other ways will still work, but the quality and relevancy of search results may vary significantly.
+Under the hood, Meilisearch relies on tokenizers that identify the most important parts of each document in a given dataset. We currently use four tokenization pipelines:
+
+- A default pipeline designed for languages that separate words with spaces
+- A pipeline specifically tailored for Chinese
+- A pipeline specifically tailored for Japanese
+- A pipeline specifically tailored for Hebrew
### My language does not use whitespace to separate words. Can I still use Meilisearch?
-Yes, but your experience might not be optimized and results might be less relevant than in whitespace-separated languages and Chinese.
+Yes, but search results might be less relevant than in one of the fully optimized languages.
### My language does not use the Roman alphabet. Can I still use Meilisearch?
-Yes—our users work with many different alphabets and writing systems such as Cyrillic, Thai, and Japanese.
+Yes—our users work with many different alphabets and writing systems, such as Cyrillic, Thai, and Japanese.
### Does Meilisearch plan to support additional languages in the future?
-Yes, we definitely do. The more feedback we get from native speakers, the easier it is for us to understand how to improve performance for those languages—and the more requests to improve support for a specific language, the more likely we are to devote resources to that project.
+Yes, we definitely do. The more [feedback](https://github.com/meilisearch/product/discussions?discussions_q=label%3Aproduct%3Acore%3Atokenizer) we get from native speakers, the easier it is for us to understand how to improve performance for those languages. Similarly, the more requests we get to improve support for a specific language, the more likely we are to devote resources to that project.
diff --git a/learn/what_is_meilisearch/telemetry.md b/learn/what_is_meilisearch/telemetry.md
index d61c619738..ad6a3c2fdd 100644
--- a/learn/what_is_meilisearch/telemetry.md
+++ b/learn/what_is_meilisearch/telemetry.md
@@ -152,7 +152,8 @@ This list is liable to change with every new version of Meilisearch. It's not be
| `formatting.highlight_post_tag` | `true` if `highlightPostTag` is specified, otherwise `false` | false
| `formatting.crop_length` | `true` if `cropLength` is specified, otherwise `false` | false
| `formatting.crop_marker` | `true` if `cropMarker` is specified, otherwise `false` | false
-| `formatting.matches` | `true` if `matches` is specified, otherwise `false` | false
+| `formatting.show_matches_position` | `true` if `showMatchesPosition` is used in this batch, otherwise `false` | false
+| `facets` | `true` if `facets` is used in this batch, otherwise `false` | false
| `primary_key` | Name of primary key when explicitly set as part of document addition, document update, index creation, or index update. Otherwise `null` | id
| `payload_type` | All values encountered in the `Content-Type` header, including invalid ones | ["application/json", "text/plain", "application/x-ndjson"]
| `index_creation` | `true` if a document addition or update request triggered index creation, otherwise `false` | true
@@ -163,8 +164,13 @@ This list is liable to change with every new version of Meilisearch. It's not be
| `filterable_attributes.has_geo` | `true` if `_geo` is set as a filterable attribute, otherwise `false` | false
| `searchable_attributes.total` | Number of searchable attributes | 4
| `per_task_uid` | `true` if a `uid` is used to fetch a particular task resource, otherwise `false` | true
+| `filtered_by_index_uid` | `true` if the `GET /tasks` endpoint is filered by `indexUid`, otherwise `false` | false
+| `filtered_by_type` | `true` if the `GET /tasks` endpoint is filered by `type`, otherwise `false` | false
+| `filtered_by_status` | `true` if the `GET /tasks` endpoint is filered by `status`, otherwise `false` | false
| `typo_tolerance.enabled` | `true` if typo tolerance is enabled, otherwise `false` | true
| `typo_tolerance.disable_on_attributes` | `true` if at least one value is defined for `disableOnAttributes`, otherwise `false` | false
| `typo_tolerance.disable_on_words` | `true` if at least one value is defined for `disableOnWords`, otherwise `false` | false
| `typo_tolerance.min_word_size_for_typos.one_typo` | The defined value for the `minWordSizeForTypos.oneTypo` parameter | 5
| `typo_tolerance.min_word_size_for_typos.two_typos` | The defined value for the `minWordSizeForTypos.twoTypos` parameter | 9
+| `pagination.max_total_hits` | The defined value for the `pagination.maxTotalHits` property | 1000
+| `faceting.max_values_per_facet` | The defined value for the `faceting.maxValuesPerFacet` property | 100
diff --git a/reference/api/displayed_attributes.md b/reference/api/displayed_attributes.md
index 99f1448be2..728017f460 100644
--- a/reference/api/displayed_attributes.md
+++ b/reference/api/displayed_attributes.md
@@ -38,7 +38,7 @@ List the settings.
## Update displayed attributes
-
+
Update the [displayed attributes](/learn/configuration/settings.md#displayed-attributes) of an index. The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required.
@@ -62,7 +62,7 @@ An array of strings that contains attributes of an index to display.
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "settingsUpdate",
@@ -70,7 +70,7 @@ An array of strings that contains attributes of an index to display.
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
## Reset displayed attributes
@@ -90,7 +90,7 @@ All attributes found in the documents added to the index.
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "settingsUpdate",
@@ -98,4 +98,4 @@ All attributes found in the documents added to the index.
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
diff --git a/reference/api/distinct_attribute.md b/reference/api/distinct_attribute.md
index f321ff31e2..df2c8bf53c 100644
--- a/reference/api/distinct_attribute.md
+++ b/reference/api/distinct_attribute.md
@@ -30,7 +30,7 @@ Get the [distinct attribute](/learn/configuration/settings.md#distinct-attribute
## Update distinct attribute
-
+
Update the [distinct attribute](/learn/configuration/settings.md#distinct-attribute) field of an index. This will re-index all documents in the index. The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required.
@@ -54,7 +54,7 @@ If the field does not exist, no error will be thrown.
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "settingsUpdate",
@@ -62,7 +62,7 @@ If the field does not exist, no error will be thrown.
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
## Reset distinct attribute
@@ -80,7 +80,7 @@ Reset the [distinct attribute](/learn/configuration/settings.md#distinct-attribu
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "settingsUpdate",
@@ -88,4 +88,4 @@ Reset the [distinct attribute](/learn/configuration/settings.md#distinct-attribu
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
diff --git a/reference/api/documents.md b/reference/api/documents.md
index a7123d51b5..4a44098b9c 100644
--- a/reference/api/documents.md
+++ b/reference/api/documents.md
@@ -10,6 +10,14 @@ The `/documents` route allows you to create, manage, and delete documents.
Get one [document](/learn/core_concepts/documents.md) using its unique id. Both the index [`uid`](/learn/core_concepts/indexes.md#index-uid) and [document id](/learn/core_concepts/primary_key.md#document-id) are required.
+You can use the optional `fields` query parameter to specify which document fields Meilisearch should include in the response body. `fields` accepts a case-sensitive list of document fields separated by a comma.
+
+#### Query parameters
+
+| Query Parameter | Description | Default Value |
+| ------------------------ | ------------------------------ | :-----------: |
+| **fields** | Document attributes to show | \* |
+
### Example
@@ -21,7 +29,6 @@ Get one [document](/learn/core_concepts/documents.md) using its unique id. Both
"id": 25684,
"title": "American Ninja 5",
"poster": "https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg",
- "overview": "When a scientists daughter is kidnapped, American Ninja, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the ninja.",
"release_date": "1993-01-01"
}
```
@@ -40,11 +47,11 @@ Documents are ordered by Meilisearch depending on the hash of their id.
#### Query parameters
-| Query Parameter | Description | Default Value |
-| ------------------------ | --------------------------- | :-----------: |
-| **offset** | number of documents to skip | 0 |
-| **limit** | number of documents to take | 20 |
-| **attributesToRetrieve** | document attributes to show | \* |
+| Query Parameter | Description | Default Value |
+| ------------------------ | ------------------------------ | :-----------: |
+| **offset** | Number of documents to skip | 0 |
+| **limit** | Number of documents to return | 20 |
+| **fields** | Document attributes to show | \* |
### Example
@@ -53,24 +60,33 @@ Documents are ordered by Meilisearch depending on the hash of their id.
#### Response: `200 Ok`
```json
-[
- {
- "id": 25684,
- "release_date": "1993-01-01",
- "poster": "https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg",
- "title": "American Ninja 5",
- "overview": "When a scientists daughter is kidnapped, American Ninja, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the ninja."
- },
- {
- "id": 468219,
- "title": "Dead in a Week (Or Your Money Back)",
- "release_date": "2018-09-12",
- "poster": "https://image.tmdb.org/t/p/w1280/f4ANVEuEaGy2oP5M0Y2P1dwxUNn.jpg",
- "overview": "William has failed to kill himself so many times that he outsources his suicide to aging assassin Leslie. But with the contract signed and death assured within a week (or his money back), William suddenly discovers reasons to live... However Leslie is under pressure from his boss to make sure the contract is completed."
- }
-]
+{
+ "results": [
+ {
+ "id": 25684,
+ "release_date": "1993-01-01",
+ "poster": "https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg",
+ "title": "American Ninja 5",
+ "overview": "When a scientists daughter is kidnapped, American Ninja, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the ninja."
+ },
+ {
+ "id": 468219,
+ "title": "Dead in a Week (Or Your Money Back)",
+ "release_date": "2018-09-12",
+ "poster": "https://image.tmdb.org/t/p/w1280/f4ANVEuEaGy2oP5M0Y2P1dwxUNn.jpg",
+ "overview": "William has failed to kill himself so many times that he outsources his suicide to aging assassin Leslie. But with the contract signed and death assured within a week (or his money back), William suddenly discovers reasons to live... However Leslie is under pressure from his boss to make sure the contract is completed."
+ }
+ ],
+ "offset": 0,
+ "limit": 2,
+ "total": 500134
+}
```
+::: note
+The response's `total` value response indicates the total number of documents in the queried index.
+:::
+
## Add or replace documents
@@ -113,15 +129,15 @@ The body is composed of a **JSON array** of documents.
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
- "type": "documentAddition",
+ "type": "documentAdditionOrUpdate",
"enqueuedAt": "2021-08-11T09:25:53.000000Z"
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
## Add or update documents
@@ -168,15 +184,15 @@ The documents are matched because they have the same [primary key](/learn/core_c
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
- "type": "documentAddition",
+ "type": "documentAdditionOrUpdate",
"enqueuedAt": "2021-08-11T09:25:53.000000Z"
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
## Delete all documents
@@ -192,15 +208,15 @@ Delete all documents in the specified index. The index [`uid`](/learn/core_conce
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
- "type": "clearAll",
+ "type": "documentDeletion",
"enqueuedAt": "2021-08-11T09:25:53.000000Z"
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
## Delete one document
@@ -216,7 +232,7 @@ Delete one document based on its unique id. Both the index [`uid`](/learn/core_c
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "documentDeletion",
@@ -224,7 +240,7 @@ Delete one document based on its unique id. Both the index [`uid`](/learn/core_c
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
## Delete documents by batch
@@ -248,7 +264,7 @@ The body must be a **JSON Array** with the unique id's of the documents to delet
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "documentDeletion",
@@ -256,4 +272,4 @@ The body must be a **JSON Array** with the unique id's of the documents to delet
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
diff --git a/reference/api/dump.md b/reference/api/dump.md
index b6258b3a7e..c24242f157 100644
--- a/reference/api/dump.md
+++ b/reference/api/dump.md
@@ -6,19 +6,21 @@ Creating a dump is also referred to as exporting it, whereas launching Meilisear
During a [dump export](/reference/api/dump.md#create-a-dump), all indexes of the current instance are exported—together with their documents and settings—and saved as a single `.dump` file.
-During a dump import, all indexes contained in the indicated `.dump` file are imported along with their associated documents and settings. Any existing index with the same uid as an index in the dump file will be overwritten.
+During a dump import, all indexes contained in the indicated `.dump` file are imported along with their associated documents and settings. Any existing index with the same `uid` as an index in the dump file will be overwritten.
Dump imports must be performed when launching a Meilisearch instance [using the `import-dump` command-line option](/learn/configuration/instance_options.md#import-dump).
+[Learn more about dumps](/learn/advanced/dumps.md).
+
## Create a dump
-Triggers a dump creation process. Once the process is complete, a dump is created in the [dumps directory](/learn/configuration/instance_options.md#dumps-destination). If the dumps directory does not exist yet, it will be created.
+Triggers a dump creation task. Once the process is complete, a dump is created in the [dumps directory](/learn/configuration/instance_options.md#dumps-destination). If the dumps directory does not exist yet, it will be created.
-**Meilisearch only processes one dump at a time.** If you attempt to create a dump while another dump is still processing, Meilisearch will throw a [`dump_already_processing` error](/reference/api/error_codes.md#dump-already-processing).
+Dump tasks take priority over all other tasks in the queue. This means that a newly created dump task will be processed as soon as the current task is finished.
-The task queue will not process any further tasks during dump creation, but you can still add new requests to the queue.
+[Learn more about asynchronous operations](/learn/advanced/asynchronous_operations.md).
### Example
@@ -28,35 +30,12 @@ The task queue will not process any further tasks during dump creation, but you
```json
{
- "uid": "20200929-114144097",
- "status": "in_progress",
- "startedAt": "2020-09-29T11:41:44.392327Z"
+ "taskUid": 1,
+ "indexUid": null,
+ "status": "enqueued",
+ "type": "dumpCreation",
+ "enqueuedAt": "2022-06-21T16:10:29.217688Z"
}
```
-## Get dump status
-
-
-
-Get the status of a dump creation process using the uid returned after calling the [dump creation route](/reference/api/dump.md#create-a-dump). The dump `uid` is required.
-
-The returned status could be:
-
-- `in_progress`: Dump creation is in progress
-- `failed`: An error occurred during dump process, and the task was aborted
-- `done`: Dump creation is finished and was successful
-
-### Example
-
-
-
-#### Response: `200 Ok`
-
-```json
-{
- "uid": "20200929-114144097",
- "status": "done",
- "startedAt": "2020-09-29T11:41:44.392327Z",
- "finishedAt": "2020-09-29T11:41:50.792147Z"
-}
-```
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task)
diff --git a/reference/api/error_codes.md b/reference/api/error_codes.md
index af993fae35..603f721aee 100644
--- a/reference/api/error_codes.md
+++ b/reference/api/error_codes.md
@@ -97,10 +97,6 @@ The Content-Type header does not match the request body payload format or the fo
The Content-Type header was specified, but no request body was sent to the server or the request body is empty.
-### `dump_already_processing`
-
-Dump creation is already in progress. A new dump creation process can be triggered after the current one has been completed.
-
### `dump_not_found`
The requested dump could not be found.
@@ -168,3 +164,27 @@ The requested task does not exist. Please ensure that you are using the correct
### `invalid_typo_tolerance_min_word_size_for_typos`
The `minWordSizeForTypos` object is invalid. The value for both `oneTypo` and `twoTypos` should be between `0` and `255`, and `twoTypos` should be greater or equal to `oneTypo`.
+
+### `immutable_field`
+
+The field you are trying to modify is immutable.
+
+### `api_key_already_exists`
+
+A key with this `uid` already exists.
+
+### `invalid_api_key_uid`
+
+The given `uid` is invalid. The `uid` must follow the [uuid v4](https://www.sohamkamani.com/uuid-versions-explained) format.
+
+### `invalid_api_key_name`
+
+The given `name` is invalid. It should either be a string or `null`.
+
+### `invalid_task_status`
+
+The requested task status is invalid. Please use one of [these four possible values](/learn/advanced/asynchronous_operations.md#task-status).
+
+### `invalid_task_type`
+
+The requested task type is invalid. Please use one of the values defined in our [asynchronous operations guide](/learn/advanced/asynchronous_operations.md#task-api-response).
diff --git a/reference/api/faceting.md b/reference/api/faceting.md
new file mode 100644
index 0000000000..5c8df72aca
--- /dev/null
+++ b/reference/api/faceting.md
@@ -0,0 +1,98 @@
+# Faceting
+
+_Child route of the [settings route](/reference/api/settings.md)._
+
+This route allows you to configure the faceting settings for an index.
+
+Faceting settings can also be updated directly through the [global settings route](/reference/api/settings.md#update-settings) along with the other settings.
+
+To learn more about filtering and faceting, refer to our [dedicated guide](/learn/advanced/filtering_and_faceted_search.md).
+
+::: warning
+Updating the settings means overwriting the default settings of Meilisearch. You can reset to default values using the `DELETE` routes.
+:::
+
+## Get faceting settings
+
+
+
+Get the faceting settings of an index. The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required.
+
+### Example
+
+
+
+#### Response: `200 OK`
+
+```json
+{
+ "maxValuesPerFacet": 100
+}
+```
+
+### Returned fields
+
+#### `maxValuesPerFacet`
+
+Maximum number of facet values returned for each facet.
+
+## Update faceting settings
+
+
+
+Partially update the faceting settings for an index. The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required.
+
+### Body
+
+#### `maxValuesPerFacet`
+
+**Type:** integer
+**Default value:** `100`
+
+Configure the maximum number of facet values returned for each facet. Values are sorted in ascending lexicographical order.
+
+For example, suppose a query's search results contain a total of three values for a `colors` facet: `blue`, `green`, and `red`. If you set `maxValuesPerFacet` to `2`, Meilisearch will only return `blue` and `green` in the response body's `facetDistribution` object.
+
+::: note
+Setting `maxValuesPerFacet` to a high value might negatively impact performance.
+:::
+
+#### Example
+
+
+
+#### Response: `202 Accepted`
+
+```json
+{
+ "taskUid": 1,
+ "indexUid": "books",
+ "status": "enqueued",
+ "type": "settingsUpdate",
+ "enqueuedAt": "2022-04-14T20:56:44.991039Z"
+}
+```
+
+You can use the returned `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
+
+## Reset faceting settings
+
+Reset an index's faceting settings to their default value. The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required.
+
+#### Example
+
+
+
+#### Response: `200 OK`
+
+```json
+{
+ "taskUid": 1,
+ "indexUid": "books",
+ "status": "enqueued",
+ "type": "settingsUpdate",
+ "enqueuedAt": "2022-04-14T20:53:32.863107Z"
+}
+```
+
+You can use the returned `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
diff --git a/reference/api/filterable_attributes.md b/reference/api/filterable_attributes.md
index d91d4ba5bb..c086379114 100644
--- a/reference/api/filterable_attributes.md
+++ b/reference/api/filterable_attributes.md
@@ -34,7 +34,7 @@ List the settings.
## Update filterable attributes
-
+
Update an index's [filterable attributes list](/learn/advanced/filtering_and_faceted_search.md). This will re-index all documents in the index. The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required.
@@ -54,7 +54,7 @@ An array of strings containing the attributes that can be used as filters at que
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "settingsUpdate",
@@ -62,7 +62,7 @@ An array of strings containing the attributes that can be used as filters at que
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
## Reset filterable attributes
@@ -82,7 +82,7 @@ An empty array (`[]`).
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "settingsUpdate",
@@ -90,4 +90,4 @@ An empty array (`[]`).
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
diff --git a/reference/api/indexes.md b/reference/api/indexes.md
index 4b108640d0..3f570fe8db 100644
--- a/reference/api/indexes.md
+++ b/reference/api/indexes.md
@@ -8,7 +8,14 @@ The `/indexes` route allows you to create, manage, and delete your indexes.
-List all [indexes](/learn/core_concepts/indexes.md).
+List all [indexes](/learn/core_concepts/indexes.md). Results can be paginated by using the `offset` and `limit` query parameters.
+
+#### Query parameters
+
+| Query parameter | Description | Default value |
+| ------------------------ | --------------------------- | :-----------: |
+| **offset** | Number of indexes to skip | 0 |
+| **limit** | Number of indexes to return | 20 |
### Example
@@ -17,29 +24,31 @@ List all [indexes](/learn/core_concepts/indexes.md).
#### Response: `200 Ok`
```json
-[
- {
- "uid": "books",
- "name": "books",
- "createdAt": "2022-03-08T10:00:27.377346Z",
- "updatedAt": "2022-03-08T10:00:27.391209Z",
- "primaryKey": "id"
- },
- {
- "uid": "meteorites",
- "name": "meteorites",
- "createdAt": "2022-03-08T10:00:44.518768Z",
- "updatedAt": "2022-03-08T10:00:44.582083Z",
- "primaryKey": "id"
- },
- {
- "uid": "movies",
- "name": "movies",
- "createdAt": "2022-02-10T07:45:15.628261Z",
- "updatedAt": "2022-02-21T15:28:43.496574Z",
- "primaryKey": "id"
- }
-]
+{
+ "results": [
+ {
+ "uid": "books",
+ "createdAt": "2022-03-08T10:00:27.377346Z",
+ "updatedAt": "2022-03-08T10:00:27.391209Z",
+ "primaryKey": "id"
+ },
+ {
+ "uid": "meteorites",
+ "createdAt": "2022-03-08T10:00:44.518768Z",
+ "updatedAt": "2022-03-08T10:00:44.582083Z",
+ "primaryKey": "id"
+ },
+ {
+ "uid": "movies",
+ "createdAt": "2022-02-10T07:45:15.628261Z",
+ "updatedAt": "2022-02-21T15:28:43.496574Z",
+ "primaryKey": "id"
+ }
+ ],
+ "offset": 0,
+ "limit": 3,
+ "total": 5
+}
```
## Get one index
@@ -57,7 +66,6 @@ Get information about an [index](/learn/core_concepts/indexes.md). The index [`u
```json
{
"uid": "movies",
- "name": "movies",
"createdAt": "2022-02-10T07:45:15.628261Z",
"updatedAt": "2022-02-21T15:28:43.496574Z",
"primaryKey": "id"
@@ -100,7 +108,7 @@ Creating an index is an asynchronous task. [You can read more about asynchronous
```json
{
- "uid": 0,
+ "taskUid": 0,
"indexUid": "movies",
"status": "enqueued",
"type": "indexCreation",
@@ -108,11 +116,11 @@ Creating an index is an asynchronous task. [You can read more about asynchronous
}
```
-You can use the response's `uid` to [track the status of your request](/reference/api/tasks.md#get-task).
+You can use the response's `taskUid` to [track the status of your request](/reference/api/tasks.md#get-one-task).
## Update an index
-
+
Update an [index's](/learn/core_concepts/indexes.md) [primary key](/learn/core_concepts/primary_key.md#primary-key). The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required.
@@ -140,7 +148,7 @@ This is an asynchronous task. [You can read more about asynchronous operations i
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "indexUpdate",
@@ -148,7 +156,7 @@ This is an asynchronous task. [You can read more about asynchronous operations i
}
```
-You can use the response's `uid` to [track the status of your request](/reference/api/tasks.md#get-task).
+You can use the response's `taskUid` to [track the status of your request](/reference/api/tasks.md#get-one-task).
## Delete an index
@@ -166,7 +174,7 @@ This is an asynchronous task. [You can read more about asynchronous operations i
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "indexDeletion",
@@ -174,4 +182,4 @@ This is an asynchronous task. [You can read more about asynchronous operations i
}
```
-You can use the response's `uid` to [track the status of your request](/reference/api/tasks.md#get-task).
+You can use the response's `taskUid` to [track the status of your request](/reference/api/tasks.md#get-one-task).
diff --git a/reference/api/keys.md b/reference/api/keys.md
index a6582e1f69..082a3b506b 100644
--- a/reference/api/keys.md
+++ b/reference/api/keys.md
@@ -1,12 +1,6 @@
# Keys
-The `/keys` route allows you to create, manage, and delete API keys. To use these endpoints, you must [set the master key](/learn/configuration/instance_options.md#master-key) and supply it in the header of the request:
-
-```bash
-curl \
- -H 'Authorization: Bearer MASTER_KEY'
- …
-```
+The `/keys` route allows you to create, manage, and delete API keys. To use these endpoints, you must first [set the master key](/learn/configuration/instance_options.md#master-key). Once a master key is set, you can access these endpoints by supplying it in the header of the request, or using API keys that have access to the `keys.get`, `keys.create`, `keys.update`, or `keys.delete` actions.
[Learn more about managing keys and their rights](/learn/security/master_api_keys.md).
@@ -14,10 +8,17 @@ curl \
-List all existing API keys. **Expired keys are included in the response**, but deleted keys are not.
+List the 20 most recently created keys. **Expired keys are included in the response**, but deleted keys are not. Results can be paginated by using the `offset` and `limit` query parameters.
[See below for an explanation of returned fields.](#description)
+#### Query parameters
+
+| Query Parameter | Description | Default Value |
+| ------------------------ | --------------------------| ------------- |
+| **offset** | Number of keys to skip | 0 |
+| **limit** | Number of keys to return | 20 |
+
### Example
@@ -28,8 +29,10 @@ List all existing API keys. **Expired keys are included in the response**, but d
{
"results": [
{
+ "name": null,
"description": "Manage documents: Products/Reviews API key",
"key": "d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4",
+ "uid": "6062abda-a5aa-4414-ac91-ecd7944c0f8d",
"actions": [
"documents.add",
"documents.delete"
@@ -43,8 +46,10 @@ List all existing API keys. **Expired keys are included in the response**, but d
"updatedAt": "2021-10-13T15:00:00Z"
},
{
- "description": "Default Search API Key (Use it to search from the frontend code)",
+ "name": "Default Search API Key",
+ "description": "Use it to search from the frontend code",
"key": "0a6e572506c52ab0bd6195921575d23092b7f0c284ab4ac86d12346c33057f99",
+ "uid": "74c9c733-3368-4738-bbe5-1d18a5fecb37",
"actions": [
"search"
],
@@ -56,8 +61,10 @@ List all existing API keys. **Expired keys are included in the response**, but d
"updatedAt": "2021-08-11T10:00:00Z"
},
{
- "description": "Default Admin API Key (Use it for all other operations. Caution! Do not share it on the client side)",
+ "name": "Default Admin API Key",
+ "description": "Use it for anything that is not a search operation. Caution! Do not expose it on a public frontend",
"key": "380689dd379232519a54d15935750cc7625620a2ea2fc06907cb40ba5b421b6f",
+ "uid": "20f7e4c4-612c-4dd1-b783-7934cc038213",
"actions": [
"*"
],
@@ -68,22 +75,61 @@ List all existing API keys. **Expired keys are included in the response**, but d
"createdAt": "2021-08-11T10:00:00Z",
"updatedAt": "2021-08-11T10:00:00Z"
}
- ]
+ ],
+ "offset":0,
+ "limit":3,
+ "total":7
}
```
+::: note
+API keys are displayed in descending order based on their `createdAt` date. This means that the most recently created keys appear first.
+:::
+
### Returned fields
+Returns API keys in an array called `results`, along with the following fields:
+
+#### `offset`
+
+The number of keys skipped over.
+
+#### `limit`
+
+The maximum number of keys to be returned by the request.
+
+#### `total`
+
+The total number of API keys that can be browsed.
+
+### The `results` array
+
+For each key, it returns:
+
+#### `name`
+
+A human-readable name for the key. Default value is `null`.
+
#### `description`
A description for the key. Default value is `null`.
+#### `uid`
+
+A [uuid v4](https://www.sohamkamani.com/uuid-versions-explained) to identify the API key. If not specified, it is automatically generated by Meilisearch.
+
#### `key`
-An alphanumeric key value generated by Meilisearch on API key creation. Used for authorization when [making calls to a protected Meilisearch instance](/learn/security/master_api_keys.md#communicating-with-a-protected-instance).
+An alphanumeric key value generated by Meilisearch by hashing the `uid` and the master key on API key creation. Used for authorization when [making calls to a protected Meilisearch instance](/learn/security/master_api_keys.md#communicating-with-a-protected-instance).
This value is also used as the `{key}` path variable to [update](#update-a-key), [delete](#delete-a-key), or [get](#get-one-key) a specific key.
+::: note
+Since `key` is a hash of the `uid` and master key, `key` values are deterministic between instances sharing the same configuration. This means if the master key changes, all `key` values are automatically changed.
+
+Since the `key` field depends on the master key, it is computed at runtime and therefore not propagated to dumps and snapshots. As a result, even if a malicious user comes into possession of your dumps or snapshots, they will not have access to your instance's API keys.
+:::
+
#### `actions`
An array of API actions permitted for the key. `["*"]` for all actions.
@@ -108,9 +154,9 @@ Date and time when the key was last updated, represented in RFC 3339 format.
## Get one key
-
+
-Get information on the specified key. Attempting to use this endpoint with a non-existent or deleted key will result in [an error](/reference/api/error_codes.md#api-key-not-found). A valid API [key](/reference/api/keys.md#key) is required.
+Get information on the specified key. Attempting to use this endpoint with a non-existent or deleted key will result in [an error](/reference/api/error_codes.md#api-key-not-found). A valid API [key](/reference/api/keys.md#key) or [uid](/reference/api/keys.md#uid) is required.
### Example
@@ -120,8 +166,10 @@ Get information on the specified key. Attempting to use this endpoint with a non
```json
{
+ "name": null,
"description": "Add documents: Products API key",
"key": "d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4",
+ "uid": "6062abda-a5aa-4414-ac91-ecd7944c0f8d",
"actions": [
"documents.add"
],
@@ -146,6 +194,20 @@ Only the `indexes`, `actions`, and `expiresAt` fields are mandatory.
### Body
+#### `name`
+
+**Type:** string
+**Default value:** `null`
+
+A human-readable name for the key.
+
+#### `uid`
+
+**Type:** string
+**Default value:** none
+
+A [uuid v4](https://www.sohamkamani.com/uuid-versions-explained) to identify the API key. If not specified, it is generated by Meilisearch.
+
#### `description`
**Type:** string
@@ -170,13 +232,16 @@ A list of API actions permitted for the key. `["*"]` for all actions.
| indexes.get | Provides access to the [get one index](/reference/api/indexes.md#get-one-index) and [list all indexes](/reference/api/indexes.md#list-all-indexes) endpoints. **Non-authorized `indexes` will be omitted from the response**. |
| indexes.update | Provides access to the [update index](/reference/api/indexes.md#update-an-index) endpoint. |
| indexes.delete | Provides access to the [delete index](/reference/api/indexes.md#delete-an-index) endpoint. |
-| tasks.get | Provides access to the [get one task](/reference/api/tasks.md#get-task) and [get all tasks](/reference/api/tasks.md#get-all-tasks) endpoints. **Tasks from non-authorized `indexes` will be omitted from the response**. Also provides access to the [get one task by index](/reference/api/tasks.md#get-task-by-index) and [get all tasks by index](/reference/api/tasks.md#get-all-tasks-by-index) endpoints on authorized indexes. |
+| tasks.get | Provides access to the [get one task](/reference/api/tasks.md#get-one-task) and [get tasks](/reference/api/tasks.md#get-tasks) endpoints. **Tasks from non-authorized `indexes` will be omitted from the response**. |
| settings.get | Provides access to the [get settings](/reference/api/settings.md#get-settings) endpoint and equivalents for all subroutes on authorized indexes. |
| settings.update | Provides access to the [update settings](/reference/api/settings.md#update-settings) and [reset settings](/reference/api/settings.md#reset-settings) endpoints and equivalents for all subroutes on authorized indexes. |
| stats.get | Provides access to the [get stats of an index](/reference/api/stats.md#get-stats-of-an-index) endpoint and the [get stats of all indexes](/reference/api/stats.md#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.md#create-a-dump) endpoint. **Not restricted by `indexes`.** |
-| dumps.get | Provides access to the [get dump status](/reference/api/dump.md#get-dump-status) endpoint. **Not restricted by `indexes`.** |
| version | Provides access to the [get Meilisearch version](/reference/api/version.md#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.|
+| keys.update | Provides access to the [update key](#update-a-key) endpoint.|
+| keys.delete | Provides access to the [delete key](#delete-a-key) endpoint.|
#### `indexes`
@@ -202,25 +267,27 @@ Date and time when the key will expire, represented in RFC 3339 format. `null` i
```json
{
- "description": "Add documents: Products API key",
- "key": "d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4",
- "actions": [
- "documents.add"
- ],
- "indexes": [
- "products"
- ],
- "expiresAt": "2021-11-13T00:00:00Z",
- "createdAt": "2021-11-12T10:00:00Z",
- "updatedAt": "2021-11-12T10:00:00Z"
+ "name": null,
+ "description": "Manage documents: Products/Reviews API key",
+ "key": "d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4",
+ "uid": "6062abda-a5aa-4414-ac91-ecd7944c0f8d",
+ "actions": [
+ "documents.add"
+ ],
+ "indexes": [
+ "products"
+ ],
+ "expiresAt": "2021-11-13T00:00:00Z",
+ "createdAt": "2021-11-12T10:00:00Z",
+ "updatedAt": "2021-11-12T10:00:00Z"
}
```
## Update a key
-
+
-Update the description, permissions, or expiration date of an API key. A valid API [key](/reference/api/keys.md#key) is required.
+Update the name and description of an API key. A valid API [key](/reference/api/keys.md#key) or [uid](/reference/api/keys.md#uid) is required.
To learn more about the variables sent in the body of the request, see the [create key](#body) endpoint.
@@ -234,27 +301,29 @@ Updates to keys are **partial**. This means you should provide only the fields y
```json
{
- "description": "Manage documents: Products/Reviews API key",
- "key": "d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4",
- "actions": [
- "documents.add",
- "documents.delete"
- ],
- "indexes": [
- "products",
- "reviews"
- ],
- "expiresAt": "2021-12-31T23:59:59Z",
- "createdAt": "2021-11-12T10:00:00Z",
- "updatedAt": "2021-10-12T15:00:00Z"
+ "name": "Products/Reviews API key",
+ "description": "Manage documents: Products/Reviews API key",
+ "key": "d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4",
+ "uid": "6062abda-a5aa-4414-ac91-ecd7944c0f8d",
+ "actions": [
+ "documents.add",
+ "documents.delete"
+ ],
+ "indexes": [
+ "products",
+ "reviews"
+ ],
+ "expiresAt": "2021-12-31T23:59:59Z",
+ "createdAt": "2021-10-12T00:00:00Z",
+ "updatedAt": "2021-10-13T15:00:00Z"
}
```
## Delete a key
-
+
-Delete the specified API key. A valid API [key](/reference/api/keys.md#key) is required.
+Delete the specified API key. A valid API [key](/reference/api/keys.md#key) or [uid](/reference/api/keys.md#uid) is required.
### Example
diff --git a/reference/api/overview.md b/reference/api/overview.md
index 656d76a7d5..5b1d8b8f69 100644
--- a/reference/api/overview.md
+++ b/reference/api/overview.md
@@ -81,7 +81,7 @@ Meilisearch is an **asynchronous API**. This means that in response to most writ
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "indexUpdate",
@@ -89,6 +89,6 @@ Meilisearch is an **asynchronous API**. This means that in response to most writ
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
See more information about [asynchronous operations](/learn/advanced/asynchronous_operations.md).
diff --git a/reference/api/pagination.md b/reference/api/pagination.md
new file mode 100644
index 0000000000..f720402990
--- /dev/null
+++ b/reference/api/pagination.md
@@ -0,0 +1,98 @@
+# Pagination
+
+_Child route of the [settings route](/reference/api/settings.md)._
+
+This route allows you to configure the pagination settings for an index.
+
+Pagination settings can also be updated directly through the [global settings route](/reference/api/settings.md#update-settings) along with the other settings.
+
+To learn more about paginating search results with Meilisearch, refer to our [dedicated guide](/learn/advanced/pagination.md).
+
+::: warning
+Updating the settings means overwriting the default settings of Meilisearch. You can reset to default values using the `DELETE` routes.
+:::
+
+## Get pagination settings
+
+
+
+Get the pagination settings of an index. The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required.
+
+### Example
+
+
+
+#### Response: `200 OK`
+
+```json
+{
+ "maxTotalHits": 1000
+}
+```
+
+### Returned fields
+
+#### `maxTotalHits`
+
+The maximum number of results Meilisearch can return.
+
+## Update pagination settings
+
+
+
+Partially update the pagination settings for an index. The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required.
+
+### Body
+
+#### `maxTotalHits`
+
+**Type:** integer
+**Default value:** `1000`
+
+An integer indicating the maximum number of search results Meilisearch can return. `maxTotalHits` takes priority over search parameters such as `limit` and `offset`.
+
+For example, if you set `maxTotalHits` to 100, you will not be able to access search results beyond 100 no matter the value configured for `offset`.
+
+::: note
+Setting `maxTotalHits` to a high value might negatively impact performance and expose instance data to malicious scraping.
+:::
+
+#### Example
+
+
+
+#### Response: `200 OK`
+
+```json
+{
+ "taskUid": 1,
+ "indexUid": "books",
+ "status": "enqueued",
+ "type": "settingsUpdate",
+ "enqueuedAt": "2022-04-14T20:56:44.991039Z"
+}
+```
+
+You can use the returned `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
+
+## Reset pagination settings
+
+Reset an index's pagination settings to their default value. The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required.
+
+#### Example
+
+
+
+#### Response: `200 OK`
+
+```json
+{
+ "taskUid": 1,
+ "indexUid": "books",
+ "status": "enqueued",
+ "type": "settingsUpdate",
+ "enqueuedAt": "2022-04-14T20:53:32.863107Z"
+}
+```
+
+You can use the returned `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
diff --git a/reference/api/ranking_rules.md b/reference/api/ranking_rules.md
index ae25f32d4d..030126576a 100644
--- a/reference/api/ranking_rules.md
+++ b/reference/api/ranking_rules.md
@@ -44,7 +44,7 @@ List the settings.
## Update ranking rules
-
+
Update the [ranking rules](/learn/core_concepts/relevancy.md#ranking-rules) of an index. The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required.
@@ -68,7 +68,7 @@ To add your own ranking rule, you have to communicate an attribute followed by a
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "settingsUpdate",
@@ -76,7 +76,7 @@ To add your own ranking rule, you have to communicate an attribute followed by a
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
## Reset ranking rules
@@ -112,7 +112,7 @@ An array that contains the [built-in ranking rules](/learn/core_concepts/relevan
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "settingsUpdate",
@@ -120,4 +120,4 @@ An array that contains the [built-in ranking rules](/learn/core_concepts/relevan
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
diff --git a/reference/api/search.md b/reference/api/search.md
index 241e7a907b..9f5863a79c 100644
--- a/reference/api/search.md
+++ b/reference/api/search.md
@@ -20,7 +20,7 @@ Other than the differences mentioned above, the two routes are strictly equivale
Search for documents matching a specific query in the given index. The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required.
::: note
-This endpoint has a [non-customizable limit of 1000 results](/learn/advanced/known_limitations.md#maximum-number-of-results-per-search). If you want to scrape your database, use the [get documents endpoint](/reference/api/documents.md#get-documents) instead.
+By default, [this endpoint returns a maximum of 1000 results](/learn/advanced/known_limitations.md#maximum-number-of-results-per-search). If you want to scrape your database, use the [get documents endpoint](/reference/api/documents.md#get-documents) instead.
:::
This is the preferred route to perform search when an API key is required, as it allows for [preflight requests](https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request) to be cached. Caching preflight requests **considerably improves search speed**.
@@ -33,7 +33,7 @@ This is the preferred route to perform search when an API key is required, as it
| **[offset](#offset)** | Number of documents to skip | `0` |
| **[limit](#limit)** | Maximum number of documents returned | `20` |
| **[filter](#filter)** | Filter queries by an attribute's value | `null` |
-| **[facetsDistribution](#facets-distribution)** | Display the count of matches per facet | `null` |
+| **[facets](#facets)** | Display the count of matches per facet | `null` |
| **[attributesToRetrieve](#attributes-to-retrieve)** | Attributes to display in the returned documents | `["*"]` |
| **[attributesToCrop](#attributes-to-crop)** | Attributes whose values have to be cropped | `null` |
| **[cropLength](#crop-length)** | Maximum length of cropped value in words | `10` |
@@ -41,7 +41,7 @@ This is the preferred route to perform search when an API key is required, as it
| **[attributesToHighlight](#attributes-to-highlight)** | Highlight matching terms contained in an attribute | `null` |
| **[highlightPreTag](#highlight-tags)** | String inserted at the start of a highlighted term | `""` |
| **[highlightPostTag](#highlight-tags)** | String inserted at the end of a highlighted term | `""` |
-| **[matches](#matches)** | Return matching terms location | `false` |
+| **[showMatchesPosition](#show-matches-position)** | Return matching terms location | `false` |
| **[sort](#sort)** | Sort search results by an attribute's value | `null` |
[Learn more about how to use each search parameter](#search-parameters).
@@ -58,17 +58,15 @@ Query terms enclosed in double quotes are treated as [phrase searches](#query-q)
### Response
-| field | Description | type |
-| -------------------- | ------------------------------ | :--------: |
-| **hits** | Results of the query | `array of objects` |
-| **offset** | Number of documents skipped | `number` |
-| **limit** | Number of documents to take | `number` |
-| **nbHits** | Total number of matches | `number` |
-| **exhaustiveNbHits** | Whether `nbHits` is exhaustive | `boolean` |
-| **facetsDistribution** | **[Distribution of the given facets](#facets-distribution)** | `object`
-| **exhaustiveFacetsCount** | Whether `facetsDistribution` is exhaustive | `boolean`
-| **processingTimeMs** | Processing time of the query | `number` |
-| **query** | Query originating the response | `string` |
+| field | Description | type |
+| ------------------------| ----------------------------------------------- | :----------------: |
+| **hits** | Results of the query | `array of objects` |
+| **offset** | Number of documents skipped | `number` |
+| **limit** | Number of documents to take | `number` |
+| **estimatedTotalHits** | Total number of matches | `number` |
+| **facets** | **[Distribution of the given facets](#facets)** | `object` |
+| **processingTimeMs** | Processing time of the query | `number` |
+| **query** | Query originating the response | `string` |
### Example
@@ -97,8 +95,7 @@ Query terms enclosed in double quotes are treated as [phrase searches](#query-q)
],
"offset": 0,
"limit": 20,
- "nbHits": 976,
- "exhaustiveNbHits": false,
+ "estimatedTotalHits": 976,
"processingTimeMs": 35,
"query": "american "
}
@@ -111,7 +108,7 @@ Query terms enclosed in double quotes are treated as [phrase searches](#query-q)
Search for documents matching a specific query in the given index. The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required.
:::note
-This endpoint has a [non-customizable limit of 1000 results](/learn/advanced/known_limitations.md#maximum-number-of-results-per-search). If you want to scrape your database, you can use the [get documents endpoint](/reference/api/documents.md#get-documents) instead.
+By default, [this endpoint returns a maximum of 1000 results](/learn/advanced/known_limitations.md#maximum-number-of-results-per-search). If you want to scrape your database, use the [get documents endpoint](/reference/api/documents.md#get-documents) instead.
:::
This route should only be used when no API key is required. If an API key is required, use the POST route instead.
@@ -124,7 +121,7 @@ This route should only be used when no API key is required. If an API key is req
| **[offset](#offset)** | Number of documents to skip | `0` |
| **[limit](#limit)** | Maximum number of documents returned | `20` |
| **[filter](#filter)** | Filter queries by an attribute's value | `null` |
-| **[facetsDistribution](#facets-distribution)** | Display the count of matches per facet | `null` |
+| **[facets](#facets)** | Display the count of matches per facet | `null` |
| **[attributesToRetrieve](#attributes-to-retrieve)** | Attributes to display in the returned documents | `["*"]` |
| **[attributesToCrop](#attributes-to-crop)** | Attributes whose values have to be cropped | `null` |
| **[cropLength](#crop-length)** | Maximum length of cropped value in words | `10` |
@@ -132,7 +129,7 @@ This route should only be used when no API key is required. If an API key is req
| **[attributesToHighlight](#attributes-to-highlight)** | Highlight matching terms contained in an attribute | `null` |
| **[highlightPreTag](#highlight-tags)** | String inserted at the start of a highlighted term | `""` |
| **[highlightPostTag](#highlight-tags)** | String inserted at the end of a highlighted term | `""` |
-| **[matches](#matches)** | Return matching terms location | `false` |
+| **[showMatchesPosition](#show-matches-position)** | Return matching terms location | `false` |
| **[sort](#sort)** | Sort search results by an attribute's value | `null` |
[Learn more about how to use each search parameter](#search-parameters).
@@ -147,17 +144,15 @@ Query terms enclosed in double quotes are treated as [phrase searches](#query-q)
### Response
-| field | Description | type |
-| -------------------- | ------------------------------ | :--------: |
-| **hits** | Results of the query | `array of objects` |
-| **offset** | Number of documents skipped | `number` |
-| **limit** | Number of documents to take | `number` |
-| **nbHits** | Total number of matches | `number` |
-| **exhaustiveNbHits** | Whether `nbHits` is exhaustive | `boolean` |
-| **facetsDistribution** | **[Distribution of the given facets](#facets-distribution)** | `object`
-| **exhaustiveFacetsCount** | Whether `facetsDistribution` is exhaustive | `boolean`
-| **processingTimeMs** | Processing time of the query | `number` |
-| **query** | Query originating the response | `string` |
+| field | Description | type |
+| ----------------------- | ----------------------------------------------- | :----------------: |
+| **hits** | Results of the query | `array of objects` |
+| **offset** | Number of documents skipped | `number` |
+| **limit** | Number of documents to take | `number` |
+| **estimatedTotalHits** | Total number of matches | `number` |
+| **facets** | **[Distribution of the given facets](#facets)** | `object` |
+| **processingTimeMs** | Processing time of the query | `number` |
+| **query** | Query originating the response | `string` |
### Example
@@ -186,8 +181,7 @@ Query terms enclosed in double quotes are treated as [phrase searches](#query-q)
],
"offset": 0,
"limit": 20,
- "nbHits": 976,
- "exhaustiveNbHits": false,
+ "estimatedTotalHits": 976,
"processingTimeMs": 35,
"query": "american "
}
@@ -211,7 +205,7 @@ This is not necessary when using the `POST` route or one of our [SDKs](/learn/wh
| **[offset](#offset)** | Number of documents to skip | `0` |
| **[limit](#limit)** | Maximum number of documents returned | `20` |
| **[filter](#filter)** | Filter queries by an attribute's value | `null` |
-| **[facetsDistribution](#facets-distribution)** | Display the count of matches per facet | `null` |
+| **[facets](#facets)** | Display the count of matches per facet | `null` |
| **[attributesToRetrieve](#attributes-to-retrieve)** | Attributes to display in the returned documents | `["*"]` |
| **[attributesToCrop](#attributes-to-crop)** | Attributes whose values have to be cropped | `null` |
| **[cropLength](#crop-length)** | Maximum length of cropped value in words | `10` |
@@ -219,7 +213,7 @@ This is not necessary when using the `POST` route or one of our [SDKs](/learn/wh
| **[attributesToHighlight](#attributes-to-highlight)** | Highlight matching terms contained in an attribute | `null` |
| **[highlightPreTag](#highlight-tags)** | String inserted at the start of a highlighted term | `""` |
| **[highlightPostTag](#highlight-tags)** | String inserted at the end of a highlighted term | `""` |
-| **[matches](#matches)** | Return matching terms location | `false` |
+| **[showMatchesPosition](#show-matches-position)** | Return matching terms location | `false` |
| **[sort](#sort)** | Sort search results by an attribute's value | `null` |
### Query (q)
@@ -366,53 +360,39 @@ _geoRadius(lat, lng, distance_in_meters)
-### Facets distribution
+### Facets
-**Parameter**: `facetsDistribution`
+**Parameter**: `facets`
**Expected value**: an array of `attribute`s or `["*"]`
**Default value**: `null`
-Returns the number of documents matching the current search query for each given facet.
+Returns the number of documents matching the current search query for each given facet. When `facets` is set, the search results object contains the `facetDistribution` field that shows the number of remaining candidates for each specified facet.
This parameter can take two values:
-- An array of attributes: `facetsDistribution=["attributeA", "attributeB", …]`
+- An array of attributes: `facets=["attributeA", "attributeB", …]`
- An asterisk—this will return a count for all facets present in `filterableAttributes`
::: note
-If an attribute used on `facetsDistribution` has not been added to the `filterableAttributes` list, it will be ignored.
+If an attribute used on `facets` has not been added to the `filterableAttributes` list, it will be ignored.
:::
-#### Returned fields
-
-When `facetsDistribution` is set, the search results object contains **two additional fields**:
-
-- `facetsDistribution`: The number of remaining candidates for each specified facet
-- `exhaustiveFacetsCount`: A `true` or `false` value indicating whether the count is exact (`true`) or approximate (`false`)
-
-`exhaustiveFacetsCount` is `false` when the search matches contain too many different values for the given `facetName`s. In this case, Meilisearch stops the distribution count to prevent slowing down the request.
-
-::: warning
-`exhaustiveFacetsCount` is not currently implemented and will always return `false`.
-:::
-
-[Learn more about facet distribution in the filtering and faceted search guide.](/learn/advanced/filtering_and_faceted_search.md#facets-distribution)
+[Learn more about facet distribution in the filtering and faceted search guide.](/learn/advanced/filtering_and_faceted_search.md#using-facets)
#### Example
Given a movie database, suppose that you want to know the number of `Batman` movies per genre:
-
+
You would get the following response:
```json
{
…
- "nbHits": 1684,
+ "estimatedTotalHits": 1684,
"query": "Batman",
- "exhaustiveFacetsCount": false,
- "facetsDistribution": {
+ "facetDistribution": {
"genres": {
"action": 273,
"animation": 118,
@@ -460,7 +440,17 @@ Optionally, you can indicate a custom crop length for any attributes given to `a
Instead of supplying individual attributes, you can provide `["*"]` as a wildcard: `attributesToCrop=["*"]`. This causes `_formatted` to include the cropped values of all attributes present in [`attributesToRetrieve`](#attributes-to-retrieve).
-**Meilisearch crops around the first occurrence of any one of the terms present in the search query.** If Meilisearch does not find any query terms in a field, cropping begins at the first word in that field.
+#### Cropping algorithm
+
+Suppose you have a field containing the following string: `Donatello is a skilled and smart turtle. Leonardo is the most skilled turtle. Raphael is the strongest turtle.`
+
+Meilisearch tries to respect sentence boundaries when cropping. For example, if your search term is `Leonardo` and your `cropLength` is 6, Meilisearch will prioritize keeping the sentence together and return: `Leonardo is the most skilled turtle.`
+
+If a query contains only a single search term, Meilisearch crops around the first occurrence of that term. If you search for `turtle` and your `cropLength` is 7, Meilisearch will return the first instance of that word: `Donatello is a skilled and smart turtle.`
+
+If a query contains multiple search terms, Meilisearch centers the crop around the largest number of unique matches, giving priority to terms that are closer to each other and follow the original query order. If you search for `skilled turtle` with a `cropLength` of 6, Meilisearch will return `Leonardo is the most skilled turtle`.
+
+If Meilisearch does not find any query terms in a field, cropping begins at the first word in that field. If you search for `Michelangelo` with a `cropLength` of 4 and this string is present in another field, Meilisearch will return `Donatello is a skilled …`.
#### Example
@@ -530,7 +520,7 @@ When searching for `shifu`, you can use `cropMarker` to change the default `…`
"id": 50393,
"title": "Kung Fu Panda Holiday",
"poster": "https://image.tmdb.org/t/p/w1280/gp18R42TbSUlw9VnXFqyecm52lq.jpg",
- "overview": "[…]villager. But this year Shifu informs Po that as Dragon[…]",
+ "overview": "[…]But this year Shifu informs Po that as Dragon Warrior,[…]",
"release_date": 1290729600
}
}
@@ -620,13 +610,13 @@ You can find the highlighted query terms inside the `_formatted` property:
Though it is not necessary to use `highlightPreTag` and `highlightPostTag` in conjunction, be careful to ensure tags are correctly matched. In the above example, not setting `highlightPostTag` would result in malformed HTML: `Winter Feast`.
:::
-### Matches
+### Show matches position
-**Parameter**: `matches`
+**Parameter**: `showMatchesPosition`
**Expected value**: `true` or `false`
**Default value**: `false`
-Adds a `_matchesInfo` object to the search response that contains the location of each occurrence of queried terms across all fields. This is useful when you need more control than offered by our [built-in highlighting](#attributes-to-highlight). `matches` only works for strings, numbers, and arrays of strings and numbers.
+Adds a `_matchesPosition` object to the search response that contains the location of each occurrence of queried terms across all fields. This is useful when you need more control than offered by our [built-in highlighting](#attributes-to-highlight). `showMatchesPosition` only works for strings, numbers, and arrays of strings and numbers.
The beginning of a matching term within a field is indicated by `start`, and its length by `length`.
@@ -636,11 +626,11 @@ The beginning of a matching term within a field is indicated by `start`, and its
#### Example
-If you set `matches` to `true` and search for `winter feast`:
+If you set `showMatchesPosition` to `true` and search for `winter feast`:
-
+
-You would get the following response with **information about the matches in the `_matchesInfo` object**. Note how Meilisearch searches for `winter` and `feast` separately because of the whitespace:
+You would get the following response with **information about the matches in the `_matchesPosition` object**. Note how Meilisearch searches for `winter` and `feast` separately because of the whitespace:
```json
{
@@ -649,7 +639,7 @@ You would get the following response with **information about the matches in the
"poster": "https://image.tmdb.org/t/p/w500/rV77WxY35LuYLOuQvBeD1nyWMuI.jpg",
"overview": "The Winter Feast is Po's favorite holiday. Every year he and his father hang decorations, cook together, and serve noodle soup to the villagers. But this year Shifu informs Po that as Dragon Warrior, it is his duty to host the formal Winter Feast at the Jade Palace. Po is caught between his obligations as the Dragon Warrior and his family traditions: between Shifu and Mr. Ping.",
"release_date": 1290729600,
- "_matchesInfo": {
+ "_matchesPosition": {
"overview": [
{
"start": 4,
diff --git a/reference/api/searchable_attributes.md b/reference/api/searchable_attributes.md
index 47e82d0d02..63a76b36c5 100644
--- a/reference/api/searchable_attributes.md
+++ b/reference/api/searchable_attributes.md
@@ -37,7 +37,7 @@ List the settings.
## Update searchable attributes
-
+
Update the [searchable attributes](/learn/configuration/displayed_searchable_attributes.md#searchable-fields) of an index. This will re-index all documents in the index. The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required.
@@ -65,7 +65,7 @@ A match in title will make a document more relevant than another document with a
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "settingsUpdate",
@@ -73,7 +73,7 @@ A match in title will make a document more relevant than another document with a
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
## Reset searchable attributes
@@ -93,7 +93,7 @@ All attributes found in the documents added to the index.
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "settingsUpdate",
@@ -101,4 +101,4 @@ All attributes found in the documents added to the index.
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
diff --git a/reference/api/settings.md b/reference/api/settings.md
index 2d22e9b45b..8a6e90f133 100644
--- a/reference/api/settings.md
+++ b/reference/api/settings.md
@@ -6,7 +6,9 @@ These are the reference pages for the child routes:
- [Displayed attributes](/reference/api/displayed_attributes.md)
- [Distinct attribute](/reference/api/distinct_attribute.md)
+- [Faceting](/reference/api/faceting.md)
- [Filterable attributes](/reference/api/filterable_attributes.md)
+- [Pagination](/reference/api/pagination.md)
- [Ranking rules](/reference/api/ranking_rules.md)
- [Searchable attributes](/reference/api/searchable_attributes.md)
- [Sortable attributes](/reference/api/sortable_attributes.md)
@@ -30,17 +32,19 @@ Get the settings of an index. The index [`uid`](/learn/core_concepts/indexes.md#
### Response body
-| Variable | Type | Description | Default value |
-| ------------------------ | --------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
-| **displayedAttributes** | [Strings] | Fields displayed in the returned documents | `["*"]` (all attributes) |
-| **distinctAttribute** | String | Search returns documents with distinct (different) values of the given field | `null` |
-| **filterableAttributes** | [Strings] | Attributes to use as [filters and facets](/learn/advanced/filtering_and_faceted_search.md) | `[]` |
-| **rankingRules** | [Strings] | List of ranking rules sorted by order of importance | [A list of ordered built-in ranking rules](/learn/core_concepts/relevancy.md#built-in-rules) |
-| **searchableAttributes** | [Strings] | Fields in which to search for matching query words sorted by order of importance | `["*"]` (all attributes) |
-| **sortableAttributes** | [Strings] | Attributes to use when [sorting](/learn/advanced/sorting.md) search results | `[]` |
-| **stopWords** | [Strings] | List of words ignored by Meilisearch when present in search queries | `[]` |
-| **synonyms** | Object | List of associated words treated similarly | `{}` |
-| **typoTolerance** | Object | Typo tolerance settings | `{}` |
+| Variable | Type | Description | Default value |
+| ------------------------ | --------- | ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------- |
+| **displayedAttributes** | [Strings] | Fields displayed in the returned documents | `["*"]` (all attributes) |
+| **distinctAttribute** | String | Search returns documents with distinct (different) values of the given field | `null` |
+| **faceting** | Object | Faceting settings | `{}` |
+| **filterableAttributes** | [Strings] | Attributes to use as [filters and facets](/learn/advanced/filtering_and_faceted_search.md) | `[]` |
+| **pagination** | Object | Pagination settings | `{}` |
+| **rankingRules** | [Strings] | List of ranking rules sorted by order of importance | [A list of ordered built-in ranking rules](/learn/core_concepts/relevancy.md#built-in-rules) |
+| **searchableAttributes** | [Strings] | Fields in which to search for matching query words sorted by order of importance | `["*"]` (all attributes) |
+| **sortableAttributes** | [Strings] | Attributes to use when [sorting](/learn/advanced/sorting.md) search results | `[]` |
+| **stopWords** | [Strings] | List of words ignored by Meilisearch when present in search queries | `[]` |
+| **synonyms** | Object | List of associated words treated similarly | `{}` |
+| **typoTolerance** | Object | Typo tolerance settings | `{}` |
[Learn more about the settings in this guide.](/learn/configuration/settings.md)
@@ -92,18 +96,24 @@ List the settings.
"typoTolerance": {
"enabled": true,
"minWordSizeForTypos": {
- "oneTypo": 5,
- "twoTypos": 10
+ "oneTypo": 5,
+ "twoTypos": 10
},
- "disableOnWords": [],
- "disableOnAttributes": []
- }
+ "disableOnWords": [],
+ "disableOnAttributes": []
+ },
+ "pagination": {
+ "maxTotalHits": 1000
+ },
+ "faceting": {
+ "maxValuesPerFacet": 100
+ }
}
```
## Update settings
-
+
Update the settings of an index. The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required.
@@ -117,17 +127,19 @@ If the provided index does not exist, it will be created.
### Body
-| Variable | Type | Description | Default value |
-| ------------------------ | --------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
-| **displayedAttributes** | [Strings] | Fields displayed in the returned documents | `["*"]` (all attributes) |
-| **distinctAttribute** | String | Search returns documents with distinct (different) values of the given field | `null` |
-| **filterableAttributes** | [Strings] | Attributes to use as [filters and facets](/learn/advanced/filtering_and_faceted_search.md) | `[]` |
-| **rankingRules** | [Strings] | List of ranking rules sorted by order of importance | [A list of ordered built-in ranking rules](/learn/core_concepts/relevancy.md#built-in-rules) |
-| **searchableAttributes** | [Strings] | Fields in which to search for matching query words sorted by order of importance | `["*"]` (all attributes) |
-| **sortableAttributes** | [Strings] | Attributes to use when [sorting](/learn/advanced/sorting.md) search results | `[]` |
-| **stopWords** | [Strings] | List of words ignored by Meilisearch when present in search queries | `[]` |
-| **synonyms** | Object | List of associated words treated similarly | `{}` |
-| **typoTolerance** | Object | Typo tolerance settings | `{}` |
+| Variable | Type | Description | Default value |
+| ------------------------ | --------- | ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------- |
+| **displayedAttributes** | [Strings] | Fields displayed in the returned documents | `["*"]` (all attributes) |
+| **distinctAttribute** | String | Search returns documents with distinct (different) values of the given field | `null` |
+| **faceting** | Object | Faceting settings | `{}` |
+| **filterableAttributes** | [Strings] | Attributes to use as [filters and facets](/learn/advanced/filtering_and_faceted_search.md) | `[]` |
+| **pagination** | Object | Pagination settings | `{}` |
+| **rankingRules** | [Strings] | List of ranking rules sorted by order of importance | [A list of ordered built-in ranking rules](/learn/core_concepts/relevancy.md#built-in-rules) |
+| **searchableAttributes** | [Strings] | Fields in which to search for matching query words sorted by order of importance | `["*"]` (all attributes) |
+| **sortableAttributes** | [Strings] | Attributes to use when [sorting](/learn/advanced/sorting.md) search results | `[]` |
+| **stopWords** | [Strings] | List of words ignored by Meilisearch when present in search queries | `[]` |
+| **synonyms** | Object | List of associated words treated similarly | `{}` |
+| **typoTolerance** | Object | Typo tolerance settings | `{}` |
### Example
@@ -137,7 +149,7 @@ If the provided index does not exist, it will be created.
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "settingsUpdate",
@@ -145,7 +157,7 @@ If the provided index does not exist, it will be created.
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
## Reset settings
@@ -155,17 +167,19 @@ Reset the settings of an index. The index [`uid`](/learn/core_concepts/indexes.m
All settings will be reset to their default value.
-| Variable | Type | Description | Default value |
-| ------------------------ | --------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
-| **displayedAttributes** | [Strings] | Fields displayed in the returned documents | `["*"]` (all attributes) |
-| **distinctAttribute** | String | Search returns documents with distinct (different) values of the given field | `null` |
-| **filterableAttributes** | [Strings] | Attributes to use as [filters and facets](/learn/advanced/filtering_and_faceted_search.md) | `[]` |
-| **rankingRules** | [Strings] | List of ranking rules sorted by order of importance | [A list of ordered built-in ranking rules](/learn/core_concepts/relevancy.md#built-in-rules) |
-| **searchableAttributes** | [Strings] | Fields in which to search for matching query words sorted by order of importance | `["*"]` (all attributes) |
-| **sortableAttributes** | [Strings] | Attributes to use when [sorting](/learn/advanced/sorting.md) search results | `[]` |
-| **stopWords** | [Strings] | List of words ignored by Meilisearch when present in search queries | `[]` |
-| **synonyms** | Object | List of associated words treated similarly | `{}` |
-| **typoTolerance** | Object | Typo tolerance settings | `{}` |
+| Variable | Type | Description | Default value |
+| ------------------------ | --------- | ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------- |
+| **displayedAttributes** | [Strings] | Fields displayed in the returned documents | `["*"]` (all attributes) |
+| **distinctAttribute** | String | Search returns documents with distinct (different) values of the given field | `null` |
+| **faceting** | Object | Faceting settings | `{}` |
+| **filterableAttributes** | [Strings] | Attributes to use as [filters and facets](/learn/advanced/filtering_and_faceted_search.md) | `[]` |
+| **pagination** | Object | Pagination settings | `{}` |
+| **rankingRules** | [Strings] | List of ranking rules sorted by order of importance | [A list of ordered built-in ranking rules](/learn/core_concepts/relevancy.md#built-in-rules) |
+| **searchableAttributes** | [Strings] | Fields in which to search for matching query words sorted by order of importance | `["*"]` (all attributes) |
+| **sortableAttributes** | [Strings] | Attributes to use when [sorting](/learn/advanced/sorting.md) search results | `[]` |
+| **stopWords** | [Strings] | List of words ignored by Meilisearch when present in search queries | `[]` |
+| **synonyms** | Object | List of associated words treated similarly | `{}` |
+| **typoTolerance** | Object | Typo tolerance settings | `{}` |
[Learn more about the settings](/learn/configuration/settings.md).
#### Example
@@ -176,7 +190,7 @@ All settings will be reset to their default value.
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "settingsUpdate",
@@ -184,4 +198,4 @@ All settings will be reset to their default value.
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
diff --git a/reference/api/sortable_attributes.md b/reference/api/sortable_attributes.md
index 3c36dc3ddc..5b178bf537 100644
--- a/reference/api/sortable_attributes.md
+++ b/reference/api/sortable_attributes.md
@@ -33,7 +33,7 @@ List the settings.
## Update sortable attributes
-
+
Update an index's sortable attributes list. This will re-index all documents in the index. This will re-index all documents in the index. The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required.
@@ -55,7 +55,7 @@ An array of strings containing the attributes that can be used to sort search re
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "settingsUpdate",
@@ -63,7 +63,7 @@ An array of strings containing the attributes that can be used to sort search re
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
## Reset sortable attributes
@@ -83,7 +83,7 @@ An empty array (`[]`).
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "settingsUpdate",
@@ -91,4 +91,4 @@ An empty array (`[]`).
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
diff --git a/reference/api/stop_words.md b/reference/api/stop_words.md
index d5bcd1b5f2..c3a7da27f5 100644
--- a/reference/api/stop_words.md
+++ b/reference/api/stop_words.md
@@ -38,7 +38,7 @@ Get the stop-words list of an index. The index [`uid`](/learn/core_concepts/inde
## Update stop-words
-
+
Update the list of stop-words of an index. This will re-index all documents in the index. The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required.
@@ -58,7 +58,7 @@ If a list of stop-words already exists it will be overwritten (_replaced_).
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "settingsUpdate",
@@ -66,7 +66,7 @@ If a list of stop-words already exists it will be overwritten (_replaced_).
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
## Reset stop-words
@@ -86,7 +86,7 @@ Empty array: `[]`
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "settingsUpdate",
@@ -94,4 +94,4 @@ Empty array: `[]`
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
diff --git a/reference/api/synonyms.md b/reference/api/synonyms.md
index f5cfb91136..a548fe5285 100644
--- a/reference/api/synonyms.md
+++ b/reference/api/synonyms.md
@@ -42,7 +42,7 @@ Get the list of [synonyms](/learn/configuration/synonyms.md) of an index. The in
## Update synonyms
-
+
Update the list of [synonyms](/learn/configuration/synonyms.md) of an index. Synonyms are [normalized](/learn/configuration/synonyms.md#normalization). The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required.
@@ -60,7 +60,7 @@ An object that contains all synonyms and their associated words.
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "settingsUpdate",
@@ -68,7 +68,7 @@ An object that contains all synonyms and their associated words.
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
## Reset synonyms
@@ -88,7 +88,7 @@ Empty object : `{}`
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "settingsUpdate",
@@ -96,4 +96,4 @@ Empty object : `{}`
}
```
-You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
diff --git a/reference/api/tasks.md b/reference/api/tasks.md
index 71a550b649..eb1ebc1d1a 100644
--- a/reference/api/tasks.md
+++ b/reference/api/tasks.md
@@ -6,12 +6,26 @@ The `/tasks` route gives information about the progress of [asynchronous operati
The task `uid` is incremented **globally.**
:::
-## Get all tasks
+## Get tasks
List all tasks globally, regardless of index. The `task` objects are contained in the `results` array.
+Tasks are always returned in descending order of `uid`. This means that by default, **the most recently created `task` objects appear first**.
+
+Task results are [paginated](#paginating-tasks) and can be [filtered](#filtering-tasks).
+
+#### Query parameters
+
+| Query Parameter | Description | Default Value |
+|-----------------|----------------------------------------------------------------------|:------------------------------:|
+| **limit** | number of tasks to return | 20 |
+| **from** | `uid` of the first task returned | `uid` of the last created task |
+| **status** | [filter tasks](#filtering-tasks) by their `status` | all statuses |
+| **type** | [filter tasks](#filtering-tasks) by their `type` | all types |
+| **indexUid** | [filter tasks](#filtering-tasks) by their `indexUid`. Case-sensitive | all indexes |
+
### Example
@@ -25,7 +39,7 @@ List all tasks globally, regardless of index. The `task` objects are contained i
"uid": 1,
"indexUid": "movies_reviews",
"status": "enqueued",
- "type": "documentAddition",
+ "type": "documentAdditionOrUpdate",
"duration": null,
"enqueuedAt": "2021-08-12T10:00:00.000000Z",
"startedAt": null,
@@ -35,7 +49,7 @@ List all tasks globally, regardless of index. The `task` objects are contained i
"uid": 0,
"indexUid": "movies",
"status": "succeeded",
- "type": "documentAddition",
+ "type": "documentAdditionOrUpdate",
"details": {
"receivedDocuments": 100,
"indexedDocuments": 100
@@ -49,99 +63,85 @@ List all tasks globally, regardless of index. The `task` objects are contained i
}
```
-:::note
-Tasks are displayed in descending order by `uid`. This means that **the most recently created `task` objects appear first**.
-:::
+### Filtering tasks
-## Get task
+You can filter the task list by the value of the `status`, `type`, or `indexUid` fields. For example, the following command returns all tasks belonging to the index `movies`. Note that the `indexUid` is case-sensitive:
-
+
-Get a single [task](/learn/advanced/asynchronous_operations.md). The task `uid` is required.
+Use the ampersand character `&` to combine filters, equivalent to a logical `AND`. Use the comma character `,` to add multiple filter values for a single field.
-### Example
+For example, the following command would return all `documentAdditionOrUpdate` tasks that either `succeeded` or `failed`:
-
-
-#### Response: `200 Ok`
+
-Here is an example response representing [a processed task](/learn/advanced/asynchronous_operations.md#understanding-tasks).
+At this time, `OR` operations between different filters are not supported. For example, you cannot view only tasks which have a type of `documentAddition` **or** a status of `failed`.
-```json
-{
- "uid": 1,
- "indexUid": "movies",
- "status": "succeeded",
- "type": "settingsUpdate",
- "details": {
- "rankingRules": [
- "typo",
- "ranking:desc",
- "words",
- "proximity",
- "attribute",
- "exactness"
- ]
- },
- "duration": "PT1S",
- "enqueuedAt": "2021-08-10T14:29:17.000000Z",
- "startedAt": "2021-08-10T14:29:18.000000Z",
- "finishedAt": "2021-08-10T14:29:19.000000Z"
-}
-```
+[Read more about the possible values of these fields in our asynchronous operations guide.](/learn/advanced/asynchronous_operations.md)
-## Get all tasks by index
+### Paginating tasks
-
+The task list is paginated, by default returning 20 tasks at a time. You can adjust the number of documents returned using the `limit` parameter, and control where the list begins using the `from` parameter.
-List all [tasks](/learn/advanced/asynchronous_operations.md) for a given [index](/learn/core_concepts/indexes.md). The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required.
+For each call to this endpoint, the response will include the `next` field: this value should be passed to `from` to view the next "page" of results. When the value of `next` is `null`, there are no more tasks to view.
-### Example
+This command returns tasks two at a time starting from task `uid` `10`.
-
+
-#### Response: `200 Ok`
+**Response:**
```json
{
- "results": [
- {
- "uid": 1,
- "indexUid": "movies",
- "status": "enqueued",
- "type": "documentAddition",
- "duration": null,
- "enqueuedAt": "2021-08-12T10:00:00.000000Z",
- "startedAt": null,
- "finishedAt": null
- },
- {
- "uid": 0,
- "indexUid": "movies",
- "status": "succeeded",
- "type": "documentAddition",
- "details": {
- "receivedDocuments": 100,
- "indexedDocuments": 100
- },
- "duration": "PT16S",
- "enqueuedAt": "2021-08-11T09:25:53.000000Z",
- "startedAt": "2021-08-11T10:03:00.000000Z",
- "finishedAt": "2021-08-11T10:03:16.000000Z"
- }
- ]
+ "results": [
+ {
+ "uid": 10,
+ "indexUid": "elements",
+ "status": "succeeded",
+ "type": "indexCreation",
+ "details": {
+ "primaryKey": null
+ },
+ "duration": "PT0.006034S",
+ "enqueuedAt": "2022-06-20T13:41:42.446908Z",
+ "startedAt": "2022-06-20T13:41:42.447477Z",
+ "finishedAt": "2022-06-20T13:41:42.453511Z"
+ },
+ {
+ "uid": 9,
+ "indexUid": "particles",
+ "status": "succeeded",
+ "type": "indexCreation",
+ "details": {
+ "primaryKey": null
+ },
+ "duration": "PT0.007317S",
+ "enqueuedAt": "2022-06-20T13:41:31.841575Z",
+ "startedAt": "2022-06-20T13:41:31.842116Z",
+ "finishedAt": "2022-06-20T13:41:31.849433Z"
+ }
+ ],
+ "limit": 2,
+ "from": 10,
+ "next": 8
}
```
-## Get task by index
+To view the next page of results, you would repeat the same query, replacing the value of `from` with the value of `next`:
+
+
+
+When the returned value of `next` is `null`, you have reached the final page of results.
-
+## Get one task
-Get a single [task](/learn/advanced/asynchronous_operations.md) in a given [index](/learn/core_concepts/indexes.md). Both the index [`uid`](/learn/core_concepts/indexes.md#index-uid) and task [`uid`](/learn/advanced/asynchronous_operations.md#response) are required.
+
+
+Get a single [task](/learn/advanced/asynchronous_operations.md). The task `uid` is required.
### Example
-
+
#### Response: `200 Ok`
diff --git a/reference/api/typo_tolerance.md b/reference/api/typo_tolerance.md
index 4c686f6f84..b26f31f142 100644
--- a/reference/api/typo_tolerance.md
+++ b/reference/api/typo_tolerance.md
@@ -61,7 +61,7 @@ An array of attributes for which the typo tolerance feature is disabled.
## Update typo tolerance
-
+
Partially update the typo tolerance settings for an index. The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required.
@@ -107,7 +107,7 @@ An array of attributes for which the typo tolerance feature is disabled.
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "books",
"status": "enqueued",
"type": "settingsUpdate",
@@ -115,7 +115,7 @@ An array of attributes for which the typo tolerance feature is disabled.
}
```
-You can use the returned `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use the returned `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
## Reset typo tolerance
@@ -129,7 +129,7 @@ Reset an index's typo tolerance settings to their default value. The index [`uid
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "books",
"status": "enqueued",
"type": "settingsUpdate",
@@ -137,4 +137,4 @@ Reset an index's typo tolerance settings to their default value. The index [`uid
}
```
-You can use the returned `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+You can use the returned `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
diff --git a/resources/faq.md b/resources/faq.md
index dd22872afe..f683947224 100644
--- a/resources/faq.md
+++ b/resources/faq.md
@@ -51,19 +51,19 @@ More datasets and setting configurations are available [in this repository](http
## I did a call to an API route and got an object as a response. What does it mean?
-All asynchronous operations return a summarized version of the [`task` object](/learn/advanced/asynchronous_operations.md#response).
+All asynchronous operations return a [summarized version of the `task` object](/learn/advanced/asynchronous_operations.md#summarized-task-objects).
```json
{
- "uid": 1,
+ "taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
- "type": "documentAddition",
+ "type": "documentAdditionOrUpdate",
"enqueuedAt": "2021-08-11T09:25:53.000000Z"
}
```
-This response indicates that the operation has been taken into account and will be processed once it reaches the front of the queue. You can use this `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task).
+This response indicates that the operation has been taken into account and will be processed once it reaches the front of the queue. You can use this `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-one-task).
## I am trying to add my documents but I keep receiving a `400 - Bad Request` response.
@@ -151,7 +151,7 @@ See more [information about the primary key](/learn/core_concepts/primary_key.md
## I have uploaded my documents, but I get no result when I search in my index.
-Your document upload probably failed. To understand why, please check the status of the document addition task using the `uid`. If the task failed, the response should contain an `error` object.
+Your document upload probably failed. To understand why, please check the status of the document addition task using the returned `taskUid`. If the task failed, the response should contain an `error` object.
Here is an example of a failed task:
@@ -160,7 +160,7 @@ Here is an example of a failed task:
"uid": 1,
"indexUid": "movies",
"status": "failed",
- "type": "documentAddition",
+ "type": "documentAdditionOrUpdate",
"details": {
"receivedDocuments": 67493,
"indexedDocuments": 0