Skip to content

Stabilize vector store usage #1079

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

Merged
merged 4 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
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
7 changes: 1 addition & 6 deletions meilisearch/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,7 @@ def search(self, query: str, opt_params: Optional[Mapping[str, Any]] = None) ->
String containing the searched word(s)
opt_params (optional):
Dictionary containing optional query parameters.
Note: The vector parameter is only available in Meilisearch >= v1.3.0, and is experimental
Meilisearch v1.3.0. In order to use this feature in Meilisearch v1.3.0 you first need to
enable the feature by sending a PATCH request to /experimental-features with
{ "vectoreStore": true }. Because this feature is experimental it may be removed or
updated causing breaking changes in this library without a major version bump so use
with caution.
Note: The vector parameter is only available in Meilisearch >= v1.13.0
https://www.meilisearch.com/docs/reference/api/search#search-in-an-index

Returns
Expand Down
18 changes: 0 additions & 18 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import json
from typing import Optional

import requests
from pytest import fixture

import meilisearch
Expand Down Expand Up @@ -213,23 +212,6 @@ def get_private_key(client):
return key


@fixture
def enable_vector_search():
requests.patch(
f"{common.BASE_URL}/experimental-features",
headers={"Authorization": f"Bearer {common.MASTER_KEY}"},
json={"vectorStore": True},
timeout=10,
)
yield
requests.patch(
f"{common.BASE_URL}/experimental-features",
headers={"Authorization": f"Bearer {common.MASTER_KEY}"},
json={"vectorStore": False},
timeout=10,
)


@fixture
def new_embedders():
return {
Expand Down
1 change: 0 additions & 1 deletion tests/index/test_index_search_meilisearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,6 @@ def test_show_ranking_score(index_with_documents):
assert response["hits"][0]["_rankingScore"] >= 0.9


@pytest.mark.usefixtures("enable_vector_search")
def test_vector_search(index_with_documents_and_vectors):
response = index_with_documents_and_vectors().search(
"",
Expand Down
4 changes: 1 addition & 3 deletions tests/settings/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def test_get_settings_default(empty_index):
assert response["synonyms"] == {}


@pytest.mark.usefixtures("enable_vector_search")
def test_update_settings(new_settings, empty_index):
"""Tests updating some settings."""
index = empty_index()
Expand All @@ -61,7 +60,6 @@ def test_update_settings(new_settings, empty_index):
assert isinstance(response["embedders"]["open_ai"], OpenAiEmbedder)


@pytest.mark.usefixtures("enable_vector_search")
def test_reset_settings(new_settings, empty_index):
"""Tests resetting all the settings to their default value."""
index = empty_index()
Expand Down Expand Up @@ -94,4 +92,4 @@ def test_reset_settings(new_settings, empty_index):
assert response["searchableAttributes"] == ["*"]
assert response["stopWords"] == []
assert response["synonyms"] == {}
assert response.get("embedders") is None
assert response["embedders"] == {}
4 changes: 0 additions & 4 deletions tests/settings/test_settings_embedders.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
# pylint: disable=redefined-outer-name
import pytest

from meilisearch.models.index import OpenAiEmbedder, UserProvidedEmbedder


@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()
Expand All @@ -24,7 +21,6 @@ def test_update_embedders_with_user_provided_source(new_embedders, empty_index):
assert isinstance(response_get.embedders["open_ai"], OpenAiEmbedder)


@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()
Expand Down