受欢迎的博客标签

Open the Elasticsearch configuration file for editing:

sudo vi /etc/elasticsearch/elasticsearch.yml

 

error:

the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

 

network.host : 0.0.0.0
将 #cluster.initial_master_nodes: ["node-1", "node-2"] 
修改为 cluster.initial_master_nodes: ["node-1"],记得保存。

 

访问公网ip出现审计错误:

Valid NEST response built from a successful low level call on POST: /project/doc/_search
# Audit trail of this API call:
 - [1] SniffOnStartup: Took: 00:00:00.0360264
 - [2] SniffSuccess: Node: http://localhost:9200/ Took: 00:00:00.0310228
 - [3] PingSuccess: Node: http://127.0.0.1:9200/ Took: 00:00:00.0115074
 - [4] HealthyResponse: Node: http://127.0.0.1:9200/ Took: 00:00:00.1477640
# Request:
<Request stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>
# Response:
<Response stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>
to help with troubleshootin


https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/audit-trail.html

解决:原为Nest 6.02 版本,按Nest 7.4.2 语法重写创建索引和查询,问题得到解决。

 

update Nest 6.0.2 to Nest 7.4.2,出现编译错误

SortField  not exsit

change SortField to FieldSort

Highlights not exist

change Highlights tos Highlight

 foreach (var h in hl.Value.Highlights)
                {
                    WriteLiteral(h);

                }

to
foreach (var h in hl.Value)
                {
                    WriteLiteral(h);

                }

 

change field map Name to RelationName

    /// <summary>
    /// 版本 es7.4.2
    /// </summary>
    [ElasticsearchType(IdProperty = "Id", Name = "F10FileContentModel")]
    public class F10FileContentModel
    {


to


    /// <summary>
    /// 版本 es7.4.2
    /// </summary>
    [ElasticsearchType(IdProperty = "Id", RelationName = "F10FileContentModel")]
    public class F10FileContentModel
    {