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

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                **PHP擴展安裝** 1\. 環境要求:PHP_VERSION >= 5.3.9,composer工具 2\. 在E盤新建文件夾命名為elastic,,拷貝composer.phar到 ? ? ?E:/elastic目錄下面 3\. 打開命令行窗口,進入E:/elastic 4\. 在命令行運行: ? ? ? php composer.phar require elasticsearch/elasticsearch 5\. 此時E:/elastic目錄下會出現一個vendor目錄,安裝成功 6\. 使用方法: ? ? ? ?require 'vendor/autoload.php';? ? ? ? $client = new Elasticsearch\Client(); **創建索引** 1. include('./vendor/autoload.php');?? 2. $elastic?=?new?Elasticsearch\Client();?? 3. $index[‘index’]?=?‘log’;??//索引名稱?? 4. $index[‘type’]?=?‘ems_run_log’;?//類型名稱?? 5. $data[‘body’][‘settings’][‘number_of_shards’]?=?5;??//主分片數量?? 6. $data[‘body’][‘settings’][‘number_of_replicas’]?=?0;?//從分片數量?? 7. $elastic->indices()->create($index);?? **插入索引數據** 1. include('./vendor/autoload.php');?? 2. $elastic?=?new?Elasticsearch\Client();?? 3. $index[‘index’]?=?‘log’;?//索引名稱?? 4. $index[‘type’]?=?‘ems_run_log’;?//類型名稱?? 5. $index[‘id’]?=?1???//不指定id,系統會自動生成唯一id?? 6. $index[‘body’]?=?array(?? 7. ‘mac’?=>?'fcd5d900beca',?? 8. ‘customer_id’?=>?3,?? 9. ‘product_id’?=>?5,?? 10. ‘version’?=>?2?? 11. );?? 12. $elastic->index($index);?? **查詢** 1. include('./vendor/autoload.php');?? 2. $elastic?=?new?Elasticsearch\Client();?? 3. $index[‘index’]?=?‘log’;?//索引名稱?? 4. $index[‘type’]?=?‘ems_run_log’;?//類型名稱?? 5. $index[‘body’][‘query’][‘match’][‘mac’]?=?‘fcd5d900beca’;?? 6. $index[‘size’]?=?10;?? 7. $index[‘from’]?=?200;?? 8. $elastic->search($index);?? 相當于sql語句:?? select*from?ems_run_log?where?mac=‘fcd5d900beca’? limit?200,10; 1. include('./vendor/autoload.php');?? 2. $elastic?=?new?Elasticsearch\Client();?? 3. $index[‘index’]?=?‘log’;?//索引名稱?? 4. $index[‘type’]?=?‘ems_run_log’;?//類型名稱?? 5. $index[‘body’][‘query’][‘bool’][‘must’]?=?array(?? 6. array(‘match’?=>?array(‘mac’?=>?‘fcd5d900beca’)),?? 7. array(‘match’?=>?array(‘product_id’?=>?20))?? 8. );?? 9. $index[‘size’]?=?10;?? 10. $index[‘from’]?=?200;?? 11. $elastic->search($index);?? 相當于sql語句:?? select*from?ems_run_log?where?mac=‘fcd5d900beca’?? and?product_id?=?20?limit?200,10;?? 1. include('./vendor/autoload.php');?? 2. $elastic?=?new?Elasticsearch\Client();?? 3. $index[‘index’]?=?‘log’;?//索引名稱?? 4. $index[‘type’]?=?‘ems_run_log’;?//類型名稱?? 5. $index[‘body’][‘query’][‘bool’][‘should’]?=?array(?? 6. array(‘match’?=>?array(‘mac’?=>?‘fcd5d900beca’)),?? 7. array(‘match’?=>?array(‘product_id’?=>?20))?? 8. );?? 9. $index[‘size’]?=?10;?? 10. $index[‘from’]?=?200;?? 11. $elastic->search($index);?? 當于sql語句:?? select*from?ems_run_log?where?mac=‘fcd5d900beca’?? or?product_id?=?20?limit?200,10;?? 1. include('./vendor/autoload.php');?? 2. $elastic?=?new?Elasticsearch\Client();?? 3. $index[‘index’]?=?‘log’;?//索引名稱?? 4. $index[‘type’]?=?‘ems_run_log’;?//類型名稱?? 5. $index[‘body’][‘query’][‘bool’][‘must_not’]?=?array(?? 6. array(‘match’?=>?array(‘mac’?=>?‘fcd5d900beca’)),?? 7. array(‘match’?=>?array(‘product_id’?=>?20))?? 8. );?? 9. $index[‘size’]?=?10;?? 10. $index[‘from’]?=?200;?? 11. $elastic->search($index);?? 相當于sql語句:?? select*from?ems_run_log?where?mac!=‘fcd5d900beca’? and?product_id?!=?20?limit?200,10;?? 1. include('./vendor/autoload.php');?? 2. $elastic?=?new?Elasticsearch\Client();?? 3. $index[‘index’]?=?‘log’;?//索引名稱?? 4. $index[‘type’]?=?‘ems_run_log’;?//類型名稱?? 5. $index[‘body’][‘query’][‘range’]?=?array(?? 6. ‘id’?=>?array(‘gte’?=>?20,’lt’?=>?30);?? 7. );?? 8. $index[‘size’]?=?10;?? 9. $index[‘from’]?=?200;?? 10. $elastic->search($index);?? 相當于sql語句:?? select*from?ems_run_log?where?id>=20? and?id<30??limit?200,10;?? **刪除文檔** 1. <pre?name="code"?class="php">include('./vendor/autoload.php');?? 2. $elastic?=?new?Elasticsearch\Client();?? 3. $index['index']?=?'test';??//索引名稱?? 4. $index['type']?=?'ems_test';?//類型名稱?? 5. $index['id']?=?2;??? 6. $elastic->delete($index);
                  <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>

                              哎呀哎呀视频在线观看