You are here

function apachesolr_get_nodes_to_index in Apache Solr Search 5.2

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

Returns an array of rows from a query based on an indexing namespace.

1 call to apachesolr_get_nodes_to_index()
apachesolr_search_update_index in ./apachesolr_search.module
Implementation of hook_update_index().

File

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

Code

function apachesolr_get_nodes_to_index($namespace, $limit) {
  $rows = array();
  if (variable_get('apachesolr_read_only', APACHESOLR_READ_WRITE)) {
    return $rows;
  }
  list($excluded_types, $args, $join_sql, $exclude_sql) = _apachesolr_exclude_types($namespace);
  $result = db_query_range("SELECT asn.nid, asn.changed 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 . "ORDER BY asn.changed ASC, asn.nid ASC", $args, 0, $limit);
  while ($row = db_fetch_object($result)) {
    $rows[] = $row;
  }
  return $rows;
}