meilisearch/meilisearch-http/tests
bors[bot] f564a9ce51
Merge #849
849: Update nbHits count with filtered documents r=MarinPostma a=balajisivaraman

Closes #764 
close #1039

After discussing with @MarinPostma on Slack, this is my first attempt at implementing this for the basic flow that will go through `bucket_sort_with_distinct`.

A few thoughts here: 

- For getting the count of filtered documents alone, I originally thought of using `filter_map.values().filter(|&&v| !v).count()`. In a few cases, this was the same as what I have now implemented. But I realised I couldn't do something similar for `distinct`. So for being consistent, I have implemented both in a similar fashion.
- I also needed the `contains_key` check to ensure we're not counting the same document ID twice.

@MarinPostma also mentioned that this will be an approximation since the sort is lazy. In the test example that I've updated, the actual filtered count will be just 19 (for `male` records), but due to the `limit` in play, it returns 32 (filtering out 11 records overall).

Please let me know if this is the kind of fix we are looking for, and I can implement it in the placeholder search also.

Co-authored-by: Balaji Sivaraman <balaji@balajisivaraman.com>
2020-11-26 09:53:13 +00:00
..
assets fix backups 2020-09-30 13:20:40 +02:00
common.rs rename folder to dir 2020-10-22 15:46:20 +02:00
dashboard.rs add test 2020-05-23 12:20:28 +02:00
documents_add.rs fix pr comments 2020-10-22 16:12:55 +02:00
documents_delete.rs add test clear all documents 2020-11-19 14:13:27 +01:00
documents_get.rs add tests for documents 2020-09-22 16:05:40 +02:00
dump.rs fix tests 2020-10-22 15:46:20 +02:00
errors.rs Implement backups 2020-09-28 14:40:06 +02:00
health.rs refactor /health on meilisearch-http that complies: 2020-10-19 14:30:43 +08:00
index_update.rs fix test option test 2020-08-24 14:14:11 +02:00
index.rs clean PR #946 2020-10-19 17:16:25 +02:00
lazy_index_creation.rs add tests 2020-10-15 09:43:54 +02:00
placeholder_search.rs feat(search): update nbHits count with filtered docs for placeholder search 2020-11-19 21:02:47 +05:30
search_settings.rs update tests for facets distribution case 2020-08-12 10:31:11 +02:00
search.rs feat(search): update nbHits count with filtered docs for core flow 2020-11-19 19:35:37 +05:30
settings_ranking_rules.rs fix tests 2020-07-15 18:56:19 +02:00
settings_stop_words.rs update stop_words tests to use the test dataset 2020-07-02 16:52:39 +05:30
settings.rs Revert "Merge #1001" 2020-11-02 15:10:09 +01:00
url_normalizer.rs add tests 2020-05-12 15:34:08 +02:00