Skip to content

Instantly share code, notes, and snippets.

@hughgrigg
Last active August 2, 2016 14:15
Show Gist options
  • Save hughgrigg/e9df35b9ef815a1f7f1c36d42d533480 to your computer and use it in GitHub Desktop.
Save hughgrigg/e9df35b9ef815a1f7f1c36d42d533480 to your computer and use it in GitHub Desktop.
Pull out query IDs from ElasticSearch
curl -XGET 'http://makersearch.prod.lovecrafts.cool:9200/read-model/_search' -d '
{
"query": {
"filtered": {
"filter": {
"and": [
{
"bool": {
"must": {
"term": {
"product_type": "'"$1"'"
}
}
}
},
{
"bool": {
"must_not": {
"term": {
"es_disabled": 1
}
}
}
}
]
},
"query": []
}
},
"fields": ["_id"],
"from": 0,
"size": 999999
}
' | python -m json.tool | sed -n 's/"_id": "\(.\+\)"/\1/p' | tr -d ' ,' | sort -u
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment