Kibana - For Elastic Search
Setup and install Kibana. And please ensure to have the same version as that of elastic search.I have elasatic elasticsearch-5.2.1 and kibana-5.2.1-darwin-x86_64 setup on my box.
To get started -
- Start the elastic search server.
- Start Kibana service.
http://localhost:5601/app/kibana
This will open the console as below :
Go to dev Tools this will open the console as below :
You can now try out several commands in this console and check for the results in the right. The kibana tool is quite intelligent and makes writing queries very easy.
Here are a few commands you could try on the console :
GET /_cat/indices - Give a list of indices
PUT /test-index-1 - this will create an index with the name test-index-1
DELETE /test-index - Deletes the index - with the name test-index
Create an index with Mapping -
A mapping is like a schema. If your type is defined and has no documents you could specify the mapping. A mapping could also be defined at the type of index creation.
Below is an sample index creation with mapping.
product-test - is the index name and
product is the type
PUT product-test
{
"mappings": {
"product":{
"properties": {
"name":{
"type":"string"
},
"price":{
"type": "double"
}
}
}
}
}
Creation of Document with in the index
PUT /product-test/test/001
{
"name":"test",
"price":10.00
}
You may search your document in kibana. Go to discover.
Update / edit a particular field of any document -
POST /product-test/test/002
{
"doc":{
"price":"50.00"
}
}
Delete a document by Id-
DELETE product-test/test/002
Comments
Post a Comment