Skip to content

Commit a83046a

Browse files
authored
Fixing span gap builder tests (#114218) (#114219)
With #113251 having a SpanMatchNoDocsQuery is a valid response to the rewrite. closes #114218
1 parent 67f1b02 commit a83046a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,6 @@ tests:
371371
issue: https://github.com/elastic/elasticsearch/issues/114187
372372
- class: org.elasticsearch.xpack.esql.action.EsqlActionBreakerIT
373373
issue: https://github.com/elastic/elasticsearch/issues/114194
374-
- class: org.elasticsearch.index.query.SpanGapQueryBuilderTests
375-
method: testToQuery
376-
issue: https://github.com/elastic/elasticsearch/issues/114218
377374
- class: org.elasticsearch.xpack.ilm.ExplainLifecycleIT
378375
method: testStepInfoPreservedOnAutoRetry
379376
issue: https://github.com/elastic/elasticsearch/issues/114220

server/src/test/java/org/elasticsearch/index/query/SpanGapQueryBuilderTests.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import org.apache.lucene.queries.spans.SpanQuery;
1414
import org.apache.lucene.queries.spans.SpanTermQuery;
1515
import org.apache.lucene.search.Query;
16+
import org.elasticsearch.lucene.queries.SpanMatchNoDocsQuery;
1617
import org.elasticsearch.test.AbstractQueryTestCase;
1718

1819
import java.io.IOException;
@@ -50,7 +51,9 @@ protected SpanNearQueryBuilder doCreateTestQueryBuilder() {
5051
protected void doAssertLuceneQuery(SpanNearQueryBuilder queryBuilder, Query query, SearchExecutionContext context) throws IOException {
5152
assertThat(
5253
query,
53-
either(instanceOf(SpanNearQuery.class)).or(instanceOf(SpanTermQuery.class)).or(instanceOf(MatchAllQueryBuilder.class))
54+
either(instanceOf(SpanNearQuery.class)).or(instanceOf(SpanTermQuery.class))
55+
.or(instanceOf(MatchAllQueryBuilder.class))
56+
.or(instanceOf(SpanMatchNoDocsQuery.class))
5457
);
5558
if (query instanceof SpanNearQuery spanNearQuery) {
5659
assertThat(spanNearQuery.getSlop(), equalTo(queryBuilder.slop()));

0 commit comments

Comments
 (0)