I'm very much a newbie, tasked with upgrading an older service
Given
private static ElasticClient ClientCreate(Uri uri)
{
var e = new Nest.ElasticClient(new ConnectionSettings(uri));
return e;
}
This is no longer valid syntax :
public void AlertSave(Alert alert)
{
var c = ClientCreate(_uri);
c.Index(alert,_indexName );
}
public void AlertDelete(Alert alert)
{
var c = ClientCreate(_uri);
c.Delete(alert,_indexName);
}
I got round it by creating the client with a default index - is this a sensible approach? is there a better one?
private static ElasticClient ClientCreate(Uri uri, string index)
{
var e = new Nest.ElasticClient(new ConnectionSettings(uri).DefaultIndex(index));
return e;
}
public void AlertSave(Alert alert)
{
var c = ClientCreate(_uri, _indexName);
c.Index(alert);
}
etc