真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

ElasticSearch怎么查看、刪除以及創(chuàng)建索引

本篇內(nèi)容介紹了“ElasticSearch怎么查看、刪除以及創(chuàng)建索引”的有關(guān)知識(shí),在實(shí)際案例的操作過(guò)程中,不少人都會(huì)遇到這樣的困境,接下來(lái)就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!

成都創(chuàng)新互聯(lián)是一家專注于成都做網(wǎng)站、網(wǎng)站設(shè)計(jì)與策劃設(shè)計(jì),肇慶網(wǎng)站建設(shè)哪家好?成都創(chuàng)新互聯(lián)做網(wǎng)站,專注于網(wǎng)站建設(shè)十余年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:肇慶等地區(qū)。肇慶做網(wǎng)站價(jià)格咨詢:028-86922220

說(shuō)明:{{es-host}} 是在postman配置的一個(gè)本地變量 ,變量值是 192.168.100.102:9200 ,也就是es集群的其中一個(gè)節(jié)點(diǎn)

ElasticSearch怎么查看、刪除以及創(chuàng)建索引

1、查看集群健康狀況

GET http://{{es-host}}/_cat/health?v
epoch      timestamp cluster       status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1565356074 13:07:54  elasticsearch green           3         3     10   5    0    0        0             0                  -                100.0%

2、查看索引列表

GET http://{{es-host}}/_cat/indices?v
health status index     uuid                   pri rep docs.count docs.deleted store.size pri.store.size
green  open   ecommerce YO4DgZuSTe23piO6hjF--w   5   1          3            0     34.2kb         17.1kb

3、查看節(jié)點(diǎn)列表

GET http://{{es-host}}/_cat/nodes?v
ip              heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
192.168.100.102           35          95   0    0.04    0.04     0.05 mdi       -      es-node3
192.168.100.102           23          95   0    0.04    0.04     0.05 mdi       *      es-node1
192.168.100.102           35          95   0    0.04    0.04     0.05 mdi       -      es-node2

4、創(chuàng)建索引

PUT http://{{es-host}}/test-index?pretty

5、刪除索引

DELETE http://{{es-host}}/test-index

6、添加商品同時(shí)創(chuàng)建inde和type

(1)、

PUT http://{{es-host}}/ecommerce/produce/1
{
	"name":"gaolujie yagao",
	"desc":"gaoxiao meibai",
	"price":30,
	"producer":"gaolujie producer",
	"tags":[
		"meibai","fangzhu"	
	]
}
結(jié)果:
{
    "_index": "ecommerce",
    "_type": "produce",
    "_id": "1",
    "_version": 10,
    "result": "created",
    "_shards": {
        "total": 2,
        "successful": 2,
        "failed": 0
    },
    "created": true
}

(2)、

PUT http://{{es-host}}/ecommerce/produce/2
{
	"name":"jiajieshi yagao",
	"desc":"youxiao fangzhu",
	"price":25,
	"producer":"jiajieshi producer",
	"tags":[
		"fangzhu"	
	]
}

(3)、

PUT http://{{es-host}}/ecommerce/produce/3
{
	"name":"zhonghua yagao",
	"desc":"caoben zhiwu",
	"price":40,
	"producer":"zhonghua producer",
	"tags":[
		"qingxin"	
	]
}

7、根據(jù)Id查詢

GET http://{{es-host}}/ecommerce/produce/1

查詢結(jié)果:
{
	"_index": "ecommerce",
	"_type": "produce",
	"_id": "1",
	"_version": 7,
	"found": true,
	"_source": {
		"name": "gaolujie yagao",
		"desc": "gaoxiao meibai",
		"price": 30,
		"producer": "gaolujie producer",
		"tags": [
			"meibai",
			"fangzhu"
		]
	}
}

8、修改單個(gè)屬性

POST http://{{es-host}}/ecommerce/produce/1/_update
{
	"doc":{
		"price":30
	}
}

9、覆蓋修改

PUT http://{{es-host}}/ecommerce/produce/1
{
	"name":"gaolujie yagao1",
	"desc":"gaoxiao meibai",
	"price":30,
	"producer":"gaolujie producer",
	"tags":[
		"meibai","fangzhu"	
	]
}
結(jié)果:
{
    "_index": "ecommerce",
    "_type": "produce",
    "_id": "1",
    "_version": 8,
    "result": "updated",
    "_shards": {
        "total": 2,
        "successful": 2,
        "failed": 0
    },
    "created": false
}

10、根據(jù)id刪除數(shù)據(jù)

DELETE http://{{es-host}}/ecommerce/produce/1
結(jié)果:
{
    "found": true,
    "_index": "ecommerce",
    "_type": "produce",
    "_id": "1",
    "_version": 9,
    "result": "deleted",
    "_shards": {
        "total": 2,
        "successful": 2,
        "failed": 0
    }
}

“ElasticSearch怎么查看、刪除以及創(chuàng)建索引”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識(shí)可以關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!


本文標(biāo)題:ElasticSearch怎么查看、刪除以及創(chuàng)建索引
路徑分享:http://weahome.cn/article/gsidsp.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部