test: fix docCount to only use the source builder in SearchRequestBuilder and don't use also the source on SearchRequest
Original commit: elastic/x-pack-elasticsearch@0ffcf0c5ff
This commit is contained in:
parent
06ec935a08
commit
a65d1e3d58
|
@ -49,6 +49,10 @@ public class TimeThrottleIntegrationTests extends AbstractWatcherIntegrationTest
|
||||||
return eventIndexResponse;
|
return eventIndexResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean enableShield() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
||||||
|
|
|
@ -255,11 +255,11 @@ public abstract class AbstractWatcherIntegrationTestCase extends ESIntegTestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long docCount(String index, String type, SearchSourceBuilder source) {
|
protected long docCount(String index, String type, SearchSourceBuilder source) {
|
||||||
SearchRequestBuilder builder = client().prepareSearch(index).setSize(0);
|
SearchRequestBuilder builder = client().prepareSearch(index)
|
||||||
|
.internalBuilder(source).setSize(0);
|
||||||
if (type != null) {
|
if (type != null) {
|
||||||
builder.setTypes(type);
|
builder.setTypes(type);
|
||||||
}
|
}
|
||||||
builder.setSource(source.buildAsBytes());
|
|
||||||
return builder.get().getHits().getTotalHits();
|
return builder.get().getHits().getTotalHits();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue