Skip to content

Instantly share code, notes, and snippets.

@harryf
Created December 30, 2010 18:49
Show Gist options
  • Save harryf/760115 to your computer and use it in GitHub Desktop.
Save harryf/760115 to your computer and use it in GitHub Desktop.
more advanced search
#!/bin/sh
echo "\nSearching..."
curl -XGET 'http://localhost:9200/techup/events/_search' -d @- <<EOF
{
"query" : {
"filtered" : {
"query" : {
"query_string" : {
"query" : "twitter"
}
},
"filter" : {
"script" : {
"script" : "doc['updated'].date.year < 2011"
}
}
}
},
"sort" : [
{ "updated" : {"reverse" : true} },
"_score"
],
"fields" : ["title", "updated", "link"]
}
EOF
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment