<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                * [ElasticSearch 介紹及應用場景](https://www.jianshu.com/p/8494ae9a53a7) * [ElasticSearch使用場景](https://www.cnblogs.com/cdchencw/p/12449500.html) * [查詢操作文檔](https://www.elastic.co/guide/cn/elasticsearch/guide/current/_empty_search.html) * [英文文檔](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-replication.html#docs-replication) * [golang操作Elasticsearch](https://blog.csdn.net/tflasd1157/article/details/81981915) //或者不用庫直接掉方法 * term 只能匹配中文的 ![](/D:/%E6%AD%A3%E5%BC%8F%E6%A1%8C%E9%9D%A2/Golang%E5%B7%A5%E4%BD%9C%E7%AC%94%E8%AE%B0/book/Go%E4%B8%80%E7%99%BE%E4%BE%8B/images/QQ%E6%88%AA%E5%9B%BE20200515155334.png) ~~~ package main import ( "context" "fmt" "github.com/olivere/elastic" "log" "os" ) type Employee struct { FirstName string `json:"first_name"` LastName string `json:"last_name"` Age int `json:"age"` About string `json:"about"` Interests []string `json:"interests"` } func main() { esURL := "http://192.168.28.126:9200" errLog := log.New(os.Stdout, "app ", log.LstdFlags) client, err := elastic.NewClient(elastic.SetErrorLog(errLog), elastic.SetURL(esURL)) if err != nil { fmt.Println(err) } info, code, err := client.Ping(esURL).Do(context.Background()) if err != nil { fmt.Println(err) } fmt.Println(info, code) e1 := Employee{"Jane5", "Smith", 32, "I like to collect rock albums", []string{"music"}} put1, err := client.Index(). Index("megacorp"). Type("employee"). Id("1"). BodyJson(e1). // - [查詢操作文檔](https://www.elastic.co/guide/cn/elasticsearch/guide/current/_empty_search.html) Source(`{"query":{"match":{"first_name":"zhang1"}}}`). Do(context.Background()) if err != nil { panic(err) } fmt.Printf("Indexed tweet %s to index s%s, type %s\n", put1.Id, put1.Index, put1.Type) reslut, err := client.Search().Index("megacorp").Type("employee").Do(context.Background()) if err != nil { fmt.Println(err.Error()) } for k, v := range reslut.Hits.Hits { fmt.Println(k, string(*v.Source)) } } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看