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

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ## 一、概述 所有其他語言可以使用 RESTful API 通過端口*9200*和 Elasticsearch 進行通信,你可以用你最喜愛的 web 客戶端訪問 Elasticsearch; Java語言還可以通過JAVA API的方式與Elasticsearch 進行通信; 這里介紹RESTful API 方式; ## 二、RESTful API 命令舉例 ### **index操作** **查看當前節點的所有 Index** ``` curl --user elastic:'ray!@#333' GET 'http://localhost:9200/_cat/indices?v' ``` ![](https://img.kancloud.cn/26/ad/26ad04abe574d45c65d316040d9e7089_1410x98.png) **新建和刪除 Index** 新建一個名叫rayes的 Index ``` curl --user elastic:'ray!@#333' PUT 'localhost:9200/rayes' ``` ![](https://img.kancloud.cn/87/98/8798a074e05cfd76590f2e54c9f35f94_1401x86.png) 再檢查一遍所有的index,發現已經新增成功了; ![](https://img.kancloud.cn/4f/c0/4fc019449ea7e7efa827a35d2a448115_1416x87.png) 刪除名叫rayes的 Index ``` curl --user elastic:'ray!@#333' DELETE 'localhost:9200/rayes' ``` ### **document操作** >[danger] 規則 > 從7.X版本開始,typs已經被廢棄了,索引一個文檔的命令,不再需要文檔類型了,而是用`PUT {index}/_doc/{id}`或者`POST {index}/_doc`(自動產生ids); **新增文檔** ``` curl --user elastic:'ray!@#333' -H "Content-Type: application/json" -X POST 'localhost:9200/rayes/_doc' -d '{"userName":"A","birthDate":"2008/10/18","desc":"數據庫管理"}' ``` ![](https://img.kancloud.cn/8f/f4/8ff4c42d9bdf560e337b7b08119f1a68_1920x942.png) **查看文檔** ``` curl --user elastic:'ray!@#333' 'localhost:9200/rayes/1/hg6-snwBMTAE7MZApHxA?pretty=true' ``` ![](https://img.kancloud.cn/6e/76/6e76091eaf4a891f8da66526434658ab_1411x327.png) **搜索文檔** ``` curl --user elastic:'ray!@#333' -H "Content-Type: application/json" -X POST localhost:9200/_search?pretty -d '{"query":{"query_string": {"query": "rayes"}}} ' ``` ![](https://img.kancloud.cn/20/d1/20d12edcbd28a9d4f2ff0d42cf9b6e9b_1441x912.png) ``` curl --user elastic:'ray!@#333' -H "Content-Type: application/json" -X POST localhost:9200/_search?pretty -d '{"query":{"query_string": {"query": "ray"}}} ' ``` ![](https://img.kancloud.cn/46/29/4629606661395365b679078083e7ff2c_1424x674.png)
                  <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>

                              哎呀哎呀视频在线观看