elasticsearch learning (1)

Elasticsearch installation, operation elasticsearch tool kibana,

(1) Enter the kibana the GET _cluster / health view the health status of es (2) Enter in kibana the GET / _cat / health? V es view specific information

epoch      timestamp cluster       status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1565201059 18:04:19  elasticsearch green           1         1      2   2    0    0        0             0                  -                100.0%

status: green: Each index of primary shard and a replica shard is active state

   yellow: Each index of primary shard is active state, but some replica shard is not active state

  red: Not all index primary shard is the active state, part of the index data is lost

 

kibana in: GET / _cat / indices v?

health status index                uuid                   pri rep docs.count docs.deleted store.size pri.store.size
green  open   .kibana_task_manager ynymnIYGSiaUo76dW86xKA   1   0          2            0     45.5kb         45.5kb
green  open   .kibana_1            6I0Vh6e8QLCvPgZil4_StQ   1   0          4            0     15.3kb         15.3kb

 

Adding documents:

PUT /index/_doc/id{ }

E.g:

PUT /ecommerce/product/3
{
  "name":"zhonghua toothpaste",
  "desc":"herb,prevent cavity",
  "price":40,
  "producer":"zhonghua producer",
  "tags":["fresh"]
}

 

Update:

POST /index/product/id/_update

{

"doc":{

}

}

E.g:

POST /ecommerce/product/1/_update
{
  "doc":{
    "name":"highly efficient white toothpaste"
  }
}

 

Guess you like

Origin www.cnblogs.com/vary-/p/11318831.html