sphinx Lost connection to MySQL server during query

1.4k Views Asked by At

I'm tyring to convert plain indices to real time by running the following query

ATTACH INDEX comment TO RTINDEX comment_rt;

But when I run it in sphinxql it gives me the following error:

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

My sphinx configuration:

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
}

in the sphinx's documentation at this page it mentions that you should have the following settings prehand:

  • Target RT index needs to be empty.
  • Source disk index needs to have index_sp=0, boundary_step=0, stopword_step=1, dict=crc settings.
  • Source disk index needs to have an empty index_zones setting.
1

There are 1 best solutions below

3
On

The fields and attributes of your Disk index, does not match the definitions in the RT index.

They need to be identical.