You are here

function apachesolr_site_hash in Apache Solr Search 6.2

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 apachesolr.module \apachesolr_site_hash()
  5. 7 apachesolr.module \apachesolr_site_hash()

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

6 calls to apachesolr_site_hash()
apachesolr_commentsearch_node_to_comments in contrib/apachesolr_commentsearch/apachesolr_commentsearch.module
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_nodeaccess_build_subquery in contrib/apachesolr_nodeaccess/apachesolr_nodeaccess.module
Creates a Solr query for a given user
apachesolr_node_to_document in ./apachesolr.index.inc
Given a node, return a document representing that node.

... See full list

1 string reference to 'apachesolr_site_hash'
apachesolr_uninstall in ./apachesolr.install
Implementation of hook_uninstall().

File

./apachesolr.module, line 169
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;
}