-
Notifications
You must be signed in to change notification settings - Fork 264
v0.28: Pagination settings #1759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 8 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
693de12
pagination settings: API reference scaffolding
guimachiavelli 6d624d5
pagination: new API reference page
guimachiavelli b2c4659
pagination: new API code samples
guimachiavelli dcd96bb
pagination: fix code sample key
guimachiavelli 6ce7068
pagination: add API reference to menu
guimachiavelli 88e9fc5
pagination: update global settings reference
guimachiavelli aec2da0
pagination: update known limitations
guimachiavelli b0572e0
pagination: update HTTP method
guimachiavelli 1e88a91
Apply suggestions from code review
guimachiavelli df1d260
pagination settings: address review feedback
guimachiavelli f5653cf
pagination settings: improve note on side effects of high `maxTotalHits`
guimachiavelli 2e8e715
pagination settings: fix broken hash
guimachiavelli b397e1f
pagination settings: update boxes with warnings on non-customizable m…
guimachiavelli 6a618ad
Update reference/api/pagination.md
guimachiavelli f48fe20
Update reference/api/pagination.md
guimachiavelli 213c326
Add pagination to core concepts/indexes
maryamsulemani97 0a340c2
Update learn/core_concepts/indexes.md
maryamsulemani97 752f0b3
Update indexes.md
maryamsulemani97 511f904
update setings
maryamsulemani97 8d01e10
settings_guide_pagination_1
maryamsulemani97 085dcb4
Update .code-samples.meilisearch.yaml
maryamsulemani97 486e470
Update learn/core_concepts/indexes.md
maryamsulemani97 31a1443
Apply suggestions from code review
guimachiavelli 4827ac3
Update .code-samples.meilisearch.yaml
guimachiavelli 4257e90
Update .code-samples.meilisearch.yaml
guimachiavelli 3d3d3de
add return to code samples file
guimachiavelli 24a46eb
Merge branch 'v0.28-pagination-settings' into update-indexes.md-to-ad…
guimachiavelli 16b334d
Merge #1766
bors[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# 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 | ||
|
||
<RouteHighlighter method="GET" route="/indexes/{index_uid}/settings/pagination"/> | ||
|
||
Get the pagination settings of an index. The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required. | ||
|
||
### Example | ||
|
||
<CodeSamples id="get_pagination_settings_1" /> | ||
|
||
#### Response: `200 OK` | ||
|
||
```json | ||
{ | ||
"maxTotalHits": 1000 | ||
} | ||
``` | ||
|
||
### Returned fields | ||
|
||
#### `maxTotalHits` | ||
|
||
The maximum number of results Meilisearch can return. | ||
|
||
## Update pagination settings | ||
|
||
<RouteHighlighter method="PATCH" route="/indexes/{index_uid}/settings/pagination"/> | ||
|
||
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`. | ||
|
||
#### Example | ||
|
||
<CodeSamples id="update_pagination_settings_1" /> | ||
|
||
#### Response: `200 OK` | ||
|
||
```json | ||
{ | ||
"uid": 1, | ||
guimachiavelli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"indexUid": "books", | ||
"status": "enqueued", | ||
"type": "settingsUpdate", | ||
"enqueuedAt": "2022-04-14T20:56:44.991039Z" | ||
} | ||
``` | ||
|
||
You can use the returned `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task). | ||
guimachiavelli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## 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 | ||
|
||
<CodeSamples id="reset_pagination_settings_1" /> | ||
|
||
#### Response: `200 OK` | ||
|
||
```json | ||
{ | ||
"uid": 1, | ||
guimachiavelli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"indexUid": "books", | ||
"status": "enqueued", | ||
"type": "settingsUpdate", | ||
"enqueuedAt": "2022-04-14T20:53:32.863107Z" | ||
} | ||
``` | ||
|
||
You can use the returned `uid` to get more details on [the status of the task](/reference/api/tasks.md#get-task). | ||
guimachiavelli marked this conversation as resolved.
Show resolved
Hide resolved
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.