Skip to content

dikhimartin/Microservices-Elasticsearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elasticsearch + Kibana 7.10.1

A Distributed RESTful Search Engine

Cara Menjalankan

cp .env.example .env
docker-compose up -d

Manage Kibana

Server Running

http://127.0.0.1:5601

Manage Elasticsearch

Server Running

http://127.0.0.1:9200

Commands Cheat Sheet

http://127.0.0.1:9200/_cat

Create Index (Table)

PUT http://127.0.0.1:9200/{nama_index}

Referensi = https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html

Insert Data (Record)

PUT http://127.0.0.1:9200/{nama_index}/_doc/{id_document}

selanjutnya mendefinisikan field data sesuai dengan kebutuhan

{
    "name_products" : "Produk 1",
    "stock"         : 1,
    "color"         : ["green","yellow","red"]
}

Referensi = https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html

Edit Data (Full Payload)

PUT http://127.0.0.1:9200/{nama_index}/_doc/{id_document}

Dengan menggunakan metode ini disarankan untuk melengkapi request JSON nya, karena nanti proses nya akan melakukan bulk update.

{
    "name_products" : "Produk 1",
    "stock"         : 1,
    "color"         : ["green","yellow","red"]
}



Edit Data (Partial Field)

POST http://127.0.0.1:9200/{nama_index}/_update/{id_document}

Dengan menggunakan ini, data yang di ubah hanya request field yang di cantumkan saja di dalam JSON.

{
    "doc" :{
        "name_products" : "Produk ",
    }
}

Referensi = https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html#update-api-example

Delete Data (Record)

DELETE http://127.0.0.1:9200/{nama_index}/_doc/{id_document}

Referensi = https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html#docs-delete-api-example



Documentation

https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html

License

(c) 2019 Elasticsearch. Licensed under the Apache License, Version 2.0.

About

Microservice Elasticsearch (No Sql Database)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages