測試solr源碼
-
set_time_limit(0);
-
- $a[1] = array("發的","比薩","無論", "是否","魔獸世界","而是","測試","就是","無語","米哦","明強","話人生命過喝過","比賽","明卻","統一阿薩姆","耐材","龔彬","時間老人是一把犀利的劍","沒有鬱悶的今天是你做大的失敗","沉默才是最好的結局","千千靜聽","我","是","中國人","打死小日本","是嗎","明白否","或你與我無奈", "今晚你還在");
- $a[2] = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 ,17,18,19,20,21,22,23,24,25,26,28,29,30);
- $a[3] = array('a','b','c' ,'d','e','f','g','h','i','j','k','l','o','p','q',' r','s','t','u','v','w','w','x','y','z','m','n','ppppppdfsfdaspsdapp' ,'sadasjhsddfhfds','hsecfdf','sdasw');
- $a[4] = array('あ','い','う','え','お','か','き','く','け','こ','さ','し','す','せ','そ','た','ち','つ','て' ,'と','な','に','ぬ','ね','の','は','ひ','ふ','へ','ほ','ま','み','む','め','も','や','ゆ','よ','ら','り','る','れ','ろ','わ' ,'をん','卐');
- $b[1] ='dsadsahu說的哈金斯的哈聖誕節啊實打實的撒嬌的哈市厚度為何打死阿的哈市將的撒加和大家上課還是地方和的飛灑解放後薩金鳳凰是大方看見見范德薩發范德薩的豐厚的時候發貨就';
- $b[2] ='sdh技術的犯賤啊范德薩的就咖啡的數據庫的飛灑撒嬌東方航空實得分的飛灑的肺結核撒方式的空間的算法客戶端和打死范德薩的撒黃金時代假按揭速度發貨交換機十大的撒嬌合';
- $b[3] ='肥市大環境會飛的撒嬌的撒嬌發好貨發哈哈哈盛大手機一阿達阿達打倒薩的啊的蘇額我的敖德薩倒薩大u大家歡迎暈乎乎的撒阿薩德哈哈大廈打的煎熬肯定卡阿是導航鍵阿薩德的啊大河的啊手機號的愛上打死很大按客戶大數據打撒旦教哈市回家金黃色的換句話交換機環環緊扣和大家見斤磅計較結婚的很好的話和的蝴蝶結阿薩德和哈師大飛放大束帶結髮加大師分家境好發的說法實打實的房還是的境況的說法i';
- $b[4] ='發生的多少可接受的示範店空間看法術打擊是發動機實得分京東方少上瘋狂的康師傅咖啡數據庫款了費德勒了會計法大數據卡是房價是短發了空間是引擎咖啡色的幾時放假發獎金封口費簡單即空時發動機盧卡斯的罰款了近段時間開發見范德薩克里夫淨空法師的盡量少的付款後發生的看來減肥四大皆空快瘋掉了看回房間了開發商的境況發的說法是合肥市是短髮見後發生的見後發生的進來砍發生的和咖啡色的伙食費的發生的看見是短髮接口的';
- //$b5 ='方式見風與的飛灑usd發u盾飛灑啥時候聚精會神換句話說數據愛好是的哈的師傅何虹健的法術u華東師範合肥市的和客戶放得開戶數的肯定方式就接口的撒謊發的還是地方客戶是東方紅開始的付款和發上等貨速度了第三方很速度領導方式開戶行是東方紅是東方紅的服飾華東師範好撒的發浮點數撒的發和水電費後空撒的發和是東方紅是東方紅的伙食費華東師范金黃色';
-
-
- /**
- $t1 = microtime(true);
-
- $s = "";
- for($i = 0; $i {
- $min = rand(1,4);
- $index = rand( 2,18);
- if($i % 10 == 1)
- {
- $s .="
";
- $cli = "curl http://192.168. 10.30:8080/solr/update?commit=true -H 'Content-Type: text/xml' --data-binary '{$s}'";
- system($cli);
- $s = "";
- echo 'succes';
-
- }
- else
- {
- $s .= "zmsd" .$i."isdahiii".$a[$min][$index]. $b[$min]."一百萬5991";
- }
- }
- $t2 = microtime(true);
- $t = $t2 - $t1;
- 回顯$t;
- */
- for($i=0; $i {
- $x = rand(1,4);
- $y = rand(1,20);
- $z = rand(1,20);
- $w = rand(1,14);
- $url='http://192.168.10.30:8080/solr/collection1/select?q=name:'.urlencode($a[$x][$y ])。或名稱:'.urlencode($a[$x][$w])。 '或名稱:'.urlencode($a[$x][$z])。 '或名稱:'.urlencode($a[$x][$z 1]).'&wt=json&indent=true';
- $urld='http://192.168.10.30:8080/solr/collection1/ select ?q=名稱:'.$a[$x][$y].'或名稱:'.$a[$x][$w].'或名稱:'.$a[$x][$ z]。 '或名稱:'.$a[$x][$z 1].'&wt=json&indent=true';
-
-
- $ret = http_post($url);
-
- $ aInfo = json_decode($ret, true);
- $iTime = $aInfo['responseHeader']['QTime'];
- $iRow = $aInfo['response']['numFound'];
- $msg = $i."t".'[查詢]:'.$urld."t".'[時間]:'.$iTime."t"."[行]:".$iRow. " n";
- error_log($msg,3,"/home/fanhy/test/solrtest.txt");
- }
- 函數http_post($url, $data="")
- { /*{{{*/
-
- $ch =curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_POST,true);
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_TIMEOUT, 120);
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120) ;
- curl_setopt($ch, CURLOPT_NOSIGNAL, 1 );
- $res = curl_exec($ch);
-
- //var_dump($res);
- $errno =
- //var_dump($res);
- $errno = curl_errno = curl_errch );
- $errmsg = curl_error($ch);
- curl_close($ch);
- return $res;
}/*}}*/ ?>
| 複製程式碼