code: public int getMinStartPosition(int docId, int position) throws IOException {
      if (ignoreSpans != null && docId == currentDocId) {
        if (position < minimumPosition) {
          throw new IOException(
              "Unexpected position, should be >= " + minimumPosition + "!");
        } else {
          computeFullStartPositionMinimum(position);
          if (minFullStartPosition.containsKey(position)) {
            return minFullStartPosition.get(position);
          } else {
            return 0;
          }
        }
      } else {
        return 0;
      }
    }
docs: Gets the min start position.
  
  @param docId the doc id
  @param position the position
  @return the min start position
  @throws IOException Signals that an I/O exception has occurred.