@Override
    public Field getField(String fieldName) {
        Field field = content.getField(fieldName);
        if (field == null) {
            for(DocumentType parent : getDataType().getInheritedTypes()) {
                field = parent.getField(fieldName);
                if (field != null) {
                    break;
                }
            }
        }
        return field;
    }
This is an approximation of serialized size. We just set it to 4096 as a definition of a medium document.
@return Approximate size of document (4096)
document/src/main/java/com/yahoo/document/Document.java