You are here

function apachesolr_index_status in Apache Solr Search 5.2

Same name and namespace in other branches
  1. 8 apachesolr.index.inc \apachesolr_index_status()
  2. 6.3 apachesolr.index.inc \apachesolr_index_status()
  3. 6 apachesolr.module \apachesolr_index_status()
  4. 6.2 apachesolr.module \apachesolr_index_status()
  5. 7 apachesolr.index.inc \apachesolr_index_status()

Helper function for modules implementing hook_search's 'status' op.

2 calls to apachesolr_index_status()
apachesolr_search_help in ./apachesolr_search.module
Implementation of hook_help().
apachesolr_search_search in ./apachesolr_search.module
Implementation of hook_search().

File

./apachesolr.module, line 254
Integration with the Apache Solr search application.

Code

function apachesolr_index_status($namespace) {
  list($excluded_types, $args, $join_sql, $exclude_sql) = _apachesolr_exclude_types($namespace);
  $total = db_result(db_query("SELECT COUNT(asn.nid) FROM {apachesolr_search_node} asn " . $join_sql . "WHERE asn.status = 1 " . $exclude_sql, $excluded_types));
  $remaining = db_result(db_query("SELECT COUNT(asn.nid) FROM {apachesolr_search_node} asn " . $join_sql . "WHERE (asn.changed > %d OR (asn.changed = %d AND asn.nid > %d)) AND asn.status = 1 " . $exclude_sql, $args));
  return array(
    'remaining' => $remaining,
    'total' => $total,
  );
}