国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁(yè) > news >正文

上海浦東建設(shè)集團(tuán)官方網(wǎng)站英文網(wǎng)站建設(shè)

上海浦東建設(shè)集團(tuán)官方網(wǎng)站,英文網(wǎng)站建設(shè),廣州網(wǎng)站建設(shè)公司,蘇州建設(shè)交通學(xué)校網(wǎng)站首頁(yè)es-head插件插入查詢以及條件查詢 1.es-head插件頁(yè)面介紹 頁(yè)面詳細(xì)介紹 2.es-head查詢語(yǔ)句 2.1.查詢索引中的全部數(shù)據(jù) curl命令交互,采用GET請(qǐng)求 語(yǔ)法格式: curl -XGET es地址:9200/索引名/_search?pretty [rootelaticsearch ~]# curl -XGET 192…

es-head插件插入查詢以及條件查詢

1.es-head插件頁(yè)面介紹

頁(yè)面詳細(xì)介紹
在這里插入圖片描述

2.es-head查詢語(yǔ)句

2.1.查詢索引中的全部數(shù)據(jù)

curl命令交互,采用GET請(qǐng)求
語(yǔ)法格式: curl -XGET es地址:9200/索引名/_search?pretty

[root@elaticsearch ~]# curl -XGET 192.168.81.210:9200/testinfo/_search?pretty
復(fù)制代碼

在這里插入圖片描述

es-head插件查詢索引中的全部數(shù)據(jù)
在查詢的框中填寫http://192.168.81.210:9200/testinfo/,填寫es地址和查詢的索引
_search表示查詢索引中的所有數(shù)據(jù),類型選擇GET,最后點(diǎn)擊提交請(qǐng)求
在這里插入圖片描述

2.2.查詢一條數(shù)據(jù)

curl交互式查詢
語(yǔ)法格式:curl -XGET es地址:prot/索引/類型/id?pretty

[root@elaticsearch ~]# curl -XGET 192.168.81.210:9200/testinfo/user/1?pretty
復(fù)制代碼

es-head查詢
地址:http://192.168.81.210:9200/
查詢的數(shù)據(jù):testinfo/user/3?pretty
類型:GET
在這里插入圖片描述

3.es-head插入數(shù)據(jù)

3.1.插入一條數(shù)據(jù)

curl交互式插入
curl -XPUT ‘192.168.81.240:9200/testinfo/user/3?pretty’ -H 'COntent-Type:

application/json' -d'
{"first_name" : "xiao","last_name" : "ming","age" : 99,"about" : "I like linux", "interests": [ "sports", "music" ]
}'
復(fù)制代碼

es-head插入

es地址:http://192.168.81.210:9200/			
索引:testinfo/user/3?pretty		PUT類型
{"first_name" : "xiao","last_name" : "ming","age" : 99,"about" : "I like linux", "interests": [ "sports", "music" ]
}
復(fù)制代碼

在這里插入圖片描述

3.2.查看數(shù)據(jù)是否插入

點(diǎn)擊數(shù)據(jù)瀏覽一欄,索引選擇testinfo

在這里插入圖片描述

數(shù)據(jù)瀏覽這里以_下劃線開頭的表示es內(nèi)置字段,無(wú)法進(jìn)行修改數(shù)據(jù)
每點(diǎn)擊一條數(shù)據(jù)都會(huì)有json格式的顯示

在這里插入圖片描述

4.es-head數(shù)據(jù)瀏覽查詢數(shù)據(jù)

查詢一個(gè)first_name包含jiang且age為99的數(shù)據(jù)

點(diǎn)擊數(shù)據(jù)瀏覽,在左側(cè)選好索引庫(kù)
縣級(jí)age的三角即可彈出輸入框,在里面寫好99,在點(diǎn)擊first_name三角彈出輸入框,在里面寫好jiang即可
在這里插入圖片描述

5.es-head基本查詢實(shí)現(xiàn)復(fù)合查詢

5.1.查詢age范圍70-100之間的數(shù)據(jù)

第二列表示字段,選擇age,第三列選擇查詢類型,我們選擇range,range表示范圍,第四列第五列選擇范圍值
在這里插入圖片描述

5.2.姓氏包含將且年齡在50-100的數(shù)據(jù)

在上一個(gè)基礎(chǔ)之上增加一個(gè)first_name的字段
在這里插入圖片描述

這里可以選擇輸出為什么類型的格式,有table、json、csv
在這里插入圖片描述

6.es-head隨機(jī)主機(jī)和id

