Saturday, 21 February 2015

Installing Sphinx packages on RedHat and CentOS


I used just: 

 yum install sphinx

#edit config 

source src_torrnado
{
    type                    = mysql
    sql_host                = 127.0.0.1 #37.58.58.234
    sql_user                = APP_NAME
    sql_pass                = PASS
    sql_db                  = APP_NAME
    sql_port                = 3306  # optional, default is 3306
    sql_query_pre           = SET NAMES utf8
    sql_query               = SELECT `id`,`categoryId`,`comment`, `tags`, `name`,`hash` FROM `results`;


   
    sql_field_string        = comment
    sql_field_string        = tags
    sql_field_string        = name
    sql_field_string        = hash
     sql_attr_uint    = categoryId


 
    sql_query_info          = SELECT * FROM results WHERE id=$id
}
    
index ix_torrnado
{
#   type                    = rt
    
    source                  = src_APP_NAME
    path                    = /etc/sphinx/APP_NAME/src_APP_NAME
    docinfo                 = extern
    charset_type            = utf-8
#   charset_type            = sbcs
    morphology              = stem_enru
    enable_star             = 1
    min_prefix_len          = 2
    expand_keywords         = 1
    html_strip              = 1
    
    rt_mem_limit            = 4G
}
    
indexer
{
    mem_limit = 128M
}


searchd
{
    listen = 9312
    listen = 9306:mysql41
    log = /etc/sphinx/logs/APP_NAME-searchd.log
    query_log = /etc/sphinx/logs/APP_NAME-query.log
    pid_file = /run/sphinx/searchd.pid
    read_timeout        = 5
    max_children        = 30
    max_matches = 1000
    workers = threads # for RT to work
    thread_stack = 1M
    binlog_path      = /etc/sphinx/logs

}

#creare dirs in /etc/sphinx/ for logs and index and ser perm:

mkdir /etc/sphinx/APP_NAME
mkdir /etc/sphinx/logs
chown -R sphinx:sphinx /etc/sphinx/APP_NAME
chown -R sphinx:sphinx /etc/sphinx/logs
chmod -R 0755 /etc/sphinx/APP_NAME
chmod -R 0755 /etc/sphinx/logs


service searchd start

sudo chkconfig --levels 235 searchd on



No comments:

Post a Comment