// filter out documents that do not match the name test
if (nameTest != null) {
Query nameQuery = new NameQuery(nameTest, version, nsMappings);
Hits nameHits = new ScorerHits(nameQuery.weight(searcher).scorer(reader, true, false));
for (int i = hits.nextSetBit(0); i >= 0; i = hits.nextSetBit(i + 1)) {
int doc = nameHits.skipTo(i);
if (doc == -1) {
// no more name tests, clear remaining
hits.clear(i, hits.length());
} else {
// assert doc >= i