-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
MeiliSearch plugin creates index but does not add documents #5902
Comments
Ok this is .. confusing. On a hunch, I installed Lo and behold, the index was created. The problem is, there is no mention anywhere that And the medusa starter project that I used does not install this package either, neither does |
See: https://github.com/medusajs/medusa/blob/develop/packages/medusa-plugin-meilisearch/package.json Please note that the current package.json of So, well, it was an outdated dependency after all. But the issue is with the plugin referring to an outdated version and yarn being very exact on which version to install, despite the fact that the version number is prefixed with Please note the output of ├─ @medusajs/core-flows@npm:0.0.3
│ └─ @medusajs/utils@npm:1.11.2 (via npm:^1.11.2)
│
├─ @medusajs/event-bus-local@npm:1.9.7
│ └─ @medusajs/utils@npm:1.11.2 (via npm:^1.9.2)
│
├─ @medusajs/event-bus-redis@npm:1.8.10
│ └─ @medusajs/utils@npm:1.11.2 (via npm:^1.9.2)
│
├─ @medusajs/link-modules@npm:0.2.5
│ └─ @medusajs/utils@npm:1.11.2 (via npm:^1.11.2)
│
├─ @medusajs/medusa-cli@npm:1.3.22
│ └─ @medusajs/utils@npm:1.11.2 (via npm:^1.11.2)
│
├─ @medusajs/medusa@npm:1.19.0
│ └─ @medusajs/utils@npm:1.11.2 (via npm:^1.11.2)
│
├─ @medusajs/medusa@patch:@medusajs/medusa@npm%3A1.19.0#./.yarn/patches/@medusajs-medusa-npm-1.19.0-3db0e6d4bd.patch::version=1.19.0&hash=023e96&locator=backend%40workspace%3A.
│ └─ @medusajs/utils@npm:1.11.2 (via npm:^1.11.2)
│
├─ @medusajs/medusa@patch:@medusajs/medusa@npm%3A1.19.0#./.yarn/patches/@medusajs-medusa-npm-1.19.0-3db0e6d4bd.patch::version=1.19.0&hash=023e96&locator=backend%40workspace%3A. [f5126]
│ └─ @medusajs/utils@npm:1.11.2 (via npm:^1.11.2)
│
├─ @medusajs/modules-sdk@npm:1.12.5
│ └─ @medusajs/utils@npm:1.11.2 (via npm:^1.11.2)
│
├─ @medusajs/orchestration@npm:0.5.1
│ └─ @medusajs/utils@npm:1.11.2 (via npm:^1.11.2)
│
├─ @medusajs/workflows-sdk@npm:0.1.0
│ └─ @medusajs/utils@npm:1.11.2 (via npm:^1.11.1)
│
├─ backend@workspace:.
│ └─ @medusajs/utils@npm:1.11.2 (via npm:^1.11.2)
│
├─ medusa-plugin-meilisearch@npm:2.0.10
│ └─ @medusajs/utils@npm:1.11.2 (via npm:^1.9.4)
│
└─ medusa-plugin-meilisearch@npm:2.0.10 [f5126]
└─ @medusajs/utils@npm:1.11.2 (via npm:^1.9.4)
I assume we can blame yarn for this issue, but maybe it would be still good to bump the versions in plugins to prevent this from happening again and again (I am not the first, nor will I be the last to spend an afternoon trying to get this to work). Or maybe just add the module to the starter at the latest version on the top-level package.json. |
After an extended period of attempting to resolve the issue without success, I finally managed to retrieve the documents by simply using |
Thanks for sharing your findings @genox. We are aware of the versioning issue and are currently working to find a good solution to it :) |
I have the same issue. 1 subscriber, it creates the index, but no records are uploaded to Meilisearch and no errors are in the console. I've set logging to verbose. Here are my dependencies: "dependencies": {
"@medusajs/admin": "latest",
"@medusajs/cache-inmemory": "latest",
"@medusajs/cache-redis": "^1.9.0",
"@medusajs/event-bus-local": "latest",
"@medusajs/event-bus-redis": "^1.8.12",
"@medusajs/file-local": "latest",
"@medusajs/medusa": "latest",
"@medusajs/utils": "^1.11.8",
"@tanstack/react-query": "4.22.0",
"body-parser": "^1.19.0",
"cors": "^2.8.5",
"dotenv": "16.3.1",
"express": "^4.17.2",
"medusa-fulfillment-manual": "latest",
"medusa-interfaces": "latest",
"medusa-payment-manual": "latest",
"medusa-payment-stripe": "latest",
"medusa-plugin-algolia": "^0.2.20",
"medusa-plugin-meilisearch": "^2.0.10",
"prism-react-renderer": "^2.0.4",
"typeorm": "^0.3.16"
}, Medusa Config: {
resolve: 'medusa-plugin-meilisearch',
options: {
config: {
host: process.env.MEILISEARCH_HOST,
apiKey: process.env.MEILISEARCH_API_KEY,
},
settings: {
indexName: {
indexSettings: {
searchableAttributes: ['title', 'description'],
displayedAttributes: ['id', 'title', 'description'],
},
},
},
},
}, |
@genox I was stuck on the same problem and this solved it for me. Thanks for sharing! |
this is still not working. im using npm and installed medusa/utils. it is not working at all |
Bug report
I followed the Quickstart guide on the medusa website. I have a pristine Meilisearch instance, all medusa packages are up to date. I have the latest version of every medusa package installed, I double checked that since various sources here mention that this will fix the issue. I have a minimal plugin configuration, only host and key is set. I use custom attributes on the Product entity.
When I start medusa, I see that there is an event generated:
In the meilisearch UI I can see that the index products has been created, but there are no documents.
There are no further relevant log entries or messages regarding the indexing.
Editing a product triggers an event, too, but there is no indexing happening and there are no further messages.
System information
Steps to reproduce the behavior
Try to add the plugin to an existing project and try to index products?
Expected behavior
Speculations
I assume the method that tries to put together an indexable document based on the Product entity fails. But the subscriber doesn't log anything to the console. Custom attributes maybe? Are there any known limitations and pitfalls?
Please don't suggest to update packages, I did that already and triple checked..
rm -rf node_modules && rm -f yarn.lock
etc included.The text was updated successfully, but these errors were encountered: