+ -
当前位置:首页 → 问答吧 → coreseek只显示出来20记录

coreseek只显示出来20记录

时间:2011-04-06

来源:互联网

今天我用了coreseek来测试使用一下,发现用like查询出来的数据有上千条,而coreseek查出来的数据只有20条,后来我加上了setLimits,记录数是多了,但只能显示出80记录数来,还是和like查出来的少了很多很多!!的 csft_mysql.conf的配制如下:
source mysql
{
    type                    = mysql

    sql_host                = localhost
    sql_user                = root
    sql_pass                =
    sql_db                  = test
    sql_port                = 3306
    sql_query_pre            = SET NAMES utf8

    sql_query                = SELECT id,typeid,dtime,title FROM testTable
                                                              #sql_query第一列id需为整数
                                                              #title、content作为字符串/文本字段,被全文索引
  
    sql_attr_uint            = typeid           #从SQL读取到的值必须为整数
    sql_attr_timestamp        = dtime #从SQL读取到的值必须为整数,作为时间属性

    sql_query_info_pre      = SET NAMES utf8                                        #命令行查询时,设置正确的字符集
    sql_query_info            = SELECT * FROM testTable WHERE id=$id #命令行查询时,从数据库读取原始数据信息
}

#index定义
index mysql
{
    source            = mysql             #对应的source名称
    path            = var/data/mysql #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...
    docinfo            = extern
    mlock            = 0
    morphology        = none
    min_word_len        = 2
    html_strip                = 0

    #中文分词配置,详情请查看:http://www.coreseek.cn/products-install/coreseek_mmseg/
    #charset_dictpath = /usr/local/mmseg3/etc/ #BSD、Linux环境下设置,/符号结尾
    charset_dictpath = etc/                             #Windows环境下设置,/符号结尾,最好给出绝对路径,例如:C:/usr/local/coreseek/etc/...
    charset_type        = zh_cn.utf-8
}

#全局index定义
indexer
{
    mem_limit            = 128M
}

#searchd服务定义
searchd
{
    listen                  =   9312
    read_timeout        = 5
    max_children        = 30
    max_matches            = 1000
    seamless_rotate        = 0
    preopen_indexes        = 0
    unlink_old            = 1
    pid_file = var/log/searchd_mysql.pid  #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...

   log = var/log/searchd_mysql.log        #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...
    query_log = var/log/query_mysql.log #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...
}

我的PHP代码:
require ("sphinxapi.php");
$sp = new SphinxClient();
$sp->SetServer('localhost', 9312);
$sp->setLimits(1,10000);
$res = $sp->query('衣',"mysql");
echo '<pre>';
print_r($res);
echo '</pre>';


like的代码:
$sql = "select id,title from testTable where title like '%衣%'";

请帮助解决一下,谢谢了!!!

作者: wu1jun   发布时间: 2011-04-06

很好,很不错

作者: jweson   发布时间: 2011-04-06