You are here

function apachesolr_nodeaccess_apachesolr_update_index in Apache Solr Search 5

Same name and namespace in other branches
  1. 5.2 contrib/apachesolr_nodeaccess/apachesolr_nodeaccess.module \apachesolr_nodeaccess_apachesolr_update_index()
  2. 6 contrib/apachesolr_nodeaccess/apachesolr_nodeaccess.module \apachesolr_nodeaccess_apachesolr_update_index()
  3. 6.2 contrib/apachesolr_nodeaccess/apachesolr_nodeaccess.module \apachesolr_nodeaccess_apachesolr_update_index()

Implementation of apachesolr_update_index

2 calls to apachesolr_nodeaccess_apachesolr_update_index()
apachesolr_nodeaccess_apachesolr_attachments_update_index in contrib/apachesolr_nodeaccess/apachesolr_nodeaccess.module
Implementation of apachesolr_attachments_update_index
DrupalApacheSolrNodeAccess::testIndexing in contrib/apachesolr_nodeaccess/tests/apachesolr_nodeaccess.test

File

contrib/apachesolr_nodeaccess/apachesolr_nodeaccess.module, line 6

Code

function apachesolr_nodeaccess_apachesolr_update_index(&$document, $node) {
  if (count(module_implements('node_grants'))) {

    // Get node access grants
    $result = db_query('SELECT * from {node_access} WHERE nid = %d AND grant_view = 1', $node->nid);
    while ($grant = db_fetch_object($result)) {
      $key = 'nodeaccess_' . $grant->realm;
      $document
        ->setMultiValue($key, $grant->gid);
    }
  }
}