2007년 12월 30일 일요일

sphinx test

sphinx.conf 파일(한글도 물론 잘된다!)

source src1
{
    type                    = mysql
    sql_host                = localhost
    sql_user                = user
    sql_pass                = password
    sql_db                  = database
    sql_port                = 3306
    sql_sock                = /var/run/mysqld/mysqld.sock
    sql_query_pre           = SET NAMES utf8
    sql_query_range         = SELECT MIN(idx),MAX(idx) FROM test
    sql_range_step          = 1024
    sql_query   = \
    SELECT idx, type, search \
    FROM test \
    WHERE idx >= $start AND idx <= $end
    sql_attr_uint           = type
    sql_ranged_throttle     = 0
}

source src1throttled : src1
{
    sql_ranged_throttle     = 100
}

index test1
{
    source          = src1
    path            = /usr/local/sphinx/var/data/test1
    docinfo         = extern
    mlock           = 0
    morphology      = none
    min_word_len    = 1
    charset_type    = utf-8
    charset_table   = 
    min_prefix_len  = 0
    min_infix_len   = 2
    enable_star     = 1
    ngram_len       = 1
    html_strip      = 0
}

index test1stemmed : test1
{
    path            = /usr/local/sphinx/var/data/test1stemmed
    morphology      = stem_en
}

index dist1
{
    type                = distributed
    local               = test1
    local               = test1stemmed
    agent               = localhost:3313:remote1
    agent               = localhost:3314:remote2,remote3
    agent_connect_timeout   = 1000
    agent_query_timeout     = 3000
}

indexer
{
    mem_limit           = 256M
}

searchd
{
    address             = 127.0.0.1
    port                = 3312
    log                 = /usr/local/sphinx/var/log/searchd.log
    query_log           = /usr/local/sphinx/var/log/query.log
    read_timeout        = 5
    max_children        = 2048
    pid_file            = /usr/local/sphinx/var/log/searchd.pid
    max_matches         = 10000
    seamless_rotate     = 1
    preopen_indexes     = 0
    unlink_old          = 1
}

댓글 없음: