Skip to content

Instantly share code, notes, and snippets.

@babadofar
Last active August 29, 2015 13:59
Show Gist options
  • Save babadofar/10469480 to your computer and use it in GitHub Desktop.
Save babadofar/10469480 to your computer and use it in GitHub Desktop.
Elasticsearch search template demo
curl -XGET "http://localhost:9200/seasonalfoods/_search/template" -d'
{
"template": {
"query": {
"match": {
"ingredients": "{{ingredientsParam}}"
}
}
},
"params": {
"ingredientsParam": "fisk"
}
}'
curl -XGET "http://localhost:9200/seasonalfoods/_search/template" -d'
{
"template": "ingredientsquery",
"params": {
"ingredientsParam": "fisk"
}
}'
{
"query":{
"match":{
"ingredients" : "{{ingredientsParam}}"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment