当前位置:网站首页>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
{}
边栏推荐
- Réseau graphique: Qu'est - ce que le Protocole d'équilibrage de charge de passerelle glbp?
- Deux nombres se remplacent
- P4408 [NOI2003] 逃学的小孩(树的直径)
- Best practice case of enterprise digital transformation: introduction and reference of cloud based digital platform system security measures
- 22-07-02周总结
- 圖解網絡:什麼是網關負載均衡協議GLBP?
- Two numbers replace each other
- URLs and URIs
- 2022.07.03 (LC 6108 decryption message)
- go踩坑——no required module provides package : go.mod file not found in current directory or any parent
猜你喜欢
快解析——好用的内网安全软件
「运维有小邓」域密码策略强化器
Illustrated network: what is gateway load balancing protocol GLBP?
ORB(Oriented FAST and Rotated BRIEF)
[path planning] RRT adds dynamic model for trajectory planning
他做国外LEAD,用了一年时间,把所有房贷都还清了
2022.07.03 (LC 6108 decryption message)
Hash table, hash function, bloom filter, consistency hash
Robot reinforcement learning synergies between pushing and grassing with self supervised DRL (2018)
Summer challenge brings you to play harmoniyos multi terminal piano performance
随机推荐
Enterprise application business scenarios, function addition and modification of C source code
IELTS examination process, what to pay attention to and how to review?
Business implementation - the log is written to the same row of data
[paper reading] Tun det: a novel network for meridian ultra sound nodule detection
挖财学院开户安全的吗?开户怎么开?
ORB(Oriented FAST and Rotated BRIEF)
Life is changeable, and the large intestine covers the small intestine. This time, I can really go home to see my daughter-in-law...
Fast analysis -- easy to use intranet security software
lambda expressions
How to avoid arc generation—— Aafd fault arc detector solves the problem for you
Actual combat simulation │ JWT login authentication
多回路仪表在基站“转改直”方面的应用
2022.07.03(LC_6109_知道秘密的人数)
Fs8b711s14 electric wine bottle opener MCU IC scheme development special integrated IC
PermissionError: [Errno 13] Permission denied: ‘data. csv‘
Deux nombres se remplacent
[IELTS reading] Wang Xiwei reading P4 (matching1)
IT转测试岗,从迷茫到坚定我究竟付出了什么?
圖解網絡:什麼是網關負載均衡協議GLBP?
Is it safe to open an account in the College of Finance and economics? How to open an account?