File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed 
x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/parser Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -3714,6 +3714,18 @@ public void testRerankDefaultInferenceIdAndScoreAttribute() {
37143714        assertThat (rerank .rerankFields (), equalTo (List .of (alias ("title" , attribute ("title" )))));
37153715    }
37163716
3717+     public  void  testRerankEmptyOptions () {
3718+         assumeTrue ("RERANK requires corresponding capability" , EsqlCapabilities .Cap .RERANK .isEnabled ());
3719+ 
3720+         var  plan  = processingCommand ("RERANK \" query text\"  ON title WITH {}" );
3721+         var  rerank  = as (plan , Rerank .class );
3722+ 
3723+         assertThat (rerank .inferenceId (), equalTo (literalString (".rerank-v1-elasticsearch" )));
3724+         assertThat (rerank .scoreAttribute (), equalTo (attribute ("_score" )));
3725+         assertThat (rerank .queryText (), equalTo (literalString ("query text" )));
3726+         assertThat (rerank .rerankFields (), equalTo (List .of (alias ("title" , attribute ("title" )))));
3727+     }
3728+ 
37173729    public  void  testRerankInferenceId () {
37183730        assumeTrue ("RERANK requires corresponding capability" , EsqlCapabilities .Cap .RERANK .isEnabled ());
37193731
@@ -3871,7 +3883,6 @@ public void testCompletionMissingOptions() {
38713883    }
38723884
38733885    public  void  testCompletionEmptyOptions () {
3874-         // TODO: fix the grammar to allow empty mapExpression. Then we should have a more explicit error message. 
38753886        expectError (
38763887            "FROM foo* | COMPLETION targetField = prompt WITH { }" ,
38773888            "line 1:45: Missing mandatory option [inference_id] in COMPLETION" 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments