Basic elasticsearch SEARCH queries

Below you find an overview of some elasticsearch SEARCH queries:

MATCH_ALL

curl -XGET 'localhost:9200/test/doc/_search' -d'
{"query" : { "match_all" : {} } }
'

TERM QUERY


{"query": { "term" : {"pub_id":"10795726"} } }

QUERY STRING QUERY

{ "query" : {
"query_string" : {
 "query" : "green OR yellow"
 }
 }
}

EXISTS FILTER

{ "query": {
"constant_score" : {
"filter" : { "exists" : { "field" : "notaries" } }
}
}
}

MISSING FILTER

{ "query": {
 "constant_score" : {
 "filter" : { "missing" : { "field" : "notaries" } }
 }
 }
}