Sitelet https://web.archive.org/web/20201026004626/https://github.com/meilisearch/MeiliSearch/issues/764
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

Total result count (nbHits) not updated for filters #764

Open
unknownhasher opened this issue Jun 9, 2020 · 6 comments · May be fixed by #849
Open

Total result count (nbHits) not updated for filters #764

unknownhasher opened this issue Jun 9, 2020 · 6 comments · May be fixed by #849

Comments

@unknownhasher
Copy link

@unknownhasher unknownhasher commented Jun 9, 2020

Is your feature request related to a problem? Please describe.
I want to show the number of total results (for pagination and for feedback to my users). The result field nbHits is updated by the search string but is not updated by the filters that are given. Because of that it is impossible to give a total count to the users and make a good pagination.

Describe the solution you'd like
It would be nice if nbHits is also updated by filters or if there is a secord variable where the filtered count is shown.

@MarinPostma
Copy link
Contributor

@MarinPostma MarinPostma commented Jun 9, 2020

This is a good suggestion. Currently, we only report the number of candidates, not accounting for the filtered elements. We could in fact count the filtered out element and take them out of the candidate count.

@jiminy-billy-bob
Copy link

@jiminy-billy-bob jiminy-billy-bob commented Jun 11, 2020

+1

@balajisivaraman
Copy link
Contributor

@balajisivaraman balajisivaraman commented Jun 27, 2020

@MarinPostma, Now that I'm done with the tests cleanup, I would be interested in picking this up, if it is still available.

@MarinPostma
Copy link
Contributor

@MarinPostma MarinPostma commented Jun 27, 2020 •

Amazing! There are multiple places where this have to be done unfortunately... Ping me on slack during the week, and I'll show you where to look 😊

@balajisivaraman
Copy link
Contributor

@balajisivaraman balajisivaraman commented Jun 27, 2020

Awesome! I'll have a look and ping you for sure.

@isaackearl
Copy link

@isaackearl isaackearl commented Jul 11, 2020

I tried looking at this a bit myself as I'm trying to migrate to meilisearch from algolia, and I didn't find an easy solution. I'm to big of a Rust newb to actually tackle this without a bit more time to learn some things. I think this issues should also qualify as a bug, because paginators that rely on total counts simply don't work when filtered with the current implementation. Anyway just wanted to make a comment to support this enhancement. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

5 participants
You can’t perform that action at this time.