<?php set_time_limit(0); define(IN_SITE, true); require 'config.php'; require 'db_class.php'; $db = new dbstuff(); $db->connect($dbhost, $dbuser, $dbpw, $dbname); $max_id = $db->result_first('SELECT MAX(id) FROM unigram2'); $limit = 2000; $start_page = isset($_GET['id']) ? (int)$_GET['id'] : 0; $start_id = $limit * $start_page; if ($start_id > $max_id) exit('ok'); $sql = "SELECT word FROM unigram2 limit {$start_id}, {$limit}"; $query = $db->query($sql); while ($arr = $db->fetch_array($query)) { $str .= $arr['word'] . "\t1\r\nx:1\r\n"; } $file = './unigram3.txt'; $h = fopen($file, 'a'); fwrite($h, $str); $start_page++; $url_forward = 'import.php?id='.$start_page; echo '<script>window.location.href = "'.$url_forward.';;</script>'; ?>
查看更多关于提高sphinx(coreseek)的搜索精度的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did21061