-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsearch_api_algolia.api.php
More file actions
40 lines (35 loc) · 1.01 KB
/
search_api_algolia.api.php
File metadata and controls
40 lines (35 loc) · 1.01 KB
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
36
37
38
39
40
<?php
/**
* @file
* Hooks provided by the Search API Algolia search module.
*/
/**
* Lets modules alter the indexed packets sent to algolia.
*
* @param array $algolia_data
* An array of the default packets, keyed by their Search API ID.
* @param object &$algolia_index
* The Index object instance being used by algolia.
*
*/
function hook_search_api_algolia_data_alter(&$algolia_data, \AlgoliaSearch\Index $algolia_index) {
foreach ($items as $node_id => &$item) {
// Alter items as needed.
}
}
/**
* Lets modules alter the IDs sent to algolia for delete operations.
* Needed as the counterpart of hook_search_api_algolia_data_alter if that changes
* the IDs sent to algolia for indexing.
*
* @param array $ids
* The IDs from search_api to be deleted.
* @param object &$algolia_index
* The Index object instance being used by algolia.
*
*/
function hook_search_api_algolia_ids_alter(&$ids, \AlgoliaSearch\Index $algolia_index) {
foreach ($ids as &$id) {
// Change IDs if needed.
}
}