当前位置:网站首页>Kibana index, mapping, document operation
Kibana index, mapping, document operation
2022-07-05 00:23:00 【Dalon_ G】
This article needs to be configured elasticsearch and kibana Post consumption , See Portal
Catalog
3. Document operation and partial update
1. Operation of index
# Index related
# Create index
PUT /test
# Determine if the index exists
HEAD /test
# Look at the index
GET /test
# View all indexes
GET _all
# Look at the index , And you can see health information and other attributes
GET /_cat/indices?v
# Close index
POST /test/_close
# Look at the index again ( Mainly depends on the state )
GET /_cat/indices?v
# Open the index
POST /test/_open
# Delete index
DELETE /test
# Judge whether it exists
HEAD /test
2. Mapping operations
# Mapping correlation
# Create mapping fields grammar
PUT / Index name /_mapping
{
"properties":{
" Field name ":{
"type":" type ",
"index":"true",
"store":"true",
"analyzer":" Word segmentation is "
}
}
}
# Create a mapping field case
PUT /test/_mapping
{
"properties":{
"name":{
"type":"text",
"analyzer":"ik_max_word"
},
"job":{
"type":"text",
"analyzer":"ik_max_word"
},
"logo":{
"type":"keyword",
"index":false
}
}
}
# View mapping relationships
GET /test/_mapping
GET _mapping
GET _all/_mapping
# Modify mapping relationship
# You can only add mappings , If other operations need to be deleted, add again
PUT /test/_mapping
{
"properties":{
"age":{
"type":"integer",
"index":false
}
}
}
# Create indexes and maps at once
PUT /test2
{
"settings": {}
, "mappings": {
"properties":{
"name":{
"type":"text",
"analyzer":"ik_max_word"
},
"job":{
"type":"text",
"analyzer":"ik_max_word"
},
"logo":{
"type":"keyword",
"index":false
}
}
}
}
# View the map
GET /test2/_mapping
3. Document operation and partial update
# New document
POST /test/_doc/1
{
"name":" Zhang San ",
"age":22
}
# To view the document
GET /test/_doc/1
# View all the documents
GET /test/_search
{
"query": {
"match_all": {}
}
}
# Custom return results Appoint source Return results
GET /test/_doc/1?_source=name,age
# to update Full update ( Just put the created post Change it to put)
# Note here , If the original attribute value has , There is no new one , Some attributes will be deleted
# If specified id There is , Then update , If it doesn't exist , Then create
PUT /test/_doc/1
{
"name":" Li Si "
}
# see Only name 了
GET /test/_doc/1
# Partial update
POST /test/_update/1
{
"doc": {
"age":22
}
}
# see Added age
GET /test/_doc/1
# Delete
DELETE /test/_doc/1
# see "found" : false
GET /test/_doc/1
# Conditions delete
# Create a new document again
POST /test/_doc/1
{
"name":" Zhang San ",
"age":22
}
POST /test/_doc/2
{
"name":" Li Si ",
"age":25
}
POST /test/_delete_by_query
{
"query":{
"match":{
"name":" Zhang San "
}
}
}
# View all the documents , also name For Li Si
# Delete all
POST /test/_delete_by_query
{
"query":{
"match_all":{
}
}
}
# See all again , Then all are deleted
GET /test/_search
{
"query": {
"match_all": {}
}
}
# Force creation , If id There is , Error report in execution "status" : 409
PUT /test/_doc/1/_create
{}
边栏推荐
- OpenHarmony资源管理详解
- Réseau graphique: Qu'est - ce que le Protocole d'équilibrage de charge de passerelle glbp?
- 《论文笔记》Multi-UAV Collaborative Monocular SLAM
- 初识ROS
- Using the uniapp rich text editor
- Go step on the pit - no required module provides package: go mod file not found in current directory or any parent
- 如何避免电弧产生?—— AAFD故障电弧探测器为您解决
- 【监控】zabbix
- lambda expressions
- P3304 [SDOI2013]直径(树的直径)
猜你喜欢
巩固表达式C# 案例简单变量运算
《论文笔记》Multi-UAV Collaborative Monocular SLAM
如何用快解析自制IoT云平台
Huawei employs data management experts with an annual salary of 2million! The 100 billion market behind it deserves attention
PMP certificate renewal process
Fast analysis -- easy to use intranet security software
[selenium automation] common notes
Illustrated network: what is gateway load balancing protocol GLBP?
P3304 [SDOI2013]直径(树的直径)
Detailed explanation of openharmony resource management
随机推荐
Réseau graphique: Qu'est - ce que le Protocole d'équilibrage de charge de passerelle glbp?
Five papers recommended for the new development of convolutional neural network in deep learning
Huawei employs data management experts with an annual salary of 2million! The 100 billion market behind it deserves attention
[论文阅读] CarveMix: A Simple Data Augmentation Method for Brain Lesion Segmentation
Fast parsing intranet penetration helps enterprises quickly achieve collaborative office
2022.07.03 (LC 6108 decryption message)
Get to know ROS for the first time
同事的接口文档我每次看着就头大,毛病多多。。。
IT转测试岗,从迷茫到坚定我究竟付出了什么?
[path planning] RRT adds dynamic model for trajectory planning
图解网络:什么是网关负载均衡协议GLBP?
Paper notes multi UAV collaborative monolithic slam
abc 258 G - Triangle(bitset)
他做国外LEAD,用了一年时间,把所有房贷都还清了
uniapp微信小程序拿来即用的瀑布流布局demo2(方法二)(复制粘贴即可使用,无需做其他处理)
GDB常用命令
(script) one click deployment of any version of redis - the way to build a dream
AcWing164. 可达性统计(拓扑排序+bitset)
Advanced template
P3304 [SDOI2013]直径(树的直径)