从NEST调度Index()到Elasticsearch.NET失败

Mik*_*viv 2 c# elasticsearch nest

client.Index使用Nest和Elasticsearch.NET 时调用时出错

var httpConnection = new AwsHttpConnection(new AwsSettings
{
    AccessKey = "AKIAIFIV4LN6XZAFVX7Q",
    SecretKey = "MySecretKey",
    Region = "us-east-1",
});

var pool = new SingleNodeConnectionPool(new Uri(sSearchURI));
var config = new ConnectionSettings(pool, httpConnection);
var client = new ElasticClient(config);
var person = new Person
{
    Id = "1",
    Firstname = "Martijn",
    Lastname = "Laarman"
};
var index = client.Index(person);
Run Code Online (Sandbox Code Playgroud)

从NEST调度Index()到Elasticsearch.NET失败
接收标记为PUT的请求此端点接受POST,PUT请求可能没有提供足够的信息来生成任何这些端点:
- /{index}/{type}
- /{索引}/{类型}/{ID}

任何的想法?

cor*_*ore 7

您需要设置默认索引:

settings.DefaultIndex("indexName");
Run Code Online (Sandbox Code Playgroud)