diff options
Diffstat (limited to 'docs/groovy-api/count.asciidoc')
-rw-r--r-- | docs/groovy-api/count.asciidoc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/docs/groovy-api/count.asciidoc b/docs/groovy-api/count.asciidoc new file mode 100644 index 0000000000..066bb054c5 --- /dev/null +++ b/docs/groovy-api/count.asciidoc @@ -0,0 +1,22 @@ +[[count]] +== Count API + +The count API is very similar to the +link:{java}/count.html[Java count API]. The Groovy +extension allows to provide the query to execute as a `Closure` (similar +to GORM criteria builder): + +[source,js] +-------------------------------------------------- +def count = client.count { + indices "test" + types "type1" + query { + term { + test = "value" + } + } +} +-------------------------------------------------- + +The query follows the same link:{ref}/query-dsl.html[Query DSL]. |