-
Notifications
You must be signed in to change notification settings - Fork 58
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
Update search docs #579
base: main
Are you sure you want to change the base?
Update search docs #579
Conversation
The SearchResult<T> games = await client.Index("...").SearchAsync<T>(""); Which is now invalid since the addition of ISearchable. |
Yes please, thank you 😊 |
… supported since ISearchable<T>. added context for casting ISearchable<T> into usable result
okay, I've updated the code samples. I added casting to the docs - let me know if this is out of scope, but i think it is useful for dotnet devs, as it was not immediately apparent to me before reviewing the source here. |
If it's useful for dotnet dev, let's keep it. Thank you @danFbach 🙏 For more context: we do not have any .NET dev at meilisearch, so any .NET expertise is welcome! |
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 ✅
@ahmednfwela if you have time to ensure you are ok with this good practice, it would be awesome 😊
Pull Request
Related issue
Fixes #577, references #578
What does this PR do?
SearchResult<T> result = await index.SearchAsync(...);
is actually invalid since an explicit cast is required fromISearchable<T>
to the type of result.SearchResult<T>
orPaginatedResult<T>
in order to populate propertiesEstimatedTotalHits
orTotalHits
andTotalPages
respectively.PR checklist
Please check if your PR fulfills the following requirements:
If you have any critiques or anything you want added to the docs for this purpose, let me know. Just hoping to clarify how transform the interface correctly.
Technically the proper type could be derive by one of two methods:
or
I prefer the latter, so that's how i changed the docs.