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

Add test for attributes to search on #806

Merged
merged 5 commits into from
Jul 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions tests/index/test_index_search_meilisearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,20 @@ def test_custom_search_params_with_pagination_parameters_at_zero(index_with_docu
assert "estimatedTotalHits" is not response


def test_attributes_to_search_on_search(index_with_documents):
response = index_with_documents().search(
"How to Train Your Dragon", opt_params={"attributesToSearchOn": ["title", "overview"]}
)
assert response["hits"][0]["id"] == "166428"


def test_attributes_to_search_on_search_no_match(index_with_documents):
response = index_with_documents().search(
"How to Train Your Dragon", opt_params={"attributesToSearchOn": ["id"]}
)
assert response["hits"] == []

alallema marked this conversation as resolved.
Show resolved Hide resolved

@pytest.mark.usefixtures("enable_vector_search")
def test_vector_search(index_with_documents_and_vectors):
response = index_with_documents_and_vectors().search(
Expand Down