-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
924: Implement vector search experimental feature v2 (v1.6) r=curquiza a=CaroFG # Pull Request ## Related issue Fixes #901 ## What does this PR do? - Creates embedders classes - Adds embedders to paths - Introduces new routes: - Create a new method to get the settings by calling GET /indexes/:index_uid/settings/embedders - Create a new method to update the settings by calling PATCH /indexes/:index_uid/settings/embedders - Create a new method to reset the settings by calling DELETE /indexes/:index_uid/settings/embedders - Adds embedders settings tests - Updates vector search tests ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: CaroFG <carolina.ferreira131@gmail.com> Co-authored-by: CaroFG <48251481+CaroFG@users.noreply.github.com>
- Loading branch information
Showing
7 changed files
with
158 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import pytest | ||
|
||
from meilisearch.models.index import Embedders | ||
|
||
|
||
@pytest.mark.usefixtures("enable_vector_search") | ||
def test_get_default_embedders(empty_index): | ||
"""Tests getting default embedders.""" | ||
response = empty_index().get_embedders() | ||
|
||
assert response is None | ||
|
||
|
||
@pytest.mark.usefixtures("enable_vector_search") | ||
def test_update_embedders_with_user_provided_source(new_embedders, empty_index): | ||
"""Tests updating embedders.""" | ||
index = empty_index() | ||
response_update = index.update_embedders(new_embedders) | ||
update = index.wait_for_task(response_update.task_uid) | ||
response_get = index.get_embedders() | ||
assert update.status == "succeeded" | ||
assert response_get == Embedders(embedders=new_embedders) | ||
|
||
|
||
@pytest.mark.usefixtures("enable_vector_search") | ||
def test_reset_embedders(new_embedders, empty_index): | ||
"""Tests resetting the typo_tolerance setting to its default value.""" | ||
index = empty_index() | ||
|
||
# Update the settings | ||
response_update = index.update_embedders(new_embedders) | ||
update1 = index.wait_for_task(response_update.task_uid) | ||
# Get the setting after update | ||
response_get = index.get_embedders() | ||
# Reset the setting | ||
response_reset = index.reset_embedders() | ||
update2 = index.wait_for_task(response_reset.task_uid) | ||
# Get the setting after reset | ||
response_last = index.get_embedders() | ||
|
||
assert update1.status == "succeeded" | ||
assert response_get == Embedders(embedders=new_embedders) | ||
assert update2.status == "succeeded" | ||
assert response_last is None |