-
Notifications
You must be signed in to change notification settings - Fork 0
/
solr_best_bets.api.php
35 lines (33 loc) · 1.25 KB
/
solr_best_bets.api.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/**
* @file
* Hooks provided by the Solr Best Bets module.
*/
/**
* Defines environments in order to correctly set the unique identifier.
*
* Module such as Apache Solr Search Integration and Search API create unique
* identifiers differently. This hook allows wach module to build their unique'
* identifiers as they see fit for the different environments they support.
*
* @return array
* An associative array keyed by the machine name of the environment, usually
* in `module`:`environment` format, to an array containing:
* - label: The human readable label of the environment
* - id callbacks: The ID callbacks that are used to convert the content ID
* into the unique identifier stored in the index.
* - id options: (optional) An array of options passed as the second argument
* to the id callabcks.
* - unique field: (optional) The name of the field in the Solr index that
* stores the unique identifier. Defaults to "id".
*/
function hook_solr_best_bets_environment_info() {
return array(
'apachesolr:solr' => array(
'label' => t('Localhost'),
'id callbacks' => array('apachesolr_entity_document_id'),
'id options' => array('some_option' => 'some_value'),
'unique field' => 'id',
),
);
}