Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. //weight keywords
  2.         $_k = explode('+',$keywords);
  3.        
  4.         $weight = count($_k);
  5.         $words = array();
  6.         $words2 = array();
  7.        
  8.         foreach ($_k as $word)
  9.         {
  10.             $words[] = urlencode($word.'^'.$weight);
  11.             $words2[] = urlencode($word.'^'.$weight*0.5);
  12.             $weight--;
  13.         }
  14.        
  15.         $keywords = 'title:'.implode('+',$words2).'+allFields:'.implode('+',$words);
  16.        
  17.         $client->setUri($this->_buildUri($keywords));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement