Original commit: elastic/x-pack-elasticsearch@ab0e5c45ef
This commit is contained in:
Simon Willnauer 2017-07-19 10:48:05 +02:00
parent ac46b0b0a5
commit aeed4cb3e4
2 changed files with 3 additions and 3 deletions

View File

@ -358,8 +358,8 @@ public class SecurityIndexSearcherWrapper extends IndexSearcherWrapper {
throw new IllegalStateException("role queries are not allowed to execute additional requests");
}
};
QueryRewriteContext copy = new QueryRewriteContext(original.getIndexSettings(), original.getMapperService(), scriptService,
original.getXContentRegistry(), client, original.getIndexReader(), original::nowInMillis);
QueryRewriteContext copy = new QueryRewriteContext(
original.getXContentRegistry(), client, original::nowInMillis);
queryBuilder.rewrite(copy);
}
}

View File

@ -679,7 +679,7 @@ public class SecurityIndexSearcherWrapperUnitTests extends ESTestCase {
Client client = mock(Client.class);
when(client.settings()).thenReturn(Settings.EMPTY);
final long nowInMillis = randomNonNegativeLong();
QueryRewriteContext context = new QueryRewriteContext(null, null, scriptService, xContentRegistry(), client, null,
QueryRewriteContext context = new QueryRewriteContext(xContentRegistry(), client,
() -> nowInMillis);
QueryBuilder queryBuilder1 = new TermsQueryBuilder("field", "val1", "val2");
SecurityIndexSearcherWrapper.failIfQueryUsesClient(scriptService, queryBuilder1, context);