You are here

function _apachesolr_exclude_types in Apache Solr Search 5.2

Same name and namespace in other branches
  1. 6 apachesolr.module \_apachesolr_exclude_types()
2 calls to _apachesolr_exclude_types()
apachesolr_get_nodes_to_index in ./apachesolr.module
Returns an array of rows from a query based on an indexing namespace.
apachesolr_index_status in ./apachesolr.module
Helper function for modules implementing hook_search's 'status' op.

File

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

Code

function _apachesolr_exclude_types($namespace) {
  extract(apachesolr_get_last_index($namespace));
  $excluded_types = module_invoke_all('apachesolr_types_exclude', $namespace);
  $args = array(
    $last_change,
    $last_change,
    $last_nid,
  );
  $join_sql = '';
  $exclude_sql = '';
  if ($excluded_types) {
    $excluded_types = array_unique($excluded_types);
    $join_sql = "INNER JOIN {node} n ON n.nid = asn.nid ";
    $exclude_sql = "AND n.type NOT IN(" . db_placeholders($excluded_types, 'varchar') . ") ";
    $args = array_merge($args, $excluded_types);
  }
  return array(
    $excluded_types,
    $args,
    $join_sql,
    $exclude_sql,
  );
}