zoukankan      html  css  js  c++  java
  • NEST analyze与mapping

            /// <summary>
            /// POST /_analyze?pretty=true
            /// POST /employee/_analyze 
            /// </summary>
            public void Analyze()
            {
                client.Analyze(x => x.Analyzer("standard").Text("Text to analyze").Pretty());
                client.Analyze(x=>x.Index("employee").Field("last_name").Text("陈一狮"));
            }
    
            /// <summary>
            /// GET /employee/_mapping/employee?pretty=true
            /// </summary>
            public void GetMapping()
            {
                client.GetMapping<employee>(x => x.Pretty());
            }
    
            /// <summary>
            /// PUT /employee/employee/_mapping
            /// </summary>
            public void Mapping()
            {
                var response = client.IndexExists("employee");
                if(!response.Exists)
                {
                    client.CreateIndex("employee");
                }
                client.Map<employee>(m => m.Properties(p => p.Text(t => t.Name("age").Index(false))).AutoMap());
            }
    

      

  • 相关阅读:
    百度搜索技巧
    phpstorm知识点
    A-Z
    边框
    display
    布局
    盒模型
    浮动
    字体与图标
    pselect 问题
  • 原文地址:https://www.cnblogs.com/chenyishi/p/11551824.html
Copyright © 2011-2022 走看看