Intenta usar el constructor de tu DTO.
Declarar un nuevo constructor
public TopProductDTO(String text, Integer count) {
this.text = text;
this.count = count;
}
En su consulta use el nuevo Constructor
@Query("SELECT new TopProductDTO(p.textToSearch, count(id))FROM Product p GROUP BY text_to_search ORDER BY counter DESC")
List<TopProductDTO> findTopProducts();
}
Utilice el nombre completo de su clase.