Skip to content

Commit 60a28fd

Browse files
committed
updates test case based on feedback
1 parent e01d5be commit 60a28fd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/index/test_index_search_meilisearch.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# pylint: disable=invalid-name
22

3+
from typing import Counter
4+
35
import pytest
46

57

@@ -510,7 +512,9 @@ def test_vector_search(index_with_documents_and_vectors):
510512

511513
def test_search_distinct(index_with_documents):
512514
index_with_documents().update_filterable_attributes(["genre"])
513-
response = index_with_documents().search("How to train your dragin", {"distinct": "genre"})
515+
response = index_with_documents().search("with", {"distinct": "genre"})
516+
genres = dict(Counter([x.get("genre") for x in response["hits"]]))
514517
assert isinstance(response, dict)
515-
assert len(response["hits"]) == 1
516-
assert response["hits"][0]["id"] == "166428"
518+
assert len(response["hits"]) == 11
519+
assert genres == {None: 9, "action": 1, "Sci Fi": 1}
520+
assert response["hits"][0]["id"] == "399579"

0 commit comments

Comments
 (0)