Noob at ElasticSearch and Nest here. Not exactly sure what I am doing wrong here, but this code throws up
"Malformed action/metadata line [1], expected START_OBJECT or END_OBJECT but found [VALUE_NUMBER]".
I know ES is throwing this error because JSON is malformed. What I don't know is why Nest isn't generating the right JSON?
Note: I want to be able to do a bulk index operation while telling it which index and type this payload should go to.
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);
}
}