Browse Source

added facetfilters to eds targets

2.x-ebsco
Paul Pound 11 years ago
parent
commit
6631d1f2a1
  1. 11
      targets/eds/roblib_search_eds.module

11
targets/eds/roblib_search_eds.module

@ -224,8 +224,8 @@ function roblib_search_eds_get_results($query = NULL, $type = NULL) {
$eds_api = new EBSCOAPI($config); $eds_api = new EBSCOAPI($config);
$number_per_page = variable_get('roblib_search_eds_num_results', '5'); $number_per_page = variable_get('roblib_search_eds_num_results', '5');
$query = urlencode($query); $query = urlencode($query);
$query = trim($query . $limiters); $query = $query;
$params = "query=AND,$query&includefacets=n&resultsperpage=$number_per_page"; $params = "query=AND,$query&includefacets=y&$limiters&resultsperpage=$number_per_page";
$output = $eds_api->apiSearch($params); $output = $eds_api->apiSearch($params);
return json_encode($output); return json_encode($output);
} }
@ -234,11 +234,12 @@ function roblib_search_eds_get_query_limiters($type){
$limiters = 'n'; $limiters = 'n';
switch ($type) { switch ($type) {
case 'Articles': case 'Articles':
$limiters = '+AND+(ZT+article)'; $limiters = 'facetfilter=1,SourceType:Magazines,SourceType:News,SourceType:Academic+Journals,SourceType:Conference+Materials';
break; break;
case 'Books': case 'Books':
$limiters = '+AND+(PT+book)'; // $limiters = '+AND+(PT+book)';
break; $limiters = 'facetfilter=1,SourceType:Books,SourceType:Audio,SourceType:Videos';
break;
} }

Loading…
Cancel
Save