-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsolr_resource.module
70 lines (67 loc) · 1.72 KB
/
solr_resource.module
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
// $Id$
/**
* Implementation of hook_autoload_info().
*/
function solr_resource_autoload_info() {
return array(
'SolrResource' => array(
'file' => 'SolrResource.php',
),
);
}
/**
* Implementation of hook_service_resource().
*/
function solr_resource_services_resources() {
$res = array(
// Solr resource
'solr' => array(
'index' => array(
'access arguments' => array('use solr resource search'),
'callback' => 'SolrResource::index',
'args' => array(
array(
'name' => 'query',
'type' => 'string',
'optional' => TRUE,
'default value' => '*.*',
'description' => 'The solr query.',
'source' => array('param' => 'query'),
),
array(
'name' => 'page',
'type' => 'int',
'description' => 'The page offset.',
'optional' => TRUE,
'default value' => 0,
'source' => array('param' => 'page'),
),
array(
'name' => 'fields',
'type' => 'string',
'description' => 'The comma-separated list of fields to return.',
'default value' => '',
'optional' => TRUE,
'source' => array('param' => 'fields'),
),
array(
'name' => 'fields',
'type' => 'array',
'description' => 'Extra parameters for the search.',
'default value' => array(),
'optional' => TRUE,
'source' => array('param'),
),
),
),
),
);
return $res;
}
/**
* Implementation of hook_perm().
*/
function solr_resource_perm() {
return array('use solr resource search');
}