နားလည်ထားရမယ့် အချက်
Kibana က Elasticsearch data ကို visualize/explore ဖို့ official web UI ဖြစ်ပြီး dashboards, charts အပြင် "Dev Tools" ဆိုတဲ့ console feature တစ်ခုပါဝင်ပါတယ်—ဒါက `curl` command တွေ manually ရေးစရာမလိုဘဲ Elasticsearch REST API ကို browser ထဲကနေတိုက်ရိုက် query run နိုင်တဲ့ interactive editor တစ်ခုပါ။ Dev Tools console ရဲ့ syntax ကတော့ raw HTTP request ("GET /tutorials/_search") ကို host/port အပြည့်အစုံ (`http://localhost:9200`) မပါဘဲ shorthand အနေနဲ့ ရေးလို့ရပါတယ်—autocomplete, syntax highlighting, formatted response view ပါလာပြီး response status/timing ကိုလည်း ချက်ချင်းမြင်ရပါတယ်။ Console က query တွေကို quickly iterate လုပ်ဖို့ (mapping စမ်းကြည့်ခြင်း, query DSL debug လုပ်ခြင်း) အလွန်အသုံးဝင်ပေမယ့် production application code ထဲမှာတော့ Dev Tools ကို မသုံးဘဲ official client library (Node.js client) ကိုသာသုံးရပါတယ်—Dev Tools က developer တစ်ဦးရဲ့ interactive exploration tool သာဖြစ်ပါတယ်။ ဒါကို database GUI client (ဥပမာ pgAdmin) နဲ့ application code ထဲက SQL query တွေ ကွာသလိုပဲ တွေးလို့ရပါတယ်—pgAdmin ကို schema explore/debug လုပ်ဖို့သုံးပေမယ့် production app ထဲမှာတော့ driver/ORM ကိုသာ သုံးသလိုမျိုးပါ။
လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်
Tutorial Platform search feature ကို ဒီဇိုင်းလုပ်နေတဲ့အချိန် mapping/query idea အသစ်တစ်ခုကို production code ထဲထည့်ခင် Kibana Dev Tools console ထဲမှာ အရင် စမ်းကြည့်မယ်—`GET /tutorials/_search` ကို tags filter အမျိုးမျိုးနဲ့ run ကြည့်ပြီး result shape ကို visually inspect လုပ်နိုင်ပါတယ်။ Query တစ်ခု production API endpoint ထဲထည့်ဖို့ ready ဖြစ်တဲ့အချိန်ကျမှ Node.js client code ထဲကို port ပြောင်းမယ်—Dev Tools console ထဲက query syntax ကို Node.js client method call အဖြစ် တိုက်ရိုက် map လုပ်ရုံဖြစ်လို့ port ခြင်းက ရိုးရှင်းပါတယ်။
အတူတူ စမ်းရေးကြည့်မယ်
GET /tutorials/_search
{
"query": {
"match": { "title": "redis" }
}
}
GET /_cluster/health
GET /tutorials/_mappingKibana Dev Tools console ထဲမှာ query သုံးခုကို run ပြီး formatted JSON response ကို ချက်ချင်းမြင်ရမည်။၅ မိနစ် စမ်းကြည့်
Kibana Dev Tools console ဖွင့်ပြီး `tutorials` index ရဲ့ mapping ကို `GET /tutorials/_mapping` ဖြင့်ကြည့်ပါ၊ ပြီးရင် `difficulty` field ပေါ်မှာ `match` query တစ်ခုစမ်းရေးပါ။
သတိလေးတစ်ချက်
Kibana Dev Tools console ထဲမှာ successful ဖြစ်တဲ့ query syntax ကို production HTTP client code ထဲ shorthand အတိုင်း (host/port မပါဘဲ) တိုက်ရိုက် copy-paste ခြင်း—full URL မပါလို့ connection error ဖြစ်တတ်ပါတယ်။
Production application logic (data transformation, business rules) ကို Dev Tools console ထဲမှာပဲ manually run ပြီး production system ရဲ့ regular workflow အစားအသုံးပြုခြင်း—console က developer exploration tool ဖြစ်ပြီး automation/repeatable pipeline အတွက် မဟုတ်ပါ။
Kibana Guide — Run API Requests — Elastic