mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-18 02:44:49 +00:00
Always ceate index with mapping in test to ensure shards are available
This commit is contained in:
parent
dac2c559d4
commit
66cd74d2df
@ -745,6 +745,8 @@ public class SimpleQueryTests extends AbstractSharedClusterTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testEmptyTermsFilter() throws Exception {
|
public void testEmptyTermsFilter() throws Exception {
|
||||||
|
createIndexMapped("test", "type", "term", "string");
|
||||||
|
ensureGreen();
|
||||||
client().prepareIndex("test", "type", "1").setSource("term", "1").execute().actionGet();
|
client().prepareIndex("test", "type", "1").setSource("term", "1").execute().actionGet();
|
||||||
client().prepareIndex("test", "type", "2").setSource("term", "2").execute().actionGet();
|
client().prepareIndex("test", "type", "2").setSource("term", "2").execute().actionGet();
|
||||||
client().prepareIndex("test", "type", "3").setSource("term", "3").execute().actionGet();
|
client().prepareIndex("test", "type", "3").setSource("term", "3").execute().actionGet();
|
||||||
@ -753,13 +755,13 @@ public class SimpleQueryTests extends AbstractSharedClusterTest {
|
|||||||
SearchResponse searchResponse = client().prepareSearch("test")
|
SearchResponse searchResponse = client().prepareSearch("test")
|
||||||
.setQuery(filteredQuery(matchAllQuery(), termsFilter("term", new String[0]))
|
.setQuery(filteredQuery(matchAllQuery(), termsFilter("term", new String[0]))
|
||||||
).execute().actionGet();
|
).execute().actionGet();
|
||||||
assertThat("Failures " + Arrays.toString(searchResponse.getShardFailures()), searchResponse.getShardFailures().length, equalTo(0));
|
assertNoFailures(searchResponse);
|
||||||
assertThat(searchResponse.getHits().getTotalHits(), equalTo(0l));
|
assertThat(searchResponse.getHits().getTotalHits(), equalTo(0l));
|
||||||
|
|
||||||
searchResponse = client().prepareSearch("test")
|
searchResponse = client().prepareSearch("test")
|
||||||
.setQuery(filteredQuery(matchAllQuery(), idsFilter())
|
.setQuery(filteredQuery(matchAllQuery(), idsFilter())
|
||||||
).execute().actionGet();
|
).execute().actionGet();
|
||||||
assertThat("Failures " + Arrays.toString(searchResponse.getShardFailures()), searchResponse.getShardFailures().length, equalTo(0));
|
assertNoFailures(searchResponse);
|
||||||
assertThat(searchResponse.getHits().getTotalHits(), equalTo(0l));
|
assertThat(searchResponse.getHits().getTotalHits(), equalTo(0l));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user