2020import  org .elasticsearch .xpack .esql .core .type .InvalidMappedField ;
2121import  org .elasticsearch .xpack .esql .core .type .UnsupportedEsField ;
2222import  org .elasticsearch .xpack .esql .expression .function .fulltext .Match ;
23+ import  org .elasticsearch .xpack .esql .expression .function .fulltext .QueryString ;
2324import  org .elasticsearch .xpack .esql .index .EsIndex ;
2425import  org .elasticsearch .xpack .esql .index .IndexResolution ;
2526import  org .elasticsearch .xpack .esql .parser .EsqlParser ;
@@ -2180,7 +2181,7 @@ public void testQueryStringOptions() {
21802181
21812182        // Check all data types for available options 
21822183        DataType [] optionTypes  = new  DataType [] { INTEGER , LONG , FLOAT , DOUBLE , KEYWORD , BOOLEAN  };
2183-         for  (Map .Entry <String , DataType > allowedOptions  : Match .ALLOWED_OPTIONS .entrySet ()) {
2184+         for  (Map .Entry <String , DataType > allowedOptions  : QueryString .ALLOWED_OPTIONS .entrySet ()) {
21842185            String  optionName  = allowedOptions .getKey ();
21852186            DataType  optionType  = allowedOptions .getValue ();
21862187            // Check every possible type for the option - we'll try to convert it to the expected type 
@@ -2199,7 +2200,7 @@ public void testQueryStringOptions() {
21992200                    queryOptionValue  = "\" "  + optionValue  + "\" " ;
22002201                }
22012202
2202-                 String  query  = "FROM test | WHERE match(first_name,  \" Jean\" , {\" "  + optionName  + "\" : "  + queryOptionValue  + "})" ;
2203+                 String  query  = "FROM test | WHERE QSTR( \" first_name:  Jean\" , {\" "  + optionName  + "\" : "  + queryOptionValue  + "})" ;
22032204                try  {
22042205                    // Check conversion is possible 
22052206                    DataTypeConverter .convert (optionValue , optionType );
@@ -2210,7 +2211,7 @@ public void testQueryStringOptions() {
22102211                    assertEquals (
22112212                        "1:19: Invalid option [" 
22122213                            + optionName 
2213-                             + "] in [match(first_name,  \" Jean\" , {\" " 
2214+                             + "] in [QSTR( \" first_name:  Jean\" , {\" " 
22142215                            + optionName 
22152216                            + "\" : " 
22162217                            + queryOptionValue 
@@ -2226,9 +2227,9 @@ public void testQueryStringOptions() {
22262227        }
22272228
22282229        assertThat (
2229-             error ("FROM test | WHERE match(first_name,  \" Jean\" , {\" unknown_option\" : true})" ),
2230+             error ("FROM test |   WHERE QSTR( \" first_name:  Jean\" , {\" unknown_option\" : true})" ),
22302231            containsString (
2231-                 "1:19 : Invalid option [unknown_option] in [match(first_name,  \" Jean\" , {\" unknown_option\" : true})],"  + " expected one of " 
2232+                 "1:20 : Invalid option [unknown_option] in [QSTR( \" first_name:  Jean\" , {\" unknown_option\" : true})],"  + " expected one of " 
22322233            )
22332234        );
22342235    }
0 commit comments