1

我很想通过运行以下查询将普通索引转换为实时

ATTACH INDEX comment TO RTINDEX comment_rt;

但是当我在 sphinxql 中运行它时,它给了我以下错误:

WARNING: sql_query_post[0]: error=Lost connection to MySQL server during query, 
query=ATTACH INDEX comment TO RTINDEX comment_rt

我的狮身人面像配置:

source base
{
    type = mysql
    sql_host = localhost
    sql_user = root
    sql_pass = NastyBalls123
    sql_db   = telefind
    sql_port = 3306 # optional, default is 9306

}

source comment : base
{
    sql_query = \
    SELECT id, content, thread_id, user_id, rank, level, \
    UNIX_TIMESTAMP(date_time_added) AS date_time FROM comment

    sql_attr_uint = id
    sql_attr_uint = thread_id
    sql_attr_uint = user_id
    sql_attr_uint = rank
    sql_attr_uint = level
    sql_attr_timestamp = date_time
}

index comment 
{
    source = comment
    charset_type = sbcs
    path = /usr/local/sphinx/data/non_rt/comment
    phrase_boundary_step = 0

    index_sp = 0
    stopword_step = 1
    dict = crc
}

index comment_rt
{
    type            = rt
    rt_mem_limit        = 32M

    path            = /usr/local/sphinx/data/comment_rt
    charset_type        = utf-8

    rt_field        = title
    rt_field        = content
    rt_attr_uint        = group_id
    rt_attr_timestamp = date_added
}

此页面的 sphinx 文档中,它提到您应该预先进行以下设置:

  • 目标 RT 索引需要为空。
  • 源盘索引需要有index_sp=0、boundary_step=0、stopword_step=1、dict=crc设置。
  • 源磁盘索引需要有一个空的 index_zones 设置。
4

1 回答 1

1

您的磁盘索引的字段和属性与 RT 索引中的定义不匹配。

它们必须相同。

于 2012-10-18T22:17:10.207 回答