You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1258: Expose a set of Meilisearch search parameters to be overridden/configured r=brunoocasali a=flevi29
# Pull Request
## Related issue
Fixes#1249
## What does this PR do?
- Adds ability to configure and override a selection of Meilisearch search parameters
- Modifies some types, stronger type checking
## 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?
Thank you so much for contributing to Meilisearch!
Co-authored-by: F. Levi <55688616+flevi29@users.noreply.github.com>
'a63da4928426f12639e19d62886f621130f3fa9ff3c7534c5d179f0f51c4f303'// API key
86
86
)
87
87
```
88
88
89
+
where `searchClient` is to be passed to instantsearch.js or its many framework adaptations, and [`setMeiliSearchParams`](#modify-meilisearch-search-parameters) is a function used to set/modify certain Meilisearch search parameters to be overridden.
`matchingStrategy` gives you the possibility to choose how Meilisearch should handle the presence of multiple query words, see [documentation](https://www.meilisearch.com/docs/reference/api/search#matching-strategy).
178
-
179
-
For example, if your query is `hello world` by default Meilisearch returns documents containing either both `hello` and `world` or documents that only contain `hello`. This is the `last` strategy, where words are stripped from the right.
180
-
The other strategy is `all`, where both `hello` and `world`**must** be present in a document for it to be returned.
181
-
182
-
183
-
```js
184
-
{
185
-
matchingStrategy:'all'// default last
186
-
}
187
-
```
188
-
189
177
### Request Config
190
178
191
179
You can provide a custom request configuration. Available field can be [found here](https://fetch.spec.whatwg.org/#requestinit).
@@ -221,6 +209,66 @@ You can use your own HTTP client, for example, with [`axios`](https://github.com
221
209
}
222
210
```
223
211
212
+
### Meilisearch search parameters
213
+
214
+
`meiliSearchParams` lets you override a set of search parameters that are sent off to Meilisearch.
The open-source [InstantSearch](https://www.algolia.com/doc/api-reference/widgets/js/) library powered by Algolia provides all the front-end tools you need to highly customize your search bar environment.
0 commit comments