Skip to content

Commit 1ba302a

Browse files
curquizabidoubiwa
andauthored
Improve README with pagination information (#120)
* Improve README with pagination information * Update README.md * Update README.md Co-authored-by: cvermand <[email protected]> Co-authored-by: cvermand <[email protected]>
1 parent f59c9b9 commit 1ba302a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,14 @@ const searchClient = instantMeiliSearch(
6060
);
6161
```
6262

63-
- `paginationTotalHits` (`200` by default): The total (and finite) number of hits you can browse during pagination.<br>
64-
It means, by default, you can browse `paginationTotalHits / hitsPerPage = 200 / 20 = 10` pages during pagination.<br>
65-
By default, `hitsPerPage` is set to `20` but it can be changed with [`InsantSearch.configure`](https://www.algolia.com/doc/api-reference/widgets/configure/js/#examples)<br>
66-
If the pagination widget is not set, this parameter is ignored.
67-
6863
- `placeholderSearch` (`true` by default). Displays documents even when the query is empty.
6964

65+
- `paginationTotalHits` (`200` by default): The total (and finite) number of hits you can browse during pagination when using the [pagination widget](https://www.algolia.com/doc/api-reference/widgets/pagination/js/). If the pagination widget is not used, `paginationTotalHits` is ignored.<br>
66+
Which means that, with a `paginationTotalHits` default value of 200, and `hitsPerPage` default value of 20, you can browse `paginationTotalHits / hitsPerPage` => `200 / 20 = 10` pages during pagination. Each of the 10 pages containing 20 results.<br>
67+
The default value of `hitsPerPage` is set to `20` but it can be changed with [`InsantSearch.configure`](https://www.algolia.com/doc/api-reference/widgets/configure/js/#examples).<br>
68+
⚠️ MeiliSearch is not designed for pagination and this can lead to performances issues, so the usage of the pagination widget is not encouraged. However, the `paginationTotalHits` parameter lets you implement this pagination with less performance issue as possible: depending on your dataset (the size of each document and the number of documents) you might decrease the value of `paginationTotalHits`.<br>
69+
More information about MeiliSearch and the pagination [here](https://github.com/meilisearch/documentation/issues/561).
70+
7071
## Example with InstantSearch
7172

7273
The open-source [InstantSearch](https://www.algolia.com/doc/api-reference/widgets/js/) library powered by Algolia provides all the front-end tools you need to highly customize your search bar environment.

0 commit comments

Comments
 (0)