[Test] #27342 Fix SearchRequests#testValidate
This commit is contained in:
parent
9f43d7329b
commit
bec5d43228
|
@ -91,8 +91,10 @@ public class SearchRequestTests extends AbstractSearchTestCase {
|
||||||
assertNull(validationErrors);
|
assertNull(validationErrors);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
// disabeling `track_total_hits` isn't valid in scroll context
|
// disabling `track_total_hits` isn't valid in scroll context
|
||||||
SearchRequest searchRequest = createSearchRequest().source(new SearchSourceBuilder());
|
SearchRequest searchRequest = createSearchRequest().source(new SearchSourceBuilder());
|
||||||
|
// make sure we don't set the request cache for a scroll query
|
||||||
|
searchRequest.requestCache(false);
|
||||||
searchRequest.scroll(new TimeValue(1000));
|
searchRequest.scroll(new TimeValue(1000));
|
||||||
searchRequest.source().trackTotalHits(false);
|
searchRequest.source().trackTotalHits(false);
|
||||||
ActionRequestValidationException validationErrors = searchRequest.validate();
|
ActionRequestValidationException validationErrors = searchRequest.validate();
|
||||||
|
@ -103,6 +105,8 @@ public class SearchRequestTests extends AbstractSearchTestCase {
|
||||||
{
|
{
|
||||||
// scroll and `from` isn't valid
|
// scroll and `from` isn't valid
|
||||||
SearchRequest searchRequest = createSearchRequest().source(new SearchSourceBuilder());
|
SearchRequest searchRequest = createSearchRequest().source(new SearchSourceBuilder());
|
||||||
|
// make sure we don't set the request cache for a scroll query
|
||||||
|
searchRequest.requestCache(false);
|
||||||
searchRequest.scroll(new TimeValue(1000));
|
searchRequest.scroll(new TimeValue(1000));
|
||||||
searchRequest.source().from(10);
|
searchRequest.source().from(10);
|
||||||
ActionRequestValidationException validationErrors = searchRequest.validate();
|
ActionRequestValidationException validationErrors = searchRequest.validate();
|
||||||
|
|
Loading…
Reference in New Issue