IP - 推断的 .NET 类型映射 elasticsearch

IP - Inferred .NET type mapping elasticsearch

我已阅读此文档 inferred .net type mapping 并注意到有一个“ip_range”但没有“ip”。我创建了一个当前数据类型为 String 的模型 class。我可以使用 C# 中的特定 IP 数据类型吗?或者我应该将其保留为数据类型的字符串吗?

在 C# 中我有,public String Ip { get; set; }

没有隐式或推断映射到 ip 数据类型的类型。选项是

  1. 使用 fluent mapping.Ip(...) 方法显式映射
  2. 使用 attribute mappingIpAttribute
  3. 显式映射
  4. 使用 the visitor pattern
  5. 显式映射
  6. dynamically map using dynamic templates,可能是通过匹配类型和名称模式