title: Spring-Data elastic search repo count with custom @Query annotation not working "Expected 1 but found 30 results"
body: <p>For my application I have to perform a custom count on elastic, I want to use the @Query annotation for this in the ElasticsearchCrudRepository we use. When I use the following signature:</p>
  
  <pre><code>@Query("CUSTOM BOOL QUERY HERE")
  long countItemsCustom();
  </code></pre>
  
  <p>This leads to a <code>java.lang.IllegalArgumentException: Expected 1 but found 30 results</code> Exception since it is executed as an query instead of an count. For spring-data-cassandra we have a special @CountQuery annotation to solve this issue. Is there a similar solution in spring-data-elasticsearch ?</p>
  
  <p>I could use the elastic client or template to perform a custom query and get the results, but I prefer using the existing repository interface for this if possible.</p>