Skip to content

Commit edd7b9f

Browse files
authored
Stabilize vector store usage (#1079)
* Stabilize vector store usage * Remove unused imports * Update default embedders * Lint
1 parent 82e9ad0 commit edd7b9f

File tree

5 files changed

+2
-32
lines changed

5 files changed

+2
-32
lines changed

meilisearch/index.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -281,12 +281,7 @@ def search(self, query: str, opt_params: Optional[Mapping[str, Any]] = None) ->
281281
String containing the searched word(s)
282282
opt_params (optional):
283283
Dictionary containing optional query parameters.
284-
Note: The vector parameter is only available in Meilisearch >= v1.3.0, and is experimental
285-
Meilisearch v1.3.0. In order to use this feature in Meilisearch v1.3.0 you first need to
286-
enable the feature by sending a PATCH request to /experimental-features with
287-
{ "vectoreStore": true }. Because this feature is experimental it may be removed or
288-
updated causing breaking changes in this library without a major version bump so use
289-
with caution.
284+
Note: The vector parameter is only available in Meilisearch >= v1.13.0
290285
https://www.meilisearch.com/docs/reference/api/search#search-in-an-index
291286
292287
Returns

tests/conftest.py

-18
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import json
33
from typing import Optional
44

5-
import requests
65
from pytest import fixture
76

87
import meilisearch
@@ -213,23 +212,6 @@ def get_private_key(client):
213212
return key
214213

215214

216-
@fixture
217-
def enable_vector_search():
218-
requests.patch(
219-
f"{common.BASE_URL}/experimental-features",
220-
headers={"Authorization": f"Bearer {common.MASTER_KEY}"},
221-
json={"vectorStore": True},
222-
timeout=10,
223-
)
224-
yield
225-
requests.patch(
226-
f"{common.BASE_URL}/experimental-features",
227-
headers={"Authorization": f"Bearer {common.MASTER_KEY}"},
228-
json={"vectorStore": False},
229-
timeout=10,
230-
)
231-
232-
233215
@fixture
234216
def new_embedders():
235217
return {

tests/index/test_index_search_meilisearch.py

-1
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,6 @@ def test_show_ranking_score(index_with_documents):
502502
assert response["hits"][0]["_rankingScore"] >= 0.9
503503

504504

505-
@pytest.mark.usefixtures("enable_vector_search")
506505
def test_vector_search(index_with_documents_and_vectors):
507506
response = index_with_documents_and_vectors().search(
508507
"",

tests/settings/test_settings.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def test_get_settings_default(empty_index):
4141
assert response["synonyms"] == {}
4242

4343

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

6362

64-
@pytest.mark.usefixtures("enable_vector_search")
6563
def test_reset_settings(new_settings, empty_index):
6664
"""Tests resetting all the settings to their default value."""
6765
index = empty_index()
@@ -94,4 +92,4 @@ def test_reset_settings(new_settings, empty_index):
9492
assert response["searchableAttributes"] == ["*"]
9593
assert response["stopWords"] == []
9694
assert response["synonyms"] == {}
97-
assert response.get("embedders") is None
95+
assert response["embedders"] == {}

tests/settings/test_settings_embedders.py

-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
# pylint: disable=redefined-outer-name
2-
import pytest
32

43
from meilisearch.models.index import OpenAiEmbedder, UserProvidedEmbedder
54

65

7-
@pytest.mark.usefixtures("enable_vector_search")
86
def test_get_default_embedders(empty_index):
97
"""Tests getting default embedders."""
108
response = empty_index().get_embedders()
119

1210
assert response is None
1311

1412

15-
@pytest.mark.usefixtures("enable_vector_search")
1613
def test_update_embedders_with_user_provided_source(new_embedders, empty_index):
1714
"""Tests updating embedders."""
1815
index = empty_index()
@@ -24,7 +21,6 @@ def test_update_embedders_with_user_provided_source(new_embedders, empty_index):
2421
assert isinstance(response_get.embedders["open_ai"], OpenAiEmbedder)
2522

2623

27-
@pytest.mark.usefixtures("enable_vector_search")
2824
def test_reset_embedders(new_embedders, empty_index):
2925
"""Tests resetting the typo_tolerance setting to its default value."""
3026
index = empty_index()

0 commit comments

Comments
 (0)