code: @Override
    public int advance(int target) throws IOException {
      reset();
      if (docId == NO_MORE_DOCS) {
        return docId;
      } else if (target <= docId) {
        // should not happen
        docId = NO_MORE_DOCS;
        return docId;
      } else {
        docId = subSpans.advance(target);
        if (docId == NO_MORE_DOCS) {
          return docId;
        } else {
          IndexDoc doc = mtasCodecInfo.getDoc(field, docId);
          if (doc != null) {
            minPosition = doc.minPosition;
            maxPosition = doc.maxPosition;
          } else {
            minPosition = NO_MORE_POSITIONS;
            maxPosition = NO_MORE_POSITIONS;
          }
          if (goToNextStartPosition()) {
            return docId;
          } else {
            return nextDoc();
          }
        }
      }
    }
docs: /*
  (non-Javadoc)
  
  @see org.apache.lucene.search.DocIdSetIterator#advance(int)