path aliases in drupal 7
You have to iterate over all nodes in $result to do that. array_pop() only returns the last item in $result. So you'll have to do something like this:

$paths = array();
if (isset($result['node']))
{
  foreach($result['node'] as $key =&gt; $node) {
    $paths[$node-&gt;nid] = drupal_get_path_alias("node/$node-&gt;nid");
  }
}


After this $paths will contain an array of keys that map to each node id with a value that corresponds to its alias path.