elasticsearch 使用nest获取elasticsearch中索引的字段列表,elasticsearch,nest,elasticsearch,Nest" /> elasticsearch 使用nest获取elasticsearch中索引的字段列表,elasticsearch,nest,elasticsearch,Nest" />

elasticsearch 使用nest获取elasticsearch中索引的字段列表

elasticsearch 使用nest获取elasticsearch中索引的字段列表,elasticsearch,nest,elasticsearch,Nest,我想得到一个字段列表,我可以使用nest在elasticsearch中查询某个索引 我知道我能做一件好事 获取映射 通过http,我或多或少得到了我想要的东西。但我有点被Nest难住了 我看了看报纸 Dim _client = New ElasticClient(setting) Dim mapping = _client.GetMapping(Function(x) x.Index(Of TexCaseElastic)()) 但我真的找不到路 我明白了。它在属性中 For Each s In

我想得到一个字段列表,我可以使用nest在elasticsearch中查询某个索引

我知道我能做一件好事

获取映射

通过http,我或多或少得到了我想要的东西。但我有点被Nest难住了

我看了看报纸

Dim _client = New ElasticClient(setting)
Dim mapping = _client.GetMapping(Function(x) x.Index(Of TexCaseElastic)())

但我真的找不到路

我明白了。它在属性中

For Each s In mapping.Mapping.Properties
  Console.WriteLine(s.Key.Name)
Next
其中,键的名称是字段的名称