code: public TermDocs termDocs(Term term) throws IOException {
          if (term!=null && term.field() == FieldNames.UUID) {
              // check cache
              DocNumberCache.Entry e = cache.get(term.text());
              if (e != null) {
                  // check if valid:
                  // 1) reader must be in the set of readers
                  // 2) doc must not be deleted
                  OffsetReader offsetReader = (OffsetReader) readersByCreationTick.get(
                          new Long(e.creationTick));
                  if (offsetReader != null && !offsetReader.reader.isDeleted(e.doc)) {
                      return new SingleTermDocs(e.doc + offsetReader.offset);
                  }
              }
  
              // if we get here, entry is either invalid or did not exist
              // search through readers
              for (int i = 0; i < subReaders.length; i++) {
                  TermDocs docs = subReaders[i].termDocs(term);
                  try {
                      if (docs.next()) {
                          return new SingleTermDocs(docs.doc() + starts[i]);
                      }
                  } finally {
                      docs.close();
                  }
              }
          }
  
          return super.termDocs(term);
      }
docs: {@inheritDoc}