Last active
August 29, 2015 14:04
-
-
Save grabbeh/b8a6a8398836371d02fe to your computer and use it in GitHub Desktop.
Elastic search queries
This file contains 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
"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