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"); throw new IllegalStateException("role queries are not allowed to execute additional requests");
} }
}; };
QueryRewriteContext copy = new QueryRewriteContext(original.getIndexSettings(), original.getMapperService(), scriptService, QueryRewriteContext copy = new QueryRewriteContext(
original.getXContentRegistry(), client, original.getIndexReader(), original::nowInMillis); original.getXContentRegistry(), client, original::nowInMillis);
queryBuilder.rewrite(copy); queryBuilder.rewrite(copy);
} }
} }

View File

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