for simple users, search find news and related materiaux only if these materiaux also match with the search
This commit is contained in:
parent
7a46e22394
commit
051455cd71
@ -139,7 +139,6 @@ function materio_search_api_results_search(){
|
||||
// $page = 0;
|
||||
// }
|
||||
|
||||
|
||||
preg_match_all('/\s?[^\s]+\s?/', $typed, $words);
|
||||
// dsm($words, "words");
|
||||
|
||||
@ -227,6 +226,7 @@ function materio_search_api_results_search(){
|
||||
// ->filter($filter);
|
||||
|
||||
$could_results = $could_query->execute();
|
||||
// dsm($could_results, 'could_results');
|
||||
}
|
||||
}
|
||||
catch (SearchApiException $e) {
|
||||
@ -263,6 +263,8 @@ function materio_search_api_results_search(){
|
||||
// dsm($materiaux, 'materiaux');
|
||||
if($materiaux){
|
||||
foreach ($materiaux as $value) {
|
||||
if(!isset($could_results['results'][$value['target_id']]))
|
||||
continue;
|
||||
$materiau = node_load($value['target_id']);
|
||||
if(node_access('view', $materiau))
|
||||
$items[] = $materiau;
|
||||
|
Loading…
x
Reference in New Issue
Block a user