【发布时间】:2015-11-10 11:42:58
【问题描述】:
我在 C# 中有以下代码,可以正常工作:
class Person {
public DateTime time { get; set; }
public string id { get; set; }
public string name { get; set; }
public int age { get; set; }
}
...Main()
var node = new Uri("http://localhost:9200");
var settings = new ConnectionSettings(
node,
defaultIndex: "my-new-app"
);
var client = new ElasticClient(settings);
List<Person> people = new List<Person>();
for (int i = 0; i < 10; i++ )
{
people.Add(new Person() { age = 1, id = i.ToString(), name = string.Format("Name: {0}", i), time = DateTime.Now });
Thread.Sleep(500);
}
var index = client.Index(people);
但是当我尝试在 Kibana 中访问我的数据时:
1.
2.
3.
- JS 控制台出错:
有人知道为什么会发生这种情况吗?
【问题讨论】:
-
您使用的是哪个 Kibana/Elasticsearch 版本?我想这是一个兼容性问题。
-
Kibana 4.1.2 和 ElasticSearch 1.7.3
-
猜错了。我可以在您的屏幕截图中看到“type`1”;中间的反引号可能会破坏 JSON 解析。你能在你的 C# 代码中改变它吗?
-
能不能显示无法解析的全身?
标签: c# elasticsearch kibana nest kibana-4