Skip to content

Commit 16b334d

Browse files
bors[bot]guimachiavellimaryamsulemani97
authored
Merge #1766
1766: v0.28: Add pagination to core concepts/indexes r=guimachiavelli a=maryamsulemani97 Adds the pagination index setting to: -`learn/core_concepts/indexes.md` -`learn/configuration/settings.md` Co-authored-by: gui machiavelli <[email protected]> Co-authored-by: Maryam Sulemani <[email protected]> Co-authored-by: Maryam <[email protected]> Co-authored-by: gui machiavelli <[email protected]>
2 parents f48fe20 + 24a46eb commit 16b334d

File tree

5 files changed

+32
-0
lines changed

5 files changed

+32
-0
lines changed

.code-samples.meilisearch.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,13 @@ getting_started_typo_tolerance: |-
961961
--data-binary '{
962962
"minWordSizeForTypos": { "oneTypo": 4 }
963963
}'
964+
settings_guide_pagination_1: |-
965+
curl \
966+
-X PATCH 'http://localhost:7700/indexes/movies/settings/pagination' \
967+
-H 'Content-Type: application/json' \
968+
--data-binary '{
969+
"maxTotalHits": 50
970+
}'
964971
get_pagination_settings_1: |-
965972
curl \
966973
-X GET 'http://localhost:7700/indexes/books/settings/pagination'

.vuepress/public/sample-template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ updating_guide_retrieve_documents_old: |-
146146
updating_guide_update_settings_old: |-
147147
updating_guide_add_documents_old: |-
148148
getting_started_typo_tolerance: |-
149+
settings_guide_pagination_1: |-
149150
get_pagination_settings_1: |-
150151
update_pagination_settings_1: |-
151152
reset_pagination_settings_1: |-

learn/advanced/pagination.md

Whitespace-only changes.

learn/configuration/settings.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This page describes the **index-level settings** available in Meilisearch and ho
77
| **[displayedAttributes](/learn/configuration/settings.md#displayed-attributes)** | Fields displayed in the returned documents | All attributes found in the documents |
88
| **[distinctAttribute](/learn/configuration/settings.md#distinct-attribute)** | Search returns documents with distinct (different) values of the given field | `null` |
99
| **[filterableAttributes](/learn/configuration/settings.md#filterable-attributes)** | List of attributes that can be used for filtering | `null` |
10+
| **[pagination](/learn/advanced/pagination.md)** | Pagination settings | `{}`
1011
| **[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) |
1112
| **[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 | |
1213
| **[sortableAttributes](/learn/configuration/settings.md#sortable-attributes)** | List of attributes to use when sorting search results | `[]` |
@@ -95,6 +96,22 @@ To be able to filter search results on `director` and `genres` in a movie databa
9596

9697
<CodeSamples id="faceted_search_update_settings_1" />
9798

99+
## Pagination
100+
101+
The maximum number of results Meilisearch can return. By default, this value is `1000` which means you cannot access results beyond `1000`.
102+
103+
[Learn more about pagination in our dedicated guide.](/learn/advanced/pagination.md)
104+
105+
### Example
106+
107+
The code sample below updates `maxTotalHits` to `50`:
108+
109+
<CodeSamples id="settings_guide_pagination_1" />
110+
111+
::: note
112+
`maxTotalHits` takes priority over search parameters such as [`limit`](/reference/api/search.md#limit) and [`offset`](/reference/api/search.md#offset).
113+
:::
114+
98115
## Ranking rules
99116

100117
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.

learn/core_concepts/indexes.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ You can customize the following index settings:
5959
- [Stop words](#stop-words)
6060
- [Displayed and searchable attributes](#displayed-and-searchable-attributes)
6161
- [Typo tolerance](#typo-tolerance)
62+
- [Pagination](#pagination)
6263

6364
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).
6465

@@ -130,3 +131,9 @@ Typo tolerance is a built-in feature that helps you find relevant results even w
130131
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).
131132

132133
[Learn more about typo tolerance](/learn/configuration/typo_tolerance.md)
134+
135+
### Pagination
136+
137+
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).
138+
139+
[Learn more about pagination](/learn/advanced/pagination.md)

0 commit comments

Comments
 (0)