Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
kderusso committed Mar 4, 2024
1 parent 2710d23 commit 0a0ef48
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.elasticsearch.common.compress.CompressedXContent;
import org.elasticsearch.index.mapper.MapperService;
import org.elasticsearch.index.mapper.extras.MapperExtrasPlugin;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.SearchExecutionContext;
import org.elasticsearch.plugins.Plugin;
Expand Down Expand Up @@ -259,6 +260,10 @@ public void testThatTokensAreCorrectlyPruned() {
SearchExecutionContext searchExecutionContext = createSearchExecutionContext();
TextExpansionQueryBuilder queryBuilder = createTestQueryBuilder();
QueryBuilder rewrittenQueryBuilder = rewriteAndFetch(queryBuilder, searchExecutionContext);
assertTrue(rewrittenQueryBuilder instanceof WeightedTokensQueryBuilder);
if (queryBuilder.getTokenPruningConfig() == null) {
assertTrue(rewrittenQueryBuilder instanceof BoolQueryBuilder);
} else {
assertTrue(rewrittenQueryBuilder instanceof WeightedTokensQueryBuilder);
}
}
}

0 comments on commit 0a0ef48

Please sign in to comment.