Counts not working in es.
And query search is on repository so the count for the same query must also be on the same repository
Merge pull request #1511 from erwinwinder/master

Counts not working in es.