@@ -641,8 +641,29 @@ setup:
641641
642642---
643643" Query multiple indices " :
644+ - requires :
645+ cluster_features : " semantic_query.multiple_inference_ids"
646+ reason : Semantic query support for querying multiple inference IDs
647+
648+ - do :
649+ index :
650+ index : test-sparse-index
651+ id : doc_1
652+ body :
653+ inference_field : [ "inference test", "another inference test" ]
654+ non_inference_field : " non inference test"
655+ refresh : true
656+
657+ - do :
658+ index :
659+ index : test-dense-index
660+ id : doc_2
661+ body :
662+ inference_field : [ "inference test", "another inference test" ]
663+ non_inference_field : " non inference test"
664+ refresh : true
665+
644666 - do :
645- catch : bad_request
646667 search :
647668 index :
648669 - test-sparse-index
@@ -653,12 +674,12 @@ setup:
653674 field : " inference_field"
654675 query : " inference test"
655676
656- - match : { error.type: "illegal_argument_exception" }
657- - match : { error.reason: "Field [inference_field] has multiple inference IDs associated with it" }
677+ - match : { hits.total.value: 2 }
678+ - match : { hits.hits.0._id: "doc_1" }
679+ - match : { hits.hits.1._id: "doc_2" }
658680
659681 # Test wildcard resolution
660682 - do :
661- catch : bad_request
662683 search :
663684 index : test-*
664685 body :
@@ -667,8 +688,9 @@ setup:
667688 field : " inference_field"
668689 query : " inference test"
669690
670- - match : { error.type: "illegal_argument_exception" }
671- - match : { error.reason: "Field [inference_field] has multiple inference IDs associated with it" }
691+ - match : { hits.total.value: 2 }
692+ - match : { hits.hits.0._id: "doc_1" }
693+ - match : { hits.hits.1._id: "doc_2" }
672694
673695 # Test querying an index alias that resolves to multiple indices
674696 - do :
@@ -679,7 +701,6 @@ setup:
679701 name : my-alias
680702
681703 - do :
682- catch : bad_request
683704 search :
684705 index : my-alias
685706 body :
@@ -688,10 +709,11 @@ setup:
688709 field : " inference_field"
689710 query : " inference test"
690711
691- - match : { error.type: "illegal_argument_exception" }
692- - match : { error.reason: "Field [inference_field] has multiple inference IDs associated with it" }
712+ - match : { hits.total.value: 2 }
713+ - match : { hits.hits.0._id: "doc_1" }
714+ - match : { hits.hits.1._id: "doc_2" }
693715
694- # Test querying multiple indices that use the same inference ID - this should work
716+ # Test querying multiple indices that use the same inference ID
695717 - do :
696718 indices.create :
697719 index : test-sparse-index-2
@@ -704,18 +726,10 @@ setup:
704726 non_inference_field :
705727 type : text
706728
707- - do :
708- index :
709- index : test-sparse-index
710- id : doc_1
711- body :
712- inference_field : " inference test"
713- refresh : true
714-
715729 - do :
716730 index :
717731 index : test-sparse-index-2
718- id : doc_2
732+ id : doc_3
719733 body :
720734 inference_field : " another inference test"
721735 refresh : true
@@ -730,8 +744,8 @@ setup:
730744 query : " inference test"
731745
732746 - match : { hits.total.value: 2 }
733- - match : { hits.hits.0._id: "doc_2 " }
734- - match : { hits.hits.1._id: "doc_1 " }
747+ - match : { hits.hits.0._id: "doc_1 " }
748+ - match : { hits.hits.1._id: "doc_3 " }
735749
736750---
737751" Query a field that has no indexed inference results " :
0 commit comments