码迷,mamicode.com
首页 > 其他好文 > 详细

Sphinx

时间:2017-12-06 14:26:54      阅读:165      评论:0      收藏:0      [点我收藏+]

标签:localhost   def   ict   string   field   sphinx   open   min   mini   

停止sphix服务:sudo systemctl stop searchd
查看sphix状态:sudo systemctl status searchd
进入sphix文件目录:cd /var/lib/sphinx/
删除已生成的文件: sudo rm *
进入配置文件目录:cd /etc/sphinx/
编辑配置文件:sudo vim sphinx.conf
重启sphix:sudo systemctl start searchd
进入文件目录:cd /var/lib/sphinx/
查看sphix状态:sudo systemctl status searchd
查看起的服务:netstat -lnt

sphinx.conf

#
# Minimal Sphinx configuration sample (clean, simple, functional)
#

index merchant
{
        type                    = rt
        rt_mem_limit            = 128M
        dict                    = keywords
        min_infix_len           = 3
        expand_keywords         = 1

        path                    = /var/lib/sphinx/merchant

        rt_attr_string          = code
        rt_attr_string          = name
        rt_field                = code
        rt_field                = name
        rt_field                = pinyin
}

index user
{
        type                    = rt
        rt_mem_limit            = 128M
        dict                    = keywords
        min_infix_len           = 3
        expand_keywords         = 1

        path                    = /var/lib/sphinx/user

        rt_attr_string          = code
        rt_attr_string          = name
        rt_field                = code
        rt_field                = name
        rt_field                = pinyin
}

index car
{
        type                    = rt
        rt_mem_limit            = 512M
        dict                    = keywords
        min_infix_len           = 3
        expand_keywords         = 1

        path                    = /var/lib/sphinx/car

        rt_attr_string          = name
        rt_field                = brand
        rt_field                = manufacturer
        rt_field                = series
        rt_field                = model
        rt_field                = build
}

index parts
{
        type                    = rt
        rt_mem_limit            = 512M
        dict                    = keywords
        min_infix_len           = 3
        expand_keywords         = 1

        path                    = /var/lib/sphinx/parts

        rt_attr_string          = code
        rt_attr_string          = name
        rt_attr_string          = oe
        rt_attr_string          = brand
        rt_attr_string          = category
        rt_attr_string          = type


        rt_field                = code
        rt_field                = oe
        rt_field                = normalized
        rt_field                = name
        rt_field                = pinyin
}

index brand
{
        type                    = rt
        rt_mem_limit            = 128M
        dict                    = keywords
        min_infix_len           = 1
        expand_keywords         = 1

        path                    = /var/lib/sphinx/brand

        rt_attr_string          = name
        rt_field                = name
        rt_field                = pinyin

}
#source src1
#{
#       type                    = mysql
#
#       sql_host                = localhost
#       sql_user                = test
#       sql_pass                =
#       sql_db                  = test
#       sql_port                = 3306  # optional, default is 3306
#
#       sql_query               = #               SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS date_added, title, content #               FROM documents
#
#       sql_attr_uint           = group_id
#       sql_attr_timestamp      = date_added
#}
#
#
#index test1
#{
#       source                  = src1
#       path                    = /var/lib/sphinx/test1
#}
#
#
#index testrt
#{
#       type                    = rt
#       rt_mem_limit            = 128M
#
#       path                    = /var/lib/sphinx/testrt
#
#       rt_field                = title
#       rt_field                = content
#       rt_attr_uint            = gid
#}
#
#
#indexer
#{
#       mem_limit               = 128M
#}


searchd
{
        #listen                 = 9312
        listen                  = 9306:mysql41
        mysql_version_string    = 5.0.0
        #mysql_version_string   = 5.5.54
        log                     = /var/log/sphinx/searchd.log
        query_log               = /var/log/sphinx/query.log
        read_timeout            = 5
        max_children            = 30
        pid_file                = /var/run/sphinx/searchd.pid
        seamless_rotate         = 1
        preopen_indexes         = 1
        unlink_old              = 1
        workers                 = threads # for RT to work
        binlog_path             = /var/lib/sphinx/
}
                                                                   

 

Sphinx

标签:localhost   def   ict   string   field   sphinx   open   min   mini   

原文地址:http://www.cnblogs.com/fengjunjie-w/p/7992163.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!