diff --git a/materio_search_api.pages.inc b/materio_search_api.pages.inc index 6e401492..bfce2fe5 100755 --- a/materio_search_api.pages.inc +++ b/materio_search_api.pages.inc @@ -71,7 +71,10 @@ function materio_search_api_autocomplete_searchapi($typed = ''){ // search for patterns like key -another key +lastkey // and provide auto completion for the last key preg_match_all('/\s?[\+|-]?[^\s]+/', $typed, $adv_search_q); + // dsm($adv_search_q, "adv_search_q"); preg_match('/^(\+|-)?(.*)$/', trim(array_pop($adv_search_q[0])), $last); + // dsm($last, "last"); + $tosearch = isset($last[2]) ? $last[2] : $typed; // build the query @@ -97,7 +100,7 @@ function materio_search_api_autocomplete_searchapi($typed = ''){ //$term_matches[$item->tid] = check_plain($item->name); // $term_matches[check_plain($item->name)] = check_plain($item->name); // TODO: leave tags with nodes - $term_matches[ '"'.trim(implode(' ', $adv_search_q[0]).' '.$last[1].$item->name).'"'] = check_plain($item->name); + $term_matches[trim(implode(' ', $adv_search_q[0]).' "'.$last[1].$item->name).'"'] = check_plain($item->name); $delta++; if($delta > 15)