简体   繁体   English

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

[英]Dispatching Index() from NEST into to Elasticsearch.NET failed

I am having error when calling client.Index when using Nest and Elasticsearch.NET 我在使用Nest和Elasticsearch.NET时调用client.Index时遇到错误

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);

Dispatching Index() from NEST into to Elasticsearch.NET failed 从NEST调度Index()到Elasticsearch.NET失败
Received a request marked as PUT This endpoint accepts POST,PUT The request might not have enough information provided to make any of these endpoints: 收到标记为PUT的请求此端点接受POST,PUT请求可能没有提供足够的信息来生成任何这些端点:
- /{index}/{type} - / {index} / {type}
- /{index}/{type}/{id} - / {index} / {type} / {id}

Any idea? 任何想法?

您需要设置默认索引:

settings.DefaultIndex("indexName");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM