Skip to content

Commit f94faeb

Browse files
committed
Add check to MatchPhrase tests
1 parent 6983392 commit f94faeb

File tree

1 file changed

+7
-0
lines changed
  • x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/fulltext

1 file changed

+7
-0
lines changed

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/fulltext/MatchPhraseTests.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
1212

1313
import org.elasticsearch.index.query.QueryBuilder;
14+
import org.elasticsearch.xpack.esql.action.EsqlCapabilities;
1415
import org.elasticsearch.xpack.esql.core.expression.Expression;
1516
import org.elasticsearch.xpack.esql.core.expression.FieldAttribute;
1617
import org.elasticsearch.xpack.esql.core.expression.Literal;
@@ -22,6 +23,7 @@
2223
import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier;
2324
import org.elasticsearch.xpack.esql.io.stream.PlanStreamOutput;
2425
import org.elasticsearch.xpack.esql.optimizer.rules.physical.local.LucenePushdownPredicates;
26+
import org.junit.Before;
2527

2628
import java.util.ArrayList;
2729
import java.util.List;
@@ -39,6 +41,11 @@
3941
@FunctionName("match_phrase")
4042
public class MatchPhraseTests extends AbstractFunctionTestCase {
4143

44+
@Before
45+
public void checkCapability() {
46+
assumeTrue("MatchPhrase is not supported in this version of ESQL", EsqlCapabilities.Cap.MATCH_PHRASE_FUNCTION.isEnabled());
47+
}
48+
4249
public MatchPhraseTests(@Name("TestCase") Supplier<TestCaseSupplier.TestCase> testCaseSupplier) {
4350
this.testCase = testCaseSupplier.get();
4451
}

0 commit comments

Comments
 (0)