实施索引配置: #RT实时索引配置,详情请查看:http://www.coreseek.cn/products-install/rt-indexes/ #RT实时索引定义 index rtindex { type = rt path = var/data/rtindex #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/... docinfo = extern mlock = 0 morphology = none min_word_len = 1 html_strip = 0 #中文分词配置,详情请查看:http://www.coreseek.cn/products-install/coreseek_mmseg/ #charset_dictpath = /usr/local/mmseg3/etc/ #BSD、Linux环境下设置,/符号结尾 charset_dictpath = etc/ #Windows环境下设置,/符号结尾,最好给出绝对路径,例如:C:/usr/local/coreseek/etc/... charset_type = zh_cn.utf-8 #RT实时索引字段配置,详情请查看:http://www.coreseek.cn/products-install/rt-indexes/ #字段设置顺序:field, uint, bigint, float, timestamp, string;顺序不可颠倒,否则产生混乱 #使用后,不可更改字段设置,除非删除所有索引文件重新建立,否则产生混乱 #文档编号字段 #id #系统自动处理 #全文索引字段 rt_field = title #全文索引字段 rt_field = content #全文索引字段 #属性字段 rt_attr_uint = groupid rt_attr_bigint = biguid rt_attr_float = score rt_attr_timestamp = date_added #存储内容字段 rt_attr_string = author #存储author的内容 #已设置全文索引,并需要同时存储内容的字段 rt_attr_string = title #同时存储title的内容 rt_attr_string = content #同时存储content的内容 #RT实时索引内存设置 rt_mem_limit = 512M } #searchd服务定义 searchd { listen = 9312 listen = localhost:9306:mysql41 #MySQL 协议支持与SphinxQL,详情请查看:http://www.coreseek.cn/docs/coreseek_3.2-sphinx_0.9.9.html#sphinxql read_timeout = 5 max_children = 30 max_matches = 1000 seamless_rotate = 0 preopen_indexes = 0 unlink_old = 1 pid_file = var/log/searchd_rtindex.pid #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/... log = var/log/searchd_rtindex.log #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/... query_log = var/log/query_rtindex.log #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/... binlog_path = var/log/rtindex/ #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/... binlog_flush = 2 binlog_max_log_size = 16M }
PHP测试程序: