@Override public Scorer scorer(LeafReaderContext context) throws IOException { SortedDocValues values = DocValues.getSorted(context.reader(), joinField); if (values == null) { return null; } Scorer approximationScorer = approximationWeight.scorer(context); if (approximationScorer == null) { return null; } if (globalOrds != null) { return new OrdinalMapScorer(this, score(), foundOrds, values, approximationScorer.iterator(), globalOrds.getGlobalOrds(context.ord)); } { return new SegmentOrdinalScorer(this, score(), foundOrds, values, approximationScorer.iterator()); } }