updated version of "Exercise 1" for Elasticsearch 7 (skipped a partial update of employee one)
#Welcome to ElasticSearch
GET /
#Get all documents, from all indices, from all types
GET /_search
#Count all documents, from all indices, from all types
GET /_count
#Add document to "employee" index without type (depracted feature) with id 1
POST /employee/_create/1
{
"name": "Feryn"
}
#Retrieve document 1 from "employee" index
GET /employee/_doc/1
#Only get the source, not the meta data
GET /employee/_source/1
#Add employee number 2
POST /employee/_create/2
{
"firstname": "Jonas",
"name": "Dhaenens"
}
#Add employee 3, don't choose the id yourself
POST /employee/_doc
{
"firstname": "Stijn",
"name": "Claerhout"
}
#Overwrite employee 1
POST /employee/_update/1
{
"doc" : {
"firstname": "Thijs"
}
}
#Looks better
GET /employee/_doc/1
#Insert + update = upsert
POST /employee/_update/3
{
"doc": {
"firstname": "Frederik",
"name": "Poelman"
},
"doc_as_upsert": true
}
#Gotta search 'em all
POST /employee/_search
https://github.com/ThijsFeryn/elasticsearch_tutorial/blob/b1cec6cbc052aef5dd1855b9c4e87e4a6383c1c6/data/1_basics.json
updated version of "Exercise 1" for Elasticsearch 7 (skipped a partial update of employee one)