private boolean processFieldDeref(
      Element fieldEl, String valueExpr, DerefValue deref, String derefPart)
      throws IndexerConfException, InterruptedException, RepositoryException {
    boolean lastFollowIsRecord;
    FieldType followField = getFieldType(derefPart, fieldEl);

    String type = followField.getValueType().getBaseName();
    if (type.equals("LIST")) {
      type = followField.getValueType().getNestedValueType().getBaseName();
    }

    if (type.equals("RECORD")) {
      deref.addRecordFieldFollow(followField);
      lastFollowIsRecord = true;
    } else if (type.equals("LINK")) {
      deref.addLinkFieldFollow(followField);
      lastFollowIsRecord = false;
    } else {
      throw new IndexerConfException(
          "Dereferencing is not possible on field of type "
              + followField.getValueType().getName()
              + ". Field: '"
              + derefPart
              + "', deref expression '"
              + valueExpr
              + "' at "
              + LocationAttributes.getLocation(fieldEl));
    }
    return lastFollowIsRecord;
  }