我們實(shí)際生產(chǎn)環(huán)境中經(jīng)常需要把mysql的數(shù)據(jù)導(dǎo)到es集群中,實(shí)現(xiàn)大數(shù)據(jù)分析,但是由于每個(gè)索引庫(kù)都有一個(gè)系統(tǒng)生成的id,顯然和mysql中的會(huì)沖突,這時(shí)我們可以在增加一個(gè)id列,填寫mysql對(duì)應(yīng)的id號(hào),然后索引庫(kù)中的系統(tǒng)id可以讓其自動(dòng)生成并設(shè)置成主鍵就能完美解決這個(gè)問(wèn)題了
最終的思路就是:系統(tǒng)生成的id號(hào)做成主鍵讓系統(tǒng)隨機(jī)生產(chǎn),再增加一列作為id,存放mysql系統(tǒng)之前的id號(hào)

6.1.創(chuàng)建一個(gè)帶有系統(tǒng)id和自己定義id的索引庫(kù)并寫入數(shù)據(jù)

創(chuàng)建一個(gè)linuxbook的索引庫(kù),類型為book

寫入一個(gè)數(shù)據(jù),id為1,書名稱為nginx,書價(jià)格為35元,書的頁(yè)數(shù)為206頁(yè),書分類為web的數(shù)據(jù)
[root@elaticsearch ~]# curl -XPOST '127.0.0.1:9200/linuxbook/book?pretty' -H 'Content-Type: application/json' -d '{
"id": 1,
"book_name": "nginx",
"book_jg": "35¥",
"book_ys": "206",
"book_group": "web"
}'
{"_index" : "linuxbook","_type" : "book","_id" : "6MfqqXYB46SAjukOX_Wm","_version" : 1,"result" : "created","_shards" : {"total" : 2,"successful" : 1,"failed" : 0},"_seq_no" : 0,"_primary_term" : 1
}復(fù)制代碼

可以看到新增加了一個(gè)索引庫(kù)

6.2.查看我們寫入的數(shù)據(jù)

點(diǎn)擊數(shù)據(jù)瀏覽—會(huì)看到多了個(gè)索引,找到我們的linuxbook索引—查看數(shù)據(jù)
會(huì)看到既有隨機(jī)生產(chǎn)的_id也有我們新增的id
在這里插入圖片描述

再次插入了幾條數(shù)據(jù)

在這里插入圖片描述

也可以根據(jù)條件去搜索

在這里插入圖片描述

7.刪除索引庫(kù)

慎用索引庫(kù),要?jiǎng)h除索引庫(kù)建議在瀏覽器頁(yè)面刪除,會(huì)有提示

7.1.命令行刪除索引庫(kù)

我們首先創(chuàng)建一個(gè)測(cè)試庫(kù)

[root@elaticsearch ~]# curl -XPOST '127.0.0.1:9200/linuxaaa/book?pretty' -H 'Content-Type: application/json' -d '{
"id": 2,
"book_name": "mysql",
"book_jg": "70¥",
"book_ys": "709",
"book_group": "db"
}'
復(fù)制代碼

在這里插入圖片描述

刪除索引庫(kù)

[root@elaticsearch ~]# curl -XDELETE '127.0.0.1:9200/linuxaaa?pretty'
{"acknowledged" : true
}復(fù)制代碼

刪除成功

在這里插入圖片描述

7.2.瀏覽器刪除索引庫(kù)

先創(chuàng)建一個(gè)索引庫(kù)

[root@elaticsearch ~]# curl -XPOST '127.0.0.1:9200/linuxaaa/book?pretty' -H 'Content-Type: application/json' -d '{
"id": 2,
"book_name": "mysql",
"book_jg": "70¥",
"book_ys": "709",
"book_group": "db"
}'
復(fù)制代碼

在這里插入圖片描述

刪除索引庫(kù)

1)點(diǎn)擊動(dòng)作—?jiǎng)h除
在這里插入圖片描述

2)在彈出的框中輸入刪除
在這里插入圖片描述

3)刪除成功
在這里插入圖片描述

成功刪除
在這里插入圖片描述

8.用head地址訪問(wèn)

本章操作都是用谷歌的head插件去連接的es服務(wù)器,我們用服務(wù)器中部署的head訪問(wèn)一次
服務(wù)器中安裝并啟動(dòng)head

[root@elaticsearch data]# tar xf elasticsearch-head.tar.gz 
[root@elaticsearch data]# cd elasticsearch-head
[root@elaticsearch elasticsearch-head]# npm install
npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})up to date in 11.943s?─────────────────────────────────────────────────────────────────?                                                                        New minor version of npm available! 6.9.0  6.14.10          Changelog: https://github.com/npm/cli/releases/tag/v6.14.10                   Run npm install -g npm to update!                                                                                 ?─────────────────────────────────────────────────────────────────?[root@elaticsearch elasticsearch-head]# npm run start &
[1] 87691
[root@elaticsearch elasticsearch-head]# 
> elasticsearch-head@0.0.0 start /data/elasticsearch-head
> grunt serverRunning "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:9100[root@elaticsearch elasticsearch-head]# 
[root@elaticsearch elasticsearch-head]# 
[root@elaticsearch elasticsearch-head]# 
[root@elaticsearch elasticsearch-head]# netstat -lnpt | grep 9100
tcp        0      0 0.0.0.0:9100            0.0.0.0:*               LISTEN      87702/grunt        
復(fù)制代碼

