1818import logging
1919import re
2020from functools import partial
21- from typing import Any , List , Optional , Union
21+ from typing import Any , List , Optional , Tuple , Union
2222
2323import pytest
2424
3333 VectorStore ,
3434)
3535from elasticsearch .helpers .vectorstore ._sync ._utils import model_is_deployed
36+ from test_elasticsearch .utils import es_version
3637
3738from . 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+ raise pytest .SkipTest ("This test requires Elasticsearch 8.14 or newer" )
343+
340344 store = VectorStore (
341345 index = index ,
342346 retrieval_strategy = DenseVectorStrategy (hybrid = True ),
@@ -378,7 +382,7 @@ def assert_query(query_body: dict, query: Optional[str]) -> dict:
378382 1.0 ,
379383 1.0 ,
380384 1.0 ,
381- 1.0 ,
385+ 1.0 ,
382386 1.0 ,
383387 1.0 ,
384388 1.0 ,
@@ -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+ raise pytest .SkipTest ("This test requires Elasticsearch 8.14 or newer" )
410+
404411 texts = ["foo" , "bar" , "baz" ]
405412
406413 def assert_query (
0 commit comments