This blog , I'm writing about methods , You can put the corresponding field in the corresponding position

notes :elasticsearch in , The index is equivalent to MySQL Database in , A type is equivalent to a table in a database , The index name is the database name , The type is the table name

1、 Create index

Mode one :

PUT /lib/

{

"settings": {

"index":{

"number_of_shards":3,

"number_of_replicas":1

}

}

}

Mode two : Use the default id(id Is a random string )

PUT /lib2

2、 Check index details

View the specified index

GET /lib/_settings

Look at the index

GET _all /_settings

3、 Insert data into the index

( One ) Specify with id The way

PUT / Index name / type /id{

Field name : value 1,

Field name 2: value 2

}

(1) I do not know! id The way

POST / Index name / type /{

Field name : value 1,

Field name 2: value 2

}

4、 Query data

Display values throughout the document

GET / Index name / type /id

Display the values of parts in the document

GET/ Index name / type /id?_source= Field 1, Field 2

5、 Add type on the basis of existing index , And set the fields under the type mapping

# New insights 
PUT /article/_mapping/up_informationComment
{
"up_informationComment":{
"properties":{
"informationCode":{"type":"keyword"},
"createTime":{"type":"date"},
"replyCode":{"type":"keyword"},
"content":{"type":"text","analyzer":"ik_max_word"},
"replyType":{"type":"keyword"},
"parentCode":{"type":"keyword"} }
}
}

/6、 Modifying data

One 、 Modify the value in the inserted statement and re insert it

Two 、 Modify only the specified fields

POST / Index name / type /id/_update

{

“doc”:{

Field name : value

}

}

7、 Delete

(1) Delete the specified document

DELETE / Index name / type /id

(2) Delete index

DELETE Index name

Technology lies in communication ! If you have any comments or questions, please contact me ; The blog number is :https://home.cnblogs.com/u/chenyuanbo/

Use kibana operation elasticsearch Add, delete, modify and check more related articles

  1. C# operation Excel Data addition, deletion, modification and query ( turn )

    C# operation Excel Data addition, deletion, modification and query . First create ExcelDB.xlsx file , And add two worksheets . Worksheet 1: UserInfo surface , Field :UserId.UserName.Age.Address.CreateT ...

  2. C# operation Excel Examples of data addition, deletion, modification and query

    Excel Data addition, deletion, modification and query we can use c# To operate , First create ExcelDB.xlsx file , And add two worksheets , Next, follow the steps below C# operation Excel Data addition, deletion, modification and query . First create ExcelDB.xlsx writing ...

  3. sqlite Database operation is introduced in detail Additions and deletions , The cursor

    sqlite Database operation is introduced in detail Additions and deletions , The cursor     This article comes from www.ifyao.com Prohibited reproduced !www.ifyao.com Source code     package com.example ...

  4. java Operating the database : Additions and deletions

    Not much bb I went straight to . Tools :myeclipse 2016,mysql 5.7 Purpose :java Operate the database to add, delete, change and check the commodity information test Database goods surface gid Primary key , Self increasing 1. Entity class Goods: Number of encapsulated databases ...

  5. python Operate three mainstream databases (8)python operation mongodb database ②python Use pymongo operation mongodb Addition, deletion and modification of

    python operation mongodb database ②python Use pymongo operation mongodb Addition, deletion and modification of file http://api.mongodb.com/python/current/api/index.h ...

  6. python operation mysql The database is added, deleted, modified and checked dbutils example

    python operation mysql The database is added, deleted, modified and checked dbutils example # Database configuration file # cat gconf.py #encoding=utf-8 import json # json The dictionary in it can't use single quotation ...

  7. Asp.Net operation MySql Database addition, deletion, modification and query

    Asp.Net operation MySql Database addition, deletion, modification and query , Don't talk too much, just get to the point .git Source code address :https://git.oschina.net/gxiaopan/NetMySql.git  1. install MySQL database ...

  8. SpringBoot operation MongoDB We will increase, delete, and change inspections

    This blog focuses on how to use SpringBoot operation MongoDB. SpringBoot operation MongoDB We will increase, delete, and change inspections (1)pom.xml Introduce dependencies <dependency> <group ...

  9. Java Database connection ——JDBC Basic knowledge of ( Operating the database : Additions and deletions )

    One .JDBC brief introduction JDBC Is the connection java The bridge between application and database . What is? JDBC? Java Language access to a database specification , It's a set API. JDBC (Java Database Connectivit ...

Random recommendation

  1. js Prevent the client from triggering multiple

    Code : /*** Prevent multiple triggers **id Must be unique *fn Fallback function *wait How long is the delay ** Examples of use :* ToPreventMoreTrigger('id', function () {// Be careful id yes ...

  2. Android Handler Processing mechanism ( 3、 ... and ) ——Handler,Message,Looper,MessageQueue

    stay android An asynchronous callback mechanism is provided in Handler, Use it , We can make corresponding notice after finishing a long task handler Basic use : In the main thread , Use handler It's simple ,new One Handle ...

  3. virtual machine Local This machine Double start function vhd local Dual Boot

    In the process of using virtual machines , It is possible that the running requirement of virtual machine is too high , The situation that computers can't do what they want . In order to make virtual machines use more computer resources , The virtual machine can be used as a local dual system , Access local computer resources . Open disk management , Right click on the disk , choice ...

  4. Ants (POJ 1852)

    Title Description : Description An army of ants walk on a horizontal pole of length l cm, each with a constant spe ...

  5. Unity With network function —— Create services , And connect to a specific service

    The game itself needs to create services on the network , Then other games can connect to this service , In addition, real scenes now play the same game effects together . The method is to create a service call Network.InitializeServer( ): yes Networ ...

  6. java properties Yes list Support for

    After testing , Native properties Yes list I won't support it . The reference example is as follows : id=1 id=2 The specific code is as follows : java.util.Properties prop = new Properties() ...

  7. Django Intermediate piece

    Middleware Introduction What is Middleware Middleware is a way to deal with Django Framework level hooks for requests and responses . It's a light weight . Low level plug-in system , For global change Django Input and output of . Each middleware component is responsible for doing some specific work ...

  8. zookeeper Realize the dynamic perception of server up and down

    In the actual production environment, we are generally deployed in a cluster environment , We will deploy the same program on the same servers , At this time, we can use the load balancing server to schedule , But we can't know which server is down very quickly , And then we can use it zook ...

  9. vim How plug-ins are installed -- vim Comment plug-ins and doxygen Function annotation generation plug-in -ctrlp plug-in unit -tabular Equal sign alignment plug-in unit

    Use unzip When Appoint -d Options , It's about decompressing Destination address . This parameter is quite convenient , Than directly unzip To current directory , And then copy it to the target directory , Then delete the unzipped folder in the current directory , It's much more convenient . send ...

  10. laravel Implementation ideas and the principle of each component

    laravel The kernel is a IOC Containers ,IOC It is to instantiate the object itself . By registering in the container , Instantiation through containers . laravel The queue uses redis To achieve .