Skip to content

Instantly share code, notes, and snippets.

@seanmonstar
Created August 9, 2011 01:24
Show Gist options
  • Select an option

  • Save seanmonstar/1133229 to your computer and use it in GitHub Desktop.

Select an option

Save seanmonstar/1133229 to your computer and use it in GitHub Desktop.
Options for an ES field count filter
{
"filter": {
"script": {
"script": "doc['copies'].values.size() >= 1'"
}
},
"fields": ["id"]
}
Package.search().filter(copies__count__gte=1)
# OR
Package.search().filter(copies__script='values.size() >= 1')
# OR
Package.search().filter(script__script="doc['copies'].values.size() >= 1")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment