docs: @Override
    public SpanWeight createWeight(IndexSearcher searcher, boolean needsScores, float boost)
        throws IOException {
      final TermContext context;
      final IndexReaderContext topContext = searcher.getTopReaderContext();
      if (termContext == null) {
        context = TermContext.build(topContext, localTerm);
      } else {
        context = termContext;
      }
      return new SpanTermWeight(context, searcher,
          needsScores ? Collections.singletonMap(localTerm, context) : null, boost);
    }