docs: def get_field(name, data, default="object", document_object_field=None, is_document=False):
      """
      Return a valid Field by given data
      """
      if isinstance(data, AbstractField):
          return data
      data = keys_to_string(data)
      _type = data.get('type', default)
      if _type == "string":
          return StringField(name=name, **data)
      elif _type == "binary":
          return BinaryField(name=name, **data)
      elif _type == "boolean":
          return BooleanField(name=name, **data)
      elif _type == "byte":
          return ByteField(name=name, **data)
      elif _type == "short":
          return ShortField(name=name, **data)
      elif _type == "integer":
          return IntegerField(name=name, **data)
      elif _type == "long":
          return LongField(name=name, **data)
      elif _type == "float":
          return FloatField(name=name, **data)
      elif _type == "double":
          return DoubleField(name=name, **data)
      elif _type == "ip":
          return IpField(name=name, **data)
      elif _type == "date":
          return DateField(name=name, **data)
      elif _type == "multi_field":
          return MultiField(name=name, **data)
      elif _type == "geo_point":
          return GeoPointField(name=name, **data)
      elif _type == "attachment":
          return AttachmentField(name=name, **data)
      elif is_document or _type == "document":
          if document_object_field:
              return document_object_field(name=name, **data)
          else:
              data.pop("name",None)
              return DocumentObjectField(name=name, **data)
  
      elif _type == "object":
          if '_timestamp' in data or "_all" in data:
              if document_object_field:
                  return document_object_field(name=name, **data)
              else:
                  return DocumentObjectField(name=name, **data)
  
          return ObjectField(name=name, **data)
      elif _type == "nested":
          return NestedObject(name=name, **data)
      raise RuntimeError("Invalid type: %s" % _type)