Commit 11d9aac
Merge #1011
1011: Add support for indexing with wildcard locale r=Strift a=DanielRoeven-Intunio
# Pull Request
## Related issue
Fixes #988
## What does this PR do?
- Adds back support for indexing (all) localised content types in Strapi.
- Updates README and examples
The [i18n plugin](https://docs-v4.strapi.io/dev-docs/plugins/i18n) in Strapi 4 to localise content used the key-value pair `locale: 'all'` in the `entriesQuery` to query entries in all locales. [This is reflected in the `strapi-plugin-meilisearch` README](https://github.com/meilisearch/strapi-plugin-meilisearch?tab=readme-ov-file#-entries-query).
[In Strapi 5, i18n is now part of the Strapi core](https://docs.strapi.io/dev-docs/migration/v4-to-v5/breaking-changes/i18n-content-manager-locale). With this change, the key-value pair changed to `locale: '*'`.
(Or perhaps this change happened together with the move from the [Entity Service API](https://docs.strapi.io/dev-docs/api/entity-service/crud) to the [Document Service API](https://docs.strapi.io/dev-docs/api/document-service)). Reading the code, it appears that this plugin already uses the Document Service, but the [link in the `strapi-plugin-meilisearch` README still points to the Entity Service](https://github.com/meilisearch/strapi-plugin-meilisearch?tab=readme-ov-file#-entries-query). Regardless of whether the root cause is the Strapi 4 + i18n / Strapi 5 change, or the Entity Service / Document Service change, I've updated the README to point to the correct docs.)
This PR only _adds_ support for the wildcard `*` locale, and left support in for the `all` locale, used previously, maintaining backwards compatibility. I've updated the README to reflect usage first and foremost with Strapi 5, with a small note for usage with Strapi 4.
## 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?
Thanks for the work on the plugin, happy to hear your thoughts and make adjustments to the PR as needed!
Co-authored-by: Daniel Roeven <[email protected]>File tree
4 files changed
+43
-7
lines changed- resources/entries-query
- server/src
- __tests__
- services/meilisearch
4 files changed
+43
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
430 | | - | |
| 430 | + | |
431 | 431 | | |
432 | | - | |
| 432 | + | |
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
440 | | - | |
| 440 | + | |
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
| 448 | + | |
| 449 | + | |
448 | 450 | | |
449 | 451 | | |
450 | 452 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
396 | 424 | | |
397 | 425 | | |
398 | 426 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
247 | | - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
248 | 250 | | |
249 | 251 | | |
250 | 252 | | |
| |||
258 | 260 | | |
259 | 261 | | |
260 | 262 | | |
261 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
262 | 268 | | |
263 | 269 | | |
264 | 270 | | |
| |||
0 commit comments