Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.

Remove the usage of nbHits from the code base #97

Closed
curquiza opened this issue Feb 3, 2021 · 1 comment
Closed

Remove the usage of nbHits from the code base #97

curquiza opened this issue Feb 3, 2021 · 1 comment

Comments

@curquiza
Copy link
Member

curquiza commented Feb 3, 2021

The value nbHits returned by MeiliSearch is not a trustable value since it's not an exhaustive value. nbHits is indeed not reliable for pagination because can be exhaustive or not, depending on the value of exhaustiveNbHits that MeiliSearch returns which is always false

We should implement the pagination as described here: meilisearch/documentation#561


FYI: The Meili team is aware of the confusion with nbHis. Here are the different issues and comments about it to explain why it's confusing, and why we should not use it:

We are sorry for this. We all hope this confusion will be fixed asap in MeiliSearch.


Related to #95

@curquiza curquiza added this to Open issues in SDKs & Integrations via automation Feb 3, 2021
@curquiza
Copy link
Member Author

I realize my issue is not really relevant in this repo. The nbHits is indeed not relevant (if the query involves a lot of results) but it's currently the only way to be compliant with Laravel/Scout.
Algolia, which implements the search the same way as MeiliSearch, also returns a non-reliable nbHits but still uses it in Laravel/Scout:
https://github.com/laravel/scout/blob/78fb3b2e4837ed5d4e4a9fc1e09221aab774fe77/src/Engines/AlgoliaEngine.php#L198-L207

I'm closing this issue since it's not relevant anymore for this repo, but it might relevant for the next version of this library (meilisearch-laravel-scout-extended), see #111 for more details.

SDKs & Integrations automation moved this from Open issues to Done Mar 26, 2021
@curquiza curquiza removed this from Done in SDKs & Integrations Mar 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant