@@ -159,7 +159,7 @@ public void testFilterNoop() throws Exception {
159159 new BulkItemRequest [0 ]
160160 );
161161 request .setInferenceFieldMap (
162- Map .of ("foo" , new InferenceFieldMetadata ("foo" , "bar" , "baz" , generateRandomStringArray (5 , 10 , false , false ), null ))
162+ Map .of ("foo" , new InferenceFieldMetadata ("foo" , "bar" , "baz" , generateRandomStringArray (5 , 10 , false , false ), null , null ))
163163 );
164164 filter .apply (task , TransportShardBulkAction .ACTION_NAME , request , actionListener , actionFilterChain );
165165 awaitLatch (chainExecuted , 10 , TimeUnit .SECONDS );
@@ -192,7 +192,7 @@ public void testLicenseInvalidForInference() throws InterruptedException {
192192
193193 Map <String , InferenceFieldMetadata > inferenceFieldMap = Map .of (
194194 "obj.field1" ,
195- new InferenceFieldMetadata ("obj.field1" , model .getInferenceEntityId (), new String [] { "obj.field1" }, null )
195+ new InferenceFieldMetadata ("obj.field1" , model .getInferenceEntityId (), new String [] { "obj.field1" }, null , null )
196196 );
197197 BulkItemRequest [] items = new BulkItemRequest [1 ];
198198 items [0 ] = new BulkItemRequest (0 , new IndexRequest ("test" ).source ("obj.field1" , "Test" ));
@@ -233,11 +233,11 @@ public void testInferenceNotFound() throws Exception {
233233
234234 Map <String , InferenceFieldMetadata > inferenceFieldMap = Map .of (
235235 "field1" ,
236- new InferenceFieldMetadata ("field1" , model .getInferenceEntityId (), new String [] { "field1" }, null ),
236+ new InferenceFieldMetadata ("field1" , model .getInferenceEntityId (), new String [] { "field1" }, null , null ),
237237 "field2" ,
238- new InferenceFieldMetadata ("field2" , "inference_0" , new String [] { "field2" }, null ),
238+ new InferenceFieldMetadata ("field2" , "inference_0" , new String [] { "field2" }, null , null ),
239239 "field3" ,
240- new InferenceFieldMetadata ("field3" , "inference_0" , new String [] { "field3" }, null )
240+ new InferenceFieldMetadata ("field3" , "inference_0" , new String [] { "field3" }, null , null )
241241 );
242242 BulkItemRequest [] items = new BulkItemRequest [10 ];
243243 for (int i = 0 ; i < items .length ; i ++) {
@@ -306,7 +306,7 @@ public void testItemFailures() throws Exception {
306306
307307 Map <String , InferenceFieldMetadata > inferenceFieldMap = Map .of (
308308 "field1" ,
309- new InferenceFieldMetadata ("field1" , model .getInferenceEntityId (), new String [] { "field1" }, null )
309+ new InferenceFieldMetadata ("field1" , model .getInferenceEntityId (), new String [] { "field1" }, null , null )
310310 );
311311 BulkItemRequest [] items = new BulkItemRequest [3 ];
312312 items [0 ] = new BulkItemRequest (0 , new IndexRequest ("index" ).source ("field1" , "I am a failure" ));
@@ -375,7 +375,7 @@ public void testExplicitNull() throws Exception {
375375
376376 Map <String , InferenceFieldMetadata > inferenceFieldMap = Map .of (
377377 "obj.field1" ,
378- new InferenceFieldMetadata ("obj.field1" , model .getInferenceEntityId (), new String [] { "obj.field1" }, null )
378+ new InferenceFieldMetadata ("obj.field1" , model .getInferenceEntityId (), new String [] { "obj.field1" }, null , null )
379379 );
380380 Map <String , Object > sourceWithNull = new HashMap <>();
381381 sourceWithNull .put ("field1" , null );
@@ -432,7 +432,13 @@ public void testHandleEmptyInput() throws Exception {
432432 Task task = mock (Task .class );
433433 Map <String , InferenceFieldMetadata > inferenceFieldMap = Map .of (
434434 "semantic_text_field" ,
435- new InferenceFieldMetadata ("semantic_text_field" , model .getInferenceEntityId (), new String [] { "semantic_text_field" }, null )
435+ new InferenceFieldMetadata (
436+ "semantic_text_field" ,
437+ model .getInferenceEntityId (),
438+ new String [] { "semantic_text_field" },
439+ null ,
440+ null
441+ )
436442 );
437443
438444 BulkItemRequest [] items = new BulkItemRequest [3 ];
@@ -459,7 +465,7 @@ public void testManyRandomDocs() throws Exception {
459465 for (int i = 0 ; i < numInferenceFields ; i ++) {
460466 String field = randomAlphaOfLengthBetween (5 , 10 );
461467 String inferenceId = randomFrom (inferenceModelMap .keySet ());
462- inferenceFieldMap .put (field , new InferenceFieldMetadata (field , inferenceId , new String [] { field }, null ));
468+ inferenceFieldMap .put (field , new InferenceFieldMetadata (field , inferenceId , new String [] { field }, null , null ));
463469 }
464470
465471 int numRequests = atLeast (100 );
@@ -538,7 +544,9 @@ public void testIndexingPressure() throws Exception {
538544 addSemanticTextInferenceResults (
539545 useLegacyFormat ,
540546 doc5Source ,
541- List .of (randomSemanticText (useLegacyFormat , "sparse_field" , sparseModel , null , List .of ("a test value" ), XContentType .JSON ))
547+ List .of (
548+ randomSemanticText (useLegacyFormat , "sparse_field" , sparseModel , null , null , List .of ("a test value" ), XContentType .JSON )
549+ )
542550 );
543551 doc5Source .endObject ();
544552 }
@@ -587,9 +595,9 @@ public void testIndexingPressure() throws Exception {
587595
588596 Map <String , InferenceFieldMetadata > inferenceFieldMap = Map .of (
589597 "sparse_field" ,
590- new InferenceFieldMetadata ("sparse_field" , sparseModel .getInferenceEntityId (), new String [] { "sparse_field" }, null ),
598+ new InferenceFieldMetadata ("sparse_field" , sparseModel .getInferenceEntityId (), new String [] { "sparse_field" }, null , null ),
591599 "dense_field" ,
592- new InferenceFieldMetadata ("dense_field" , denseModel .getInferenceEntityId (), new String [] { "dense_field" }, null )
600+ new InferenceFieldMetadata ("dense_field" , denseModel .getInferenceEntityId (), new String [] { "dense_field" }, null , null )
593601 );
594602
595603 BulkItemRequest [] items = new BulkItemRequest [10 ];
@@ -677,7 +685,7 @@ public void testIndexingPressureTripsOnInferenceRequestGeneration() throws Excep
677685
678686 Map <String , InferenceFieldMetadata > inferenceFieldMap = Map .of (
679687 "sparse_field" ,
680- new InferenceFieldMetadata ("sparse_field" , sparseModel .getInferenceEntityId (), new String [] { "sparse_field" }, null )
688+ new InferenceFieldMetadata ("sparse_field" , sparseModel .getInferenceEntityId (), new String [] { "sparse_field" }, null , null )
681689 );
682690
683691 BulkItemRequest [] items = new BulkItemRequest [3 ];
@@ -758,7 +766,7 @@ public void testIndexingPressureTripsOnInferenceResponseHandling() throws Except
758766
759767 Map <String , InferenceFieldMetadata > inferenceFieldMap = Map .of (
760768 "sparse_field" ,
761- new InferenceFieldMetadata ("sparse_field" , sparseModel .getInferenceEntityId (), new String [] { "sparse_field" }, null )
769+ new InferenceFieldMetadata ("sparse_field" , sparseModel .getInferenceEntityId (), new String [] { "sparse_field" }, null , null )
762770 );
763771
764772 BulkItemRequest [] items = new BulkItemRequest [3 ];
@@ -794,6 +802,7 @@ public void testIndexingPressurePartialFailure() throws Exception {
794802 "sparse_field" ,
795803 sparseModel ,
796804 null ,
805+ null ,
797806 inputs ,
798807 inference ,
799808 XContentType .JSON
@@ -868,7 +877,7 @@ public void testIndexingPressurePartialFailure() throws Exception {
868877
869878 Map <String , InferenceFieldMetadata > inferenceFieldMap = Map .of (
870879 "sparse_field" ,
871- new InferenceFieldMetadata ("sparse_field" , sparseModel .getInferenceEntityId (), new String [] { "sparse_field" }, null )
880+ new InferenceFieldMetadata ("sparse_field" , sparseModel .getInferenceEntityId (), new String [] { "sparse_field" }, null , null )
872881 );
873882
874883 BulkItemRequest [] items = new BulkItemRequest [4 ];
@@ -1032,13 +1041,14 @@ private static BulkItemRequest[] randomBulkItemRequest(
10321041 field ,
10331042 model ,
10341043 null ,
1044+ null ,
10351045 List .of (inputText ),
10361046 results ,
10371047 requestContentType
10381048 );
10391049 } else {
10401050 Map <String , List <String >> inputTextMap = Map .of (field , List .of (inputText ));
1041- semanticTextField = randomSemanticText (useLegacyFormat , field , model , null , List .of (inputText ), requestContentType );
1051+ semanticTextField = randomSemanticText (useLegacyFormat , field , model , null , null , List .of (inputText ), requestContentType );
10421052 model .putResult (inputText , toChunkedResult (useLegacyFormat , inputTextMap , semanticTextField ));
10431053 }
10441054
0 commit comments