菜鸟在ElasticSearch
和在这里筑巢。不完全知道我在做什么错在这里,但是这个代码抛出了
巢(Elasticsearch客户端C#)散货指数
“格式不正确动作/元数据线[1],预计START_OBJECT或END_OBJECT却发现[VALUE_NUMBER]”。
我知道ES正在抛出此错误,因为JSON is malformed
。我不知道为什么Nest不生成正确的JSON?
注:我希望能够做批量指数操作,同时告诉它哪个指数,并输入该有效载荷应该去。
public class Test
{
private static Uri _node;
private ElasticsearchClient _client;
static Test()
{
_node = new Uri("http://localhost:9200");
}
public Test()
{
_client = new ElasticsearchClient(new ConnectionSettings(_node));
}
public void Bulk<T>(List<T> data, string index, string type) where T : class
{
_client.Bulk(index, type, data);
}
}
你用什么版本NEST和ES的下面?你可以分享你想要索引的类型吗? – Rob