-
Notifications
You must be signed in to change notification settings - Fork 66
InstantMeilisearch: Enable hybrid search #1285
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
Conversation
🦋 Changeset detectedLatest commit: a2f3192 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
brunoocasali
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Strift thanks a lot for this PR!
Although, we would need some tests to be able to merge it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you need to make the types for the hybrid search available somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so.
The HybridSearch type is only used internally in meilisearch (JS) in the SearchParams type.
The SearchParams type is exported, so users can still do:
const config: SearchParams[hybrid] = {} // configuration will have the correct typeNB: other internal types in SearchParams, like MatchingStrategies aren't exported either. So I think this is consistent.
| meiliSearchParams.attributesToSearchOn = value | ||
| } | ||
| }, | ||
| addHybridSearch() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test case for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a test! It seems to work, but maybe there's a different way to approach this. Let me know!
brunoocasali
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!! bors merge
Pull Request
Hi 👋 this PR enables using the hybrid search experimental API with
@meilisearch/instant-meilisearch.Issue
Solves #1286
Proposed API
Allow users to pass a
hybridobject in themeiliSearchParamsobject when creating an instantMeilisearch client.Additionally, the
adaptSearchParamsfunction will now internally handle thishybridobject.What does this PR do?
hybridobject as an overridable search parameterPR checklist
Please check if your PR fulfills the following requirements:
Thank you so much for contributing to Meilisearch!