diff --git a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/authz/accesscontrol/SecurityIndexSearcherWrapperUnitTests.java b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/authz/accesscontrol/SecurityIndexSearcherWrapperUnitTests.java index 885aba2f0f6..edfce32992a 100644 --- a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/authz/accesscontrol/SecurityIndexSearcherWrapperUnitTests.java +++ b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/authz/accesscontrol/SecurityIndexSearcherWrapperUnitTests.java @@ -351,7 +351,6 @@ public class SecurityIndexSearcherWrapperUnitTests extends ESTestCase { Weight weight = searcher.createNormalizedWeight(new TermQuery(new Term("field2", "value1")), false); LeafReaderContext leaf = directoryReader.leaves().get(0); - Scorer scorer = weight.scorer(leaf); SparseFixedBitSet sparseFixedBitSet = query(leaf, "field1", "value1"); LeafCollector leafCollector = new LeafBucketCollector() { @@ -360,7 +359,7 @@ public class SecurityIndexSearcherWrapperUnitTests extends ESTestCase { assertThat(doc, equalTo(0)); } }; - intersectScorerAndRoleBits(scorer, sparseFixedBitSet, leafCollector, leaf.reader().getLiveDocs()); + intersectScorerAndRoleBits(weight.scorer(leaf), sparseFixedBitSet, leafCollector, leaf.reader().getLiveDocs()); sparseFixedBitSet = query(leaf, "field1", "value2"); leafCollector = new LeafBucketCollector() { @@ -369,7 +368,7 @@ public class SecurityIndexSearcherWrapperUnitTests extends ESTestCase { assertThat(doc, equalTo(1)); } }; - intersectScorerAndRoleBits(scorer, sparseFixedBitSet, leafCollector, leaf.reader().getLiveDocs()); + intersectScorerAndRoleBits(weight.scorer(leaf), sparseFixedBitSet, leafCollector, leaf.reader().getLiveDocs()); sparseFixedBitSet = query(leaf, "field1", "value3"); @@ -379,7 +378,7 @@ public class SecurityIndexSearcherWrapperUnitTests extends ESTestCase { fail("docId [" + doc + "] should have been deleted"); } }; - intersectScorerAndRoleBits(scorer, sparseFixedBitSet, leafCollector, leaf.reader().getLiveDocs()); + intersectScorerAndRoleBits(weight.scorer(leaf), sparseFixedBitSet, leafCollector, leaf.reader().getLiveDocs()); sparseFixedBitSet = query(leaf, "field1", "value4"); leafCollector = new LeafBucketCollector() { @@ -388,7 +387,7 @@ public class SecurityIndexSearcherWrapperUnitTests extends ESTestCase { assertThat(doc, equalTo(3)); } }; - intersectScorerAndRoleBits(scorer, sparseFixedBitSet, leafCollector, leaf.reader().getLiveDocs()); + intersectScorerAndRoleBits(weight.scorer(leaf), sparseFixedBitSet, leafCollector, leaf.reader().getLiveDocs()); directoryReader.close(); directory.close();