Show status:
curl -X GET http://localhost:9200/
Show all indexes:
curl -X GET 'localhost:9200/_cat/indices?v'
Show all types:
curl -X GET http://localhost:9200/landaumedia/_all/mappings
Create index:
curl -X PUT http://localhost:9200/gdg?pretty
Delete index:
curl -X DELETE http://localhost:9200/gdg?pretty
Create Document:
curl -X PUT http://localhost:9200/gdg/article/_create -d '{}'
List all Articles:
curl -X GET http://localhost:9200/gdg/article/_search?pretty
Simple Search:
curl -X GET 'http://localhost:9200/gdg/_search?q=content:facebook'
Fuzzy Search:
curl -X GET http://localhost:9200/gdg/article/_search?pretty -d '
{ "query" :
{
"fuzzy" : { "content" : "facbook" }
}
}'
Highlight
curl -X GET http://localhost:9200/gdg/article/_search?pretty -d '
{
"query": {
"fuzzy": {
"content": "facbook"
}
},
"highlight": {
"fields": {
"content": {}
}
}
}
'
Date Range Query
curl -X GET http://localhost:9200/gdg/article/_search?pretty -d '
{
"query": {
"range": {
"datePublished": {
"gte": "2015-09-23",
"lt": "now"
}
}
}
}'