You are here

function apachesolr_site_hash in Apache Solr Search 6

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

Like $site_key in _update_refresh() - returns a site-specific hash.

5 calls to apachesolr_site_hash()
apachesolr_document_id in ./apachesolr.module
Generate a unique ID for an entity being indexed.
apachesolr_nodeaccess_apachesolr_update_index in contrib/apachesolr_nodeaccess/apachesolr_nodeaccess.module
Implementation of apachesolr_update_index
apachesolr_node_to_document in ./apachesolr.index.inc
Given a node ID, return a document representing that node.
DrupalApacheSolrNodeAccess::testIndexing in contrib/apachesolr_nodeaccess/tests/apachesolr_nodeaccess.test
_apachesolr_nodeaccess_build_subquery in contrib/apachesolr_nodeaccess/apachesolr_nodeaccess.module
Creates a Solr query for a given user
1 string reference to 'apachesolr_site_hash'
apachesolr_uninstall in ./apachesolr.install
Implementation of hook_uninstall().

File

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

Code

function apachesolr_site_hash() {
  if (!($hash = variable_get('apachesolr_site_hash', FALSE))) {
    global $base_url;

    // Set a random 6 digit base-36 number as the hash.
    $hash = substr(base_convert(sha1(uniqid($base_url, TRUE)), 16, 36), 0, 6);
    variable_set('apachesolr_site_hash', $hash);
  }
  return $hash;
}