Skip to content
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

EstimatedTotalHits Removed #577

Closed
migueltarga opened this issue Nov 7, 2024 · 2 comments · Fixed by #579
Closed

EstimatedTotalHits Removed #577

migueltarga opened this issue Nov 7, 2024 · 2 comments · Fixed by #579
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@migueltarga
Copy link

Description
The Search was refactored at some point to use https://github.com/meilisearch/meilisearch-dotnet/blob/main/src/Meilisearch/ISearchable.cs instead of https://github.com/meilisearch/meilisearch-dotnet/blob/main/src/Meilisearch/SearchResult.cs and some properties were left out, like EstimatedTotalHits

@curquiza curquiza added bug Something isn't working good first issue Good for newcomers labels Nov 11, 2024
danFbach added a commit to danFbach/meilisearch-dotnet that referenced this issue Nov 11, 2024
@danFbach danFbach mentioned this issue Nov 11, 2024
3 tasks
@danFbach
Copy link
Contributor

I also encountered this. sent a pull request. hopefully it's sufficient.

@migueltarga
Copy link
Author

migueltarga commented Nov 11, 2024

Not an issue based on #578
The documentation is outdated.

Thank you @danFbach

danFbach added a commit to danFbach/meilisearch-dotnet that referenced this issue Nov 11, 2024
@danFbach danFbach mentioned this issue Nov 11, 2024
3 tasks
meili-bors bot added a commit that referenced this issue Jan 8, 2025
579: Update search docs r=ahmednfwela a=danFbach

# Pull Request

## Related issue
Fixes #577, references #578 

## What does this PR do?
- Updates docs to better reflect how results can be consumed.
- Some of the existing docs are wrong as `SearchResult<T> result = await index.SearchAsync(...);` is actually invalid since an explicit cast is required from `ISearchable<T>` to the type of result.
- There was no context showing that the result should be cast to either `SearchResult<T>` or `PaginatedResult<T>` in order to populate properties `EstimatedTotalHits` or `TotalHits` and `TotalPages` respectively.

## 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?

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:
```c#
var result = (SearchResult<T>)await index.SearchAsync<T>(...);
```
or
```c#
var result = await index.SearchAsync<T>(...);
if (result is SearchResult<T> searchResult)
{
    //...
}
```
I prefer the latter, so that's how i changed the docs.

Co-authored-by: Dan Fehrenbach <dan@fbach.us>
Co-authored-by: Clémentine <clementine@meilisearch.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants