Open
Description
Description
Right now creating a client with custom params is done like this :
const client = instantMeiliSearch(
"host",
"key",
{
meiliSearchParams: {
matchingStrategy: MatchingStrategies.ALL,
},
},
).searchClient;
Let's say I am on an ecommerce website searching in products and categories at the same time but want a different matching strategy. For example searching "i7 computer", I'd like suggested categories to include "Computers" but products to only include the ones with "i7" and "Computer" in its title or description.
To achieve such behavior I could then do :
const client = instantMeiliSearch(
"host",
"key",
{
meiliSearchParams: {
products: { matchingStrategy: MatchingStrategies.ALL },
categories: { matchingStrategy: MatchingStrategies.LAST },
},
},
).searchClient;
I can make a PR if you agree. We need to update the types and handle it here (and for every param):
like so :
addMatchingStrategy() {
const value = overrideParams?.matchingStrategy || overrideParams[indexUid].matchingStrategy;
if (value !== undefined) {
meiliSearchParams.matchingStrategy = value
}
},