Open levshkatov opened 1 year ago
What are you trying to achieve? What is your use case for meilisearch?
@tsvetann I'm trying to achieve not grabbing all my products every time I start the application. I wrote custom indexes for my needs, thus I need meilisearch. The point of this bug report is that now if we enable meilisearch even without indexes (I suppose algolia too), we select all of the products at app startup.
We got the same issue which impacts to performance when scaling out the server.
Yes - we should have an option not to reindex on startup - on kubernetes, if you scale up, it can render the store unusable...
I had the same issue.
Moreover i update the index in runtime(add new filterableAttributes
) but after startup index is reseted and so my runtime filterableAttributes
are deleted from index.
RC of the issue is the meilisearch loader. It calls update Index during startup(https://github.com/medusajs/medusa/blob/4fedaae01e93c10f37ae90d70af3dd70614b5683/packages/medusa-plugin-meilisearch/src/loaders/index.ts#L20) with hardcoded filterableAttributes
in medusa-config. So my runtime filterableAttributes
are lost.
I can not find a way to override the loader apart from delete the file from dist)
Bug report
I use the meilisearch plugin and when I enable it, without any indexes, it creates a default 'products' index and queues all my products from the database. And I think it happens whenever I restart the application. I found that this loader emits a search event. After that, this subscriber starts to retrieve all my products with a bunch of relations no matter whether I need it or not. I definitely need a search engine and now I only can disable the meilisearch plugin and write another one with the property
isDefault=true
. Is it possible to disable default indexing without writing my own plugin?System information
Medusa version (including plugins): 1.12.0, meilisearch: 2.0.7 Node.js version: Database: Operating system: Browser (if relevant):
Steps to reproduce the behavior
medusa-plugin-meilisearch
without any indexesExpected behavior
Please, remove emitting
SEARCH_INDEX_EVENT
and delegate it to userland's emitters and subscribers. Or, please, rewrite it in a way it won't trigger at every app's start.