源碼附件已經(jīng)打包好上傳到百度云了,大家自行下載即可~

鏈接: https://pan.baidu.com/s/14G-bpVthImHD4eosZUNSFA?pwd=yu27
提取碼: yu27
百度云鏈接不穩(wěn)定,隨時(shí)可能會(huì)失效,大家抓緊保存哈。

如果百度云鏈接失效了的話,請(qǐng)留言告訴我,我看到后會(huì)及時(shí)更新~

開源地址

碼云地址:
http://github.crmeb.net/u/defu

Github 地址:
http://github.crmeb.net/u/defu

作者:jiangxl
鏈接:https://juejin.cn/post/7130049525250523173

http://aloenet.com.cn/news/34507.html

相關(guān)文章:

  • wordpress網(wǎng)站的根目錄在哪關(guān)鍵詞搜索排行榜
  • 西昌城鄉(xiāng)建設(shè)網(wǎng)站曹操博客seo
  • 免費(fèi)做網(wǎng)站的軟件seminar是什么意思
  • 廣州網(wǎng)站開發(fā)技術(shù)網(wǎng)推平臺(tái)有哪些比較好
  • 專業(yè)網(wǎng)站設(shè)計(jì)團(tuán)隊(duì)日本櫻花免m38vcom費(fèi)vps
  • 做的比較好的卡車網(wǎng)站網(wǎng)站策劃是什么
  • 做網(wǎng)站遇到競(jìng)爭(zhēng)對(duì)手怎么辦秘密入口3秒自動(dòng)進(jìn)入
  • 棗莊做網(wǎng)站優(yōu)化網(wǎng)站客服系統(tǒng)
  • 萬(wàn)網(wǎng)域名申請(qǐng)網(wǎng)站全自動(dòng)推廣引流軟件
  • 網(wǎng)站上的logo怎么做今日國(guó)內(nèi)新聞
  • 網(wǎng)站設(shè)計(jì)聯(lián)盟西安seo學(xué)院
  • 網(wǎng)站開發(fā)wbs工作分解結(jié)構(gòu)北京互聯(lián)網(wǎng)公司有哪些
  • wordpress背景圖更改網(wǎng)站自然優(yōu)化
  • 北京網(wǎng)站如何制作seo網(wǎng)站關(guān)鍵詞優(yōu)化快速官網(wǎng)
  • wordpress 入侵視頻優(yōu)化營(yíng)商環(huán)境條例全文
  • 怎么設(shè)計(jì)app太原seo排名外包
  • 做app好還是響應(yīng)式網(wǎng)站深圳企業(yè)黃頁(yè)網(wǎng)
  • 萊蕪營(yíng)銷型網(wǎng)站制作廣東省各城市疫情搜索高峰進(jìn)度
  • 網(wǎng)絡(luò)營(yíng)銷案例分析200字關(guān)鍵詞seo如何優(yōu)化
  • 網(wǎng)站整體運(yùn)營(yíng)思路互聯(lián)網(wǎng)推廣引流
  • 中國(guó)招標(biāo)投標(biāo)網(wǎng)查詢平臺(tái)站長(zhǎng)之家 seo查詢
  • 網(wǎng)站輪播廣告代碼怎樣搭建一個(gè)網(wǎng)站
  • 無(wú)錫 網(wǎng)站建設(shè)公司廣州做seo整站優(yōu)化公司
  • 榆林市網(wǎng)站建設(shè)網(wǎng)站開發(fā)工具
  • 深圳專業(yè)網(wǎng)站制作費(fèi)用怎么建一個(gè)自己的網(wǎng)站
  • 政務(wù)公開政府網(wǎng)站建設(shè)管理百度刷搜索詞
  • wordpress 首頁(yè)調(diào)用頁(yè)面標(biāo)題城關(guān)網(wǎng)站seo
  • 廣州 網(wǎng)站建設(shè)網(wǎng)絡(luò)推廣網(wǎng)頁(yè)設(shè)計(jì)免費(fèi)推廣廣告鏈接
  • 學(xué)校網(wǎng)站推廣seo關(guān)鍵詞排名優(yōu)化怎樣
  • 國(guó)外炫酷網(wǎng)站外貿(mào)平臺(tái)app