elasticsearch,nest,Asp.net Mvc,elasticsearch,Nest" /> elasticsearch,nest,Asp.net Mvc,elasticsearch,Nest" />

Asp.net mvc 在MVC.Net项目中使用嵌套

Asp.net mvc 在MVC.Net项目中使用嵌套,asp.net-mvc,elasticsearch,nest,Asp.net Mvc,elasticsearch,Nest,如的文档所示,我编写了连接ElasticSearchRESTAPI的代码 private static ElasticSearch _elasticSearch; private readonly Uri _node; private readonly ConnectionSettings _setting; private readonly ElasticClient _client; private ElasticSe

如的文档所示,我编写了连接ElasticSearchRESTAPI的代码

        private static ElasticSearch _elasticSearch;
        private readonly Uri _node;
        private readonly ConnectionSettings _setting;
        private readonly ElasticClient _client;

    private ElasticSearch()
    {
        _node = new Uri("http://localhost:9200");
        _setting = new ConnectionSettings(_node, defaultIndex: "myprogram");
        _client = new ElasticClient(_setting);
        _client.CreateIndex("myprogram", c => c
            .NumberOfReplicas(0)
            .NumberOfShards(1)
            .Settings(s => s
                .Add("merge.policy.merge_factor", "10")
                .Add("search.slowlog.threshold.fetch.warn", "1s")
            ));
    }

而且它在我的项目中很有效。但是,当我将项目的configure更改为SSL模式时,我收到了一个错误,该值的身份验证失败,因为当我要创建索引时,远程方已经关闭了第4行上的流。有什么问题吗?

您可以分享一下如何设置ssl模式吗?@Rob感谢您的评论。是,我已将SSlEnabled属性更改为true,并将RequiredHttps置于操作之上