A Distributed RESTful Search Engine
cp .env.example .env
docker-compose up -d
http://127.0.0.1:5601
http://127.0.0.1:9200
http://127.0.0.1:9200/_cat
PUT http://127.0.0.1:9200/{nama_index}
Referensi = https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html
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
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"]
}
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 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
https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html
(c) 2019 Elasticsearch. Licensed under the Apache License, Version 2.0.