Skip to content

Instantly share code, notes, and snippets.

@grabbeh
Last active August 29, 2015 14:04
Show Gist options
  • Save grabbeh/b8a6a8398836371d02fe to your computer and use it in GitHub Desktop.
Save grabbeh/b8a6a8398836371d02fe to your computer and use it in GitHub Desktop.
Elastic search queries
"query":{
"filtered": {
"query": {
"query_string": { "query": "Brazil" }
},
"filter": {
"term": { "entity": "Guinness World Records" }
}
}
}
}
{
"constant_score" : {
"filter" : {
"term" : { "entity" : "guinness"}
}
}
}
curl -XGET localhost:9200/_search -d '
{
"query": {
"filtered": {
"query": {
"query_string": {"query":"Brazil"}
}, "filter":{"term": {"entity":"ACME INC"}}
}
}
}
'
// WORKING QUERY!
curl -XGET localhost:9200/_search -d '
{
"query": {
"filtered": {
"query": {
"query_string": {"query":"Brazil"}
},
"filter":{
"query": {"query_string":{
"query":"GUINNESS WORLD RECORDS"
}
}
}
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment