解决 meilisearch 的最大输出问题,默认只能1000条

解决 meilisearch 的最大输出问题,默认只能1000条

官方文档不清楚 好像是写错了

解决办法

As I suspected, Meilisearch did have a default 1000 results per search limit. This is configured by the maxTotalHits pagination option. To quote from their documentation :
https://docs.meilisearch.com/reference/api/settings.html#pagination

maxTotalHits takes priority over search parameters such as limit, offset, hitsPerPage, and page.

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.

To update my pagination's limits, I just ran

curl \
    -X PATCH 'http://localhost:7700/indexes/my-index/settings/pagination' \
    -H 'Authorization: Bearer my-meilisearch-key' \
    -H 'Content-type: application/json' \
    -d '{"maxTotalHits": 20000}'


相关参考
https://stackoverflow.com/questions/74976894/does-meilisearch-have-a-limit-for-how-many-results-it-can-give-when-searching

https://www.meilisearch.com/docs/learn/resources/known_limitations#:~:text=Limitation%3A%20By%20default%2C%20Meilisearch%20returns,of%20the%20pagination%20index%20settings

https://docs.meilisearch.com/reference/api/settings.html#pagination

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注