diff --git a/sites/all/modules/contrib/apachesolr_views/apachesolr_views.views.inc b/sites/all/modules/contrib/apachesolr_views/apachesolr_views.views.inc
index 035ec19..7dd2e1a 100644
--- a/sites/all/modules/contrib/apachesolr_views/apachesolr_views.views.inc
+++ b/sites/all/modules/contrib/apachesolr_views/apachesolr_views.views.inc
@@ -231,6 +231,18 @@ function apachesolr_views_views_data() {
       'handler' => 'apachesolr_views_handler_sort',
     ),
   );
+  $data['apachesolr']['is_flag_count'] = array(
+    'title' => t('Flag count'),
+    'help' => t('The number of flags for the node.'),
+    'field' => array(
+      'numeric' => TRUE,
+      'handler' => 'views_handler_field_numeric',
+      'click sortable' => TRUE,
+    ),
+    'sort' => array(
+      'handler' => 'apachesolr_views_handler_sort',
+    ),
+  );
   // TODO Get taxonomy fields to work
   if (module_exists('taxonomy')) {
     $data['apachesolr']['tid'] = array(
@@ -275,6 +287,18 @@ function apachesolr_views_views_data() {
       'click sortable' => FALSE,
     ),
   );
+  // is_flag_count field useful for sorting
+  $data['apachesolr']['is_flag_count'] = array(
+    'title' => t('Flag Count'),
+    'help' => t('The number of flags for a node'),
+    'sort' => array(
+      'handler' => 'apachesolr_views_handler_sort',
+    ),
+    'field' => array(
+      'handler' => 'views_handler_field_numeric',
+      'click sortable' => FALSE,
+    ),
+  );
   
   // snippet field
   $data['apachesolr']['snippet'] = array(
@@ -343,4 +367,4 @@ function apachesolr_views_views_data() {
 function apachesolr_views_plugins_alter(&$plugins) {
   // Add apachesolr to the base of the node row plugin.
   $plugins['row']['node']['base'][] = 'apachesolr';
-}
\ No newline at end of file
+}
diff --git a/sites/all/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_field_generic.inc b/sites/all/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_field_generic.inc
index 04317d4..87d79ee 100644
--- a/sites/all/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_field_generic.inc
+++ b/sites/all/modules/contrib/apachesolr_views/handlers/apachesolr_views_handler_field_generic.inc
@@ -115,7 +115,7 @@ class apachesolr_views_handler_field_generic {
         array('id', 'site', 'hash', 'url', 'title', 'body', 'type', 'type_name',
             'path', 'path_alias', 'uid', 'name', 'created', 'changed',
             'last_comment_or_change', 'nid', 'status', 'promote', 'moderate',
-            'sticky', 'tnid', 'translate', 'language', 'comment_count', 'tid',
+            'sticky', 'tnid', 'translate', 'language', 'comment_count', 'is_flag_count', 'tid',
             'vid', 'timestamp'
         ));
   }
