Last active
January 30, 2020 11:25
-
-
Save gizemabali/db6e6ed047fd5d2d9d30f7dd5c25f7c0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> list indices | |
curl -X GET "localhost:9200/_cat/indices?v" | |
>> show elasticsearch health | |
curl -s -X GET 'http://localhost:9200/_cluster/health/' | |
>> delete index | |
curl -XDELETE http://localhost:9200/index_name/ | |
>> ask document count | |
curl -XGET 'http://localhost:9200/index_name/_count?pretty=true' | |
>> search documents | |
curl 'http://localhost:9200/index_name/_search?q=*' | |
curl 'http://localhost:9200/index_name/_search?pretty' | |
>> show index mapping | |
curl -XGET 'http://localhost:9200/index_name/_mapping?pretty=true' | |
>> search with key | |
curl -XGET -H 'Content-Type: application/json' 'http://localhost:9200/index_name/_search' -d ' | |
{ | |
"query": { | |
"match": {"key_id": "value"}} | |
} | |
} | |
' | |
>> search and sort all | |
curl -XGET -H 'Content-Type: application/json' 'http://localhost:9200/index_name/_search' -d ' | |
{ | |
"query": { | |
"match_all": {} | |
}, | |
"sort" : { | |
"timestamp": {"order": "asc"} | |
} | |
} | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment