|
23 | 23 | import java.util.LinkedHashSet;
|
24 | 24 | import java.util.List;
|
25 | 25 |
|
| 26 | +import static org.elasticsearch.action.search.SearchType.DFS_QUERY_THEN_FETCH; |
26 | 27 | import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
27 | 28 | import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
28 | 29 | import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFirstHit;
|
@@ -56,13 +57,12 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
|
56 | 57 | return plugins;
|
57 | 58 | }
|
58 | 59 |
|
59 |
| - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/46174") |
60 | 60 | public void testPinnedPromotions() throws Exception {
|
61 | 61 | assertAcked(prepareCreate("test")
|
62 | 62 | .addMapping("type1",
|
63 | 63 | jsonBuilder().startObject().startObject("type1").startObject("properties").startObject("field1")
|
64 | 64 | .field("analyzer", "whitespace").field("type", "text").endObject().endObject().endObject().endObject())
|
65 |
| - .setSettings(Settings.builder().put(indexSettings()).put("index.number_of_shards", 2))); |
| 65 | + .setSettings(Settings.builder().put(indexSettings()).put("index.number_of_shards", randomIntBetween(2, 5)))); |
66 | 66 |
|
67 | 67 | int numRelevantDocs = randomIntBetween(1, 100);
|
68 | 68 | for (int i = 0; i < numRelevantDocs; i++) {
|
@@ -102,6 +102,7 @@ public void testPinnedPromotions() throws Exception {
|
102 | 102 | int from = randomIntBetween(0, numRelevantDocs);
|
103 | 103 | int size = randomIntBetween(10, 100);
|
104 | 104 | SearchResponse searchResponse = client().prepareSearch().setQuery(pqb).setTrackTotalHits(true).setSize(size).setFrom(from)
|
| 105 | + .setSearchType(DFS_QUERY_THEN_FETCH) |
105 | 106 | .get();
|
106 | 107 |
|
107 | 108 | long numHits = searchResponse.getHits().getTotalHits().value;
|
|
0 commit comments