@@ -423,37 +423,30 @@ describe("ElasticVectorSearch - ES 9.x Compatibility", () => {
423423 embeddings = new OpenAIEmbeddings ( ) ;
424424 } ) ;
425425
426- test . skip ( "Hybrid search with excludeSourceVectors set to false for ES 9.x " , async ( ) => {
427- const indexName = "test_es9_exclude_false " ;
426+ test . skip ( "Hybrid search with includeSourceVectors set to true for ES 9.2+ " , async ( ) => {
427+ const indexName = "test_es9_include_vectors " ;
428428 const store = new ElasticVectorSearch ( embeddings , {
429429 client,
430430 indexName,
431431 strategy : new HybridRetrievalStrategy ( {
432- excludeSourceVectors : false ,
432+ includeSourceVectors : true ,
433433 } ) ,
434434 } ) ;
435435 await store . deleteIfExists ( ) ;
436436
437437 await store . addDocuments ( [
438- new Document ( { pageContent : "Document for ES 9.x testing" } ) ,
438+ new Document ( { pageContent : "Document for ES 9.2+ testing" } ) ,
439439 new Document ( { pageContent : "Another document for compatibility" } ) ,
440440 ] ) ;
441441
442442 const results = await store . similaritySearch ( "testing" , 2 ) ;
443443
444444 expect ( results ) . toHaveLength ( 2 ) ;
445445 expect ( results [ 0 ] ) . toBeInstanceOf ( Document ) ;
446-
447- const indexSettings = await client . indices . getSettings ( {
448- index : indexName ,
449- } ) ;
450- expect (
451- indexSettings [ indexName ] . settings ?. index ?. mapping ?. exclude_source_vectors
452- ) . toBe ( "false" ) ;
453446 } ) ;
454447
455- test . skip ( "Hybrid search with excludeSourceVectors undefined uses ES defaults" , async ( ) => {
456- const indexName = "test_es_default_exclude " ;
448+ test . skip ( "Hybrid search with includeSourceVectors undefined uses ES defaults" , async ( ) => {
449+ const indexName = "test_es_default_include " ;
457450 const store = new ElasticVectorSearch ( embeddings , {
458451 client,
459452 indexName,
@@ -471,13 +464,13 @@ describe("ElasticVectorSearch - ES 9.x Compatibility", () => {
471464 expect ( results [ 0 ] ) . toBeInstanceOf ( Document ) ;
472465 } ) ;
473466
474- test . skip ( "Pure vector search with excludeSourceVectors for ES 9.x " , async ( ) => {
467+ test . skip ( "Pure vector search with includeSourceVectors for ES 9.2+ " , async ( ) => {
475468 const indexName = "test_es9_pure_vector" ;
476469 const store = new ElasticVectorSearch ( embeddings , {
477470 client,
478471 indexName,
479472 strategy : new HybridRetrievalStrategy ( {
480- excludeSourceVectors : false ,
473+ includeSourceVectors : true ,
481474 } ) ,
482475 } ) ;
483476 await store . deleteIfExists ( ) ;
0 commit comments