Commit c702e85
Merge #818
818: fix: getIndexes limited to 20 indexes r=bidoubiwa a=nicolasvienot
# Pull Request
## Related issue
Fixes #714
## Context
Selecting more than 20 collections in the Meilisearch plugin causes issues where collections can't be selected or are reset in the Meilisearch plugin.
## What does this PR do?
The issue is that when retrieving the indexes through the `getIndexes` function, there is a limit set automatically by Meilisearch to `20` ([See reference](https://www.meilisearch.com/docs/reference/api/indexes#list-all-indexes)). As a result, only 20 indexes will be returned and the later checks between indexes in Meilisearch and collections in Strapi are wrong.
This PR changes the call to Meilisearch from GET `/indexes` to GET `/stats` which does not have a `limit`.
- Update `getIndexes` to `getIndexUids` and use the `getStats` function from `meilisearch-js`
- Return an array containing all the `indexUids`
- Update tests
## PR checklist
Please check if your PR fulfills the following requirements:
- [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?
Thank you so much for contributing to Meilisearch!
Co-authored-by: nicolasvienot <[email protected]>File tree
4 files changed
+28
-15
lines changed- server
- __mocks__
- __tests__
- services/meilisearch
4 files changed
+28
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
9 | 24 | | |
10 | 25 | | |
11 | 26 | | |
| |||
18 | 33 | | |
19 | 34 | | |
20 | 35 | | |
21 | | - | |
| 36 | + | |
22 | 37 | | |
23 | 38 | | |
24 | 39 | | |
| |||
27 | 42 | | |
28 | 43 | | |
29 | 44 | | |
30 | | - | |
| 45 | + | |
31 | 46 | | |
32 | 47 | | |
33 | 48 | | |
34 | 49 | | |
35 | 50 | | |
36 | | - | |
| 51 | + | |
37 | 52 | | |
38 | 53 | | |
39 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
| 34 | + | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
| 76 | + | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
180 | | - | |
| 179 | + | |
181 | 180 | | |
182 | 181 | | |
183 | 182 | | |
| |||
0 commit comments