Skip to content

Instantly share code, notes, and snippets.

@kenoir
Created November 11, 2020 13:14
Show Gist options
  • Save kenoir/8ee0f4b0aa4a5e7e86a54060e977a1fb to your computer and use it in GitHub Desktop.
Save kenoir/8ee0f4b0aa4a5e7e86a54060e977a1fb to your computer and use it in GitHub Desktop.
Count the documents in which a field exists in Elasticsearch using curl
curl -s localhost:9200/chunks/_count -H 'Content-Type: application/json' -d '{"query": { "bool": { "must": [{"exists":{"field":"transfer_package"}}] } } }' | jq ".count"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment