Sphinx实时索引
来源:互联网 发布:c语言类 编辑:程序博客网 时间:2024/05/22 05:26
1, 首先创建一个表用来储存主索引和增量索引的id值
CREATE TABLE IF NOT EXISTS `sph_counter` ( `s_id` int(10) unsigned NOT NULL auto_increment, `p_id` int(11) NOT NULL, PRIMARY KEY (`s_id`) ) ;
2,改sphinx配置文件
#主数据源source main{type= mysqlsql_host= localhostsql_user= rootsql_pass= rootsql_db= testsql_port= 3306# optional, default is 3306sql_sock= /tmp/mysql.socksql_query_pre= SET NAMES utf8sql_query_pre= SET SESSION query_cache_type=OFF sql_query_pre = replace into sph_coner select 1,max(id) from postsql_query = select id,title,content from post where id<= (select p_id from sph_coner where s_id=1)sql_ranged_throttle= 0sql_query_info= SELECT * FROM post WHERE id=$id}增量数据源source delta : main{sql_query_pre = SET NAMES utf8sql_query = select id,title,content from post where id >= (select p_id from sph_coner where s_id=1)}#主数据索引index main{source= main path= /usr/local/sphinx/var/data/maindocinfo= externmlock= 0morphology= nonemin_word_len= 1charset_type = zh_cn.utf-8charset_dictpath = /usr/local/mmseg/etc/html_strip= 0}#增量数据索引index delta : main{source = deltapath= /usr/local/sphinx/var/data/delta}#索引器indexer{mem_limit=256M}#客户端检索进程searchd{log= /usr/local/sphinx/var/log/searchd.logquery_log= /usr/local/sphinx/var/log/query.logread_timeout= 5client_timeout= 300max_children= 30pid_file= /usr/local/sphinx/var/log/searchd.pidmax_matches= 1000seamless_rotate= 1preopen_indexes= 0unlink_old= 1mva_updates_pool= 1Mmax_packet_size= 8Mmax_filters= 256max_filter_values= 4096}# --eof--
3,测试sphinx时时索引
INSERT INTO `post` (`title`, `content`) VALUES('my title', 'my content'),
<span style="white-space: pre;"> 执行 </span>/usr/local/coreseek/bin/indexer delta –rotate
./search my title
0 0
- Sphinx实时索引
- sphinx 实现实时索引
- Sphinx实时索引
- Sphinx实时索引
- sphinx的实时索引
- sphinx 实时索引更新
- sphinx 增量索引 实现近实时更新
- Sphinx使用及近实时索引实现
- sphinx 增量索引 实现近实时更新
- sphinx 增量索引 实现近实时更新
- sphinx 增量索引 实现近实时更新
- Sphinx使用及近实时索引实现
- sphinx 增量索引 实现近实时更新
- sphinx 增量索引 实现实时更新
- sphinx 增量索引 实现近实时更新
- Sphinx使用及近实时索引实现
- sphinx 增量索引 实现近实时更新
- sphinx 增量索引 实现近实时更新
- java----网络编程(二)UDP
- 默认构造器
- Xcode 6上Swift框架的测试心得
- ReportViewer IIS部署出错,Dll不存在
- 程序启动的完整过程
- Sphinx实时索引
- kafka入门系列一
- DM8168添加DSP音频编解码算法--集成现有voice或audio codec
- 巅峰对决:node.js和php性能测试
- 一名刚工作半年的java程序员的迷茫,求大神指路
- 【20141105】搜索训练
- (入门篇)cocos2d-x导入cocostudio文件
- 邮箱大师Pro版强势来袭 iOS本周限免
- [Leetcode]Triangle