Open command prompt in administrative mode
Type elasticsearch
In browser check this site: http://localhost:9200
or use curl
http://localhost:9200/_cat/health?v&pretty
http://localhost:9200/_cat/nodes?v&pretty
GET /_cat/indices?v&pretty http://localhost:9200/_cat/indices?v&pretty
PUT /index-name
curl -XPUT "localhost:9200/products?&pretty"
Apart from curl, you also use Postman or YARC for handling API request PUT /index-name/document-name/id
{
“field”:”value”,
... : ...
}
Id is optional, if not provided it will generate a unique id for this record
GET /products/mobile/1
curl -GET "localhost:9200/products/mobiles/1?pretty"
curl -GET "localhost:9200/products/mobiles/1?pretty&_source=false"
curl -GET "localhost:9200/products/mobiles/1?pretty&_source=name,reviews"
curl -XPOST -H "Content-Type: application/json" "localhost:9200/products/mobiles/2/_update?pretty" -d "{ \"doc\": { \"color\": \"black\"}}"
DELETE /index-name/document-name/id
curl -XDELETE "localhost:9200/products/mobiles/2?pretty"
DELETE /index-name
curl –XDELETE “localhost:9200/orders”