2929import org .elasticsearch .xpack .esql .core .tree .NodeInfo ;
3030import org .elasticsearch .xpack .esql .core .tree .Source ;
3131import org .elasticsearch .xpack .esql .core .type .DataType ;
32- import org .elasticsearch .xpack .esql .core .type .MultiTypeEsField ;
3332import org .elasticsearch .xpack .esql .core .type .DataTypeConverter ;
33+ import org .elasticsearch .xpack .esql .core .type .MultiTypeEsField ;
3434import org .elasticsearch .xpack .esql .core .util .NumericUtils ;
3535import org .elasticsearch .xpack .esql .expression .function .Example ;
3636import org .elasticsearch .xpack .esql .expression .function .FunctionInfo ;
@@ -393,7 +393,7 @@ public String functionType() {
393393
394394 @ Override
395395 protected Query translate (TranslatorHandler handler ) {
396- Expression fieldExpression = field ;
396+ Expression fieldExpression = field () ;
397397 // Field may be converted to other data type (field_name :: data_type), so we need to check the original field
398398 if (fieldExpression instanceof AbstractConvertFunction convertFunction ) {
399399 fieldExpression = convertFunction .field ();
@@ -405,7 +405,7 @@ protected Query translate(TranslatorHandler handler) {
405405 fieldName = multiTypeEsField .getName ();
406406 }
407407 // Make query lenient so mixed field types can be queried when a field type is incompatible with the value provided
408- return new MatchQuery (source (), fieldName , queryAsObject (), Map . of ( "lenient" , "true" ));
408+ return new MatchQuery (source (), fieldName , queryAsObject (), optionsMap ( ));
409409 }
410410
411411 throw new IllegalArgumentException ("Match must have a field attribute as the first argument" );
0 commit comments