Tutorial by Examples

When executing a search, it will be broadcast to all the index/indices shards (round robin between replicas). Which shards will be searched on can be controlled by providing the routing parameter. For example, when indexing tweets, the routing value can be the user name: curl -XPOST 'localhost:9200...
Searches can also be done on elasticsearch using a search DSL.The query element within the search request body allows to define a query using the Query DSL. GET /my_index/type/_search { "query" : { "term" : { "field_to_search" : "search_item" }...
The multi_search option allows us to search for a query in multiple fields at once. GET /_search { "query": { "multi_match" : { "query": "text to search", "fields": [ "field_1", "field_2" ] } }...
A search request can be executed purely using a URI by providing request parameters. Not all search options are exposed when executing a search using this mode, but it can be handy for quick "curl tests". GET Index/type/_search?q=field:value Another useful feature provided is highlight...

Page 1 of 1