Add flag counter in views Module(Search API index)
Use these two modules drupal like and flag simultaneously

Go to /admin/structure/flags create flag ,and  configure it properly.

Go to your view add  Global: PHP field

 &lt;?php
print flag_create_link('bookmarks',$node-&gt;nid);

 $counts = flag_get_counts('node', $node-&gt;nid);
if(isset($counts['bookmarks'])){
 echo $counts['bookmarks'] .' Likes';
 }else{
      echo"no user flaged a content";
     }


 ?&gt;


And at last put this code in your themes js file

Drupal.behaviors.your-theme = {

 attach: function (context, settings) { 

 //add your available class below
    jQuery('.view-id-top_users.view-display-id-page .views-field-php .flag-link-toggle').click(function(){

        jQuery(document).ajaxComplete(function() {
         location.reload();
        });
       });
      }
       };


To add the flag link in your content type use code:

   &lt;?php
    global $user ,$base_url;
    if(!$user-&gt;uid) {
   $flag_link = flag_flag_link($flag, $action, $content_id);


   $flag_url = $flag_link['href'];
    if(isset($flag_link['query']['token'])) {

    $flag_url .= '?'.$flag_link['query']['token'];
}

?&gt;

  &lt;a href="&lt;?php echo $base_url;?&gt;/user/login?destination=&lt;?php echo      current_path();?&gt;"&gt;MY-LINK&lt;/a&gt;