Skip to content

Commit 7c40e6e

Browse files
committed
docs: update README with example for indexOverrides
1 parent 12d9e19 commit 7c40e6e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

packages/instant-meilisearch/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,28 @@ instantMeiliSearch(
296296
}
297297
)
298298
```
299+
When using multi search, meilisearchParams can be overriden for specific indexes :
299300

301+
```js
302+
instantMeiliSearch(
303+
// ...
304+
{
305+
meiliSearchParams: {
306+
// All indexes will highlight overview
307+
attributesToHighlight: ['overview'],
308+
highlightPreTag: '<em>',
309+
highlightPostTag: '</em>',
310+
attributesToSearchOn: ['overview'],
311+
indexesOverrides: {
312+
movies: {
313+
// Only title will be highlighted for hits in movies
314+
attributesToHighlight: ['title']
315+
}
316+
}
317+
},
318+
}
319+
)
320+
```
300321
### Modify Meilisearch search parameters
301322

302323
`instantMeiliSearch` returns an instance with two properties on it, one of them being `setMeiliSearchParams`.

0 commit comments

Comments
 (0)