...改用较短、较为常见的字词。 实际上有3428条,有许多相关数据,就是搜不到。 require_once '/usr/local/xunsearch/sdk/php/lib/XS.php'; $xs = new XS('zl'); $index = $xs->index; $doc = new XSDocument; $conn=mysql_connect("localhost", "root", "111111") or die("Co...
...f (!$data) return -1; $pos1 = @strpos($data, "百度为您找到相关结果约", 2048) + 33; $pos = ( $pos1 > 33 ) ? $pos1 : -1; $total = 0; if ( $pos > 33 ) { $pos2 = @strpos($data, "个", $pos); $total = trim(substr($data, $pos, $pos2 - $pos1)); ...
...f (!$data) return -1; $pos1 = @strpos($data, "百度为您找到相关结果约", 2048) + 33; $pos = ( $pos1 > 33 ) ? $pos1 : -1; $total = 0; if ( $pos > 33 ) { $pos2 = @strpos($data, "个", $pos); $total = trim(substr($data, $pos, $pos2 - $pos1)); ...
...方法参照 [XSIndex][2]。 对于 ActiveRecord 对象来讲,建议在相关的 `afterSave` 和 `afterDelete` 中进行索引同步。 ```php $data = array('pid' => 1234, 'subject' => '标题', 'message' => '内容'); Yii::app()->search->add($data); // 添加文档 Yii::app()->search->update($da...