Skip to content

Commit 716565b

Browse files
committed
Add guards for match options based on capability
1 parent cd9a2c2 commit 716565b

File tree

1 file changed

+3
-2
lines changed
  • x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/fulltext

1 file changed

+3
-2
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/fulltext/Match.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.elasticsearch.common.io.stream.StreamOutput;
1515
import org.elasticsearch.common.unit.Fuzziness;
1616
import org.elasticsearch.index.query.QueryBuilder;
17+
import org.elasticsearch.xpack.esql.action.EsqlCapabilities;
1718
import org.elasticsearch.xpack.esql.capabilities.PostOptimizationVerificationAware;
1819
import org.elasticsearch.xpack.esql.common.Failure;
1920
import org.elasticsearch.xpack.esql.common.Failures;
@@ -226,7 +227,7 @@ protected TypeResolution resolveNonQueryParamTypes() {
226227
}
227228

228229
// TODO Extract common logic for validating options
229-
if (options() != null) {
230+
if (options() != null && EsqlCapabilities.Cap.MATCH_FUNCTION_OPTIONS.isEnabled()) {
230231
// MapExpression does not have a DataType associated with it
231232
resolution = isMapExpression(options(), sourceText(), SECOND);
232233
if (resolution.unresolved()) {
@@ -247,7 +248,7 @@ private Map<String, Object> parseOptions() throws InvalidArgumentException {
247248
// Match is lenient by default to avoid failing on incompatible types
248249
matchOptions.put(LENIENT_FIELD.getPreferredName(), true);
249250

250-
if (options() == null) {
251+
if (options() == null || EsqlCapabilities.Cap.MATCH_FUNCTION_OPTIONS.isEnabled() == false) {
251252
return matchOptions;
252253
}
253254

0 commit comments

Comments
 (0)