Skip to content

Instantly share code, notes, and snippets.

@marcusmotill
Created July 14, 2022 16:26
Show Gist options
  • Save marcusmotill/92629ba5adb0dc42abf764c4b5a3d85a to your computer and use it in GitHub Desktop.
Save marcusmotill/92629ba5adb0dc42abf764c4b5a3d85a to your computer and use it in GitHub Desktop.
Query for seeing how many activity defs exist on a team for a given sourceContent type
{
"query": {
"bool": {
"must": [
{
"has_parent": {
"parent_type": "globalDefinition",
"score": true,
"query": {
"term": {
"activity.sourceContentType": "account"
}
}
}
}
]
}
},
"aggs":{
"teams": {
"terms":{
"field": "teamId"
}
}
},
"size": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment