Elastic search get bucket count

Are you have a test on my query?

The query is return the total count deviceId and some deviceId details