Skip to content

Commit 203f678

Browse files
only run hybrid search tests when using a stack version >= 8.14
1 parent 32ab831 commit 203f678

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

elasticsearch/helpers/vectorstore/_async/strategies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def _hybrid(
291291
rrf_options["rank_constant"] = self.rrf["rank_constant"]
292292
if "window_size" in self.rrf:
293293
# 'window_size' was renamed to 'rank_window_size', but we support
294-
# the older name for backwards compatiblit
294+
# the older name for backwards compatibility
295295
rrf_options["rank_window_size"] = self.rrf["window_size"]
296296
if "rank_window_size" in self.rrf:
297297
rrf_options["rank_window_size"] = self.rrf["rank_window_size"]

elasticsearch/helpers/vectorstore/_sync/strategies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def _hybrid(
291291
rrf_options["rank_constant"] = self.rrf["rank_constant"]
292292
if "window_size" in self.rrf:
293293
# 'window_size' was renamed to 'rank_window_size', but we support
294-
# the older name for backwards compatiblit
294+
# the older name for backwards compatibility
295295
rrf_options["rank_window_size"] = self.rrf["window_size"]
296296
if "rank_window_size" in self.rrf:
297297
rrf_options["rank_window_size"] = self.rrf["rank_window_size"]

test_elasticsearch/test_server/test_vectorstore/test_vectorstore.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
VectorStore,
3434
)
3535
from elasticsearch.helpers.vectorstore._sync._utils import model_is_deployed
36+
from test_elasticsearch.utils import es_version
3637

3738
from . import ConsistentFakeEmbeddings, FakeEmbeddings
3839

@@ -337,6 +338,9 @@ def test_search_knn_with_hybrid_search(
337338
self, sync_client: Elasticsearch, index: str
338339
) -> None:
339340
"""Test end to end construction and search with metadata."""
341+
if es_version(sync_client) < (8, 14):
342+
pytest.skip("This test requires Elasticsearch 8.14 or newer")
343+
340344
store = VectorStore(
341345
index=index,
342346
retrieval_strategy=DenseVectorStrategy(hybrid=True),
@@ -401,6 +405,9 @@ def test_search_knn_with_hybrid_search_rrf(
401405
self, sync_client: Elasticsearch, index: str
402406
) -> None:
403407
"""Test end to end construction and rrf hybrid search with metadata."""
408+
if es_version(sync_client) < (8, 14):
409+
pytest.skip("This test requires Elasticsearch 8.14 or newer")
410+
404411
texts = ["foo", "bar", "baz"]
405412

406413
def assert_query(

0 commit comments

Comments
 (0)