http://club.blogbeta.com/82.html
beta技术沙龙·大型网站的lucene搜索实战
时间:7月26日14点30分开始
地点:奇遇花园咖啡馆 http://storygarden.me/cafe/map
主题:大型网站的lucene搜索实战
演讲简介:本次活动介绍基于Lucene的站内搜索的实践,后台技术层面的一些想法与实践,包括缩短更新周期,简化重建索引流程,支持大数据量频繁更新的索引,以及在性能和可用性方面作的努力。
主讲人:唐福林 (http://blog.fulin.org https://twitter.com/tangfl)
主讲人简介:从 ... (全文...)
本文 只是简单的翻译,原文 在 http://wiki.apache.org/lucene-java/ImproveIndexingSpeed
* Be sure you really need to speed things up.
Many of the ideas here are simple to try, but others will necessarily add some complexity to your application. So be sure your indexing speed is indeed too slow and the slowness is indeed within Lucene.
* 请确认你真的需要更快的索引速度
这里的很多想法都非常容易尝试,但也有一些会给你的程序带来额外的复杂度。所以请确认你的搜索速度 ... (全文...)
本文 为简单翻译,原文在:
http://wiki.apache.org/lucene-java/ImproveSearchingSpeed
* Be sure you really need to speed things up.
Many of the ideas here are simple to try, but others will necessarily add some complexity to your application. So be sure your searching speed is indeed too slow and the slowness is indeed within Lucene.
* 请确认你真的需要更快的搜索速度
这里的很多想法都非常容易尝试,但也有一些会给你的程序带来额外的复杂度。所以请确认你的搜索速度 ... (全文...)
imobile 站内搜索 —— 基于 lucene 的站内搜索,阶段性成果介绍
关键词:准实时搜索,及时更新,快速重建,可配置,可监控,高性能
实现:分离读写,分离索引和存储,拆分大小库,新索引 reopen,新索引预热
结论:
1。lucene 索引删除条目的时候(不 调用 optimize),会修改索引目录的以下文件:segments.gen, segments_N, ***.del
2。lucene 索引目录发生改变后,如果不 reopen index reader,则改变对于 searcher 来说是不可见的。(甚至可以将 idx 目录删除,searcher 仍然能返回结果。测试:idx 目录大小为 1.2G,删除目录后, searcher 搜索热门词仍然正常返回结果,返回结果条数超过4万条)
... (全文...)Lucene 索引滚动流程设计
TangFulin <tangfulin@gmail.com>
一. Index Writer:
1. 这里的 Writer 包括 Index Updater 和 Index Rebuilder ,但 Rebuilder 产生的索引文件不直接传送给 Searcher 使用,
而是覆盖 Updater 的索引,由 Updater 统一处理后续的流程
2. IndexUpdaterScheduler 每隔一段时间会设置 copy out timer 标识。
3. Updater 每次处理完一批 xml 文件后会查看 copy out timer 标识是否已经被设置,
如果是,则将当前的索引拷贝一份到 src-snap 目录下 yyyyMMddHHmm 格式的子目录中
4. Updater 为单线程,每次处理完一批 xml 后都会调用 optimizeAndCloseIdx ,所以可以保证 idx 数据是完整的
... (全文...)
机器配置:
uname -a :
Linux eshequn-SV06-A11 2.6.21.5-smp #1 SMP Sun Jan 27 23:51:02 CST 2008 i686 Intel(R) Xeon(TM) CPU 3.06GHz GenuineIntel GNU/Linux
cpuinfo:
processor : 2
model name : Intel(R) Xeon(TM) CPU 3.06GHz
meminfo:
MemTotal: 6234308 kB
disk info:
/dev/sda1 on / type reiserfs (rw,noatime)
lucene 配置
writer = new IndexWriter(indexDir, paodingAnalyzer, true, IndexWriter.MaxFieldLength.UNLIMITED);
writer.setMaxBufferedDocs(10000);
writer.setUseCompoundFile(true);
一. php client 端:
1. update 与 rebuild 分开
2. update 准实时:insert,update,delete 实时调用更新索引接口(带 primery key 的update 和 delete)
3. rebuild 使用命令行或者 cron 运行,不能使用 web 页面(有运行时间限制),但可以在后台管理系统中作触发(如何防止重复触发?)
二. Java IndexServer:(接受 client 发过来的数据,输出为临时 xml 文件)
1. 日常 update 的 xml 临时文件可以考虑保存在内存文件系统中(保留最近n天的文件debug使用)
2. 更多的处理过程 log (debug 使用,日常监控使用)
3. rebuild 的 xml 临时文件一定要保存在内存文件系统中
4. xml 文件按年或月分目录
... (全文...)转载自 http://www.jalorsoft.com/holen/holen_lucene_02.html
作者:陈光(holen@263.net)
时间:2004-08-26
本文主要讨论Lucene的系统结构,希望对其结构的初步分析,更深入的了解Lucene的运作机制,从而实现对Lucene的功能扩展。
1. Lucene的包结构
如上图所示,Lucene源码中共包括7个子包,每个包完成特定的功能:
Lucene包结构功能表
包名
功能
org.apache.lucene.analysis
语言分析器,主要用于的切词,支持中文主 ... (全文...)