当前位置:网站首页>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
{}
边栏推荐
- Business implementation - the log is written to the same row of data
- P4408 [NOI2003] 逃学的小孩(树的直径)
- Netcore3.1 JSON web token Middleware
- Cross domain request
- 模板的进阶
- JS convert pseudo array to array
- Remember to build wheels repeatedly at one time (the setting instructions of obsidian plug-in are translated into Chinese)
- 微服务(Microservice)那点事儿
- 2022.07.03 (lc_6111_counts the number of ways to place houses)
- Summary of week 22-07-02
猜你喜欢
Pytoch --- use pytoch to realize linknet for semantic segmentation
华为200万年薪聘请数据治理专家!背后的千亿市场值得关注
Application of fire fighting system based on 3D GIS platform
Parsing of XML
What did I pay for it transfer to testing post from confusion to firmness?
微服务(Microservice)那点事儿
多回路仪表在基站“转改直”方面的应用
圖解網絡:什麼是網關負載均衡協議GLBP?
How to effectively monitor the DC column head cabinet
[论文阅读] CarveMix: A Simple Data Augmentation Method for Brain Lesion Segmentation
随机推荐
Best practice case of enterprise digital transformation: introduction and reference of cloud based digital platform system security measures
ORB(Oriented FAST and Rotated BRIEF)
雅思考试流程、需要具体注意些什么、怎么复习?
[monitoring] ZABBIX
js如何实现数组转树
Deux nombres se remplacent
Two numbers replace each other
Pytoch --- use pytoch to realize linknet for semantic segmentation
[Peking University] tensorflow2.0-1-opening
Data on the number of functional divisions of national wetland parks in Qinghai Province, data on the distribution of wetlands and marshes across the country, and natural reserves in provinces, cities
OpenHarmony资源管理详解
实战模拟│JWT 登录认证
【北京大学】Tensorflow2.0-1-开篇
Using the uniapp rich text editor
华为200万年薪聘请数据治理专家!背后的千亿市场值得关注
Power operation and maintenance cloud platform: open the new mode of "unattended and few people on duty" of power system
企业公司项目开发好一部分基础功能,重要的事保存到线上第一a
两个数相互替换
How to do the project of computer remote company in foreign Internet?
Life is changeable, and the large intestine covers the small intestine. This time, I can really go home to see my daughter-in-law...