1 / 19

Sphinx/Coreseek 检索系统介绍

Sphinx/Coreseek 检索系统介绍. 李沫南 coreseek@gmail.com 13121868038 2010.04. 概要. 历史 Sphinx 简介 Coreseek 的增强 Sphinx VS. Lucene 全文检索系统的注意事项 未来特性的展望. 历史. 2006 博客中国的聚会 2006 ICTCLAS 开源版 2007 CRF 分词,搜索第一版 2008 Coreseek 上线 MMSeg

Download Presentation

Sphinx/Coreseek 检索系统介绍

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Sphinx/Coreseek 检索系统介绍 李沫南 coreseek@gmail.com 13121868038 2010.04

  2. 概要 • 历史 • Sphinx简介 • Coreseek 的增强 • Sphinx VS. Lucene • 全文检索系统的注意事项 • 未来特性的展望

  3. 历史 • 2006 博客中国的聚会 • 2006 ICTCLAS 开源版 • 2007 CRF 分词,搜索第一版 • 2008 Coreseek 上线 MMSeg • 2008.10 第一个商业客户 • 2009- 持续改进

  4. 全文检索在Web应用中的作用 • 更好的性能 • 全新的组织内容的方式 • 显著的降低对硬件设备的投入,提升ROI • 让网站更安全 

  5. Sphinx简介 • 使用 C/C++开发 • 支持从MySQL等数据库中读取数据 • 支持初步的数据分布 • 提供 PHP Python 等脚本语言的接口 • 支持作为MySQL 存储引擎(逻辑) • Phrase Ranking • 支持自定义排序公式

  6. Coreseek 对 Sphinx的增强 • 中文分词(MMSeg) • Python Source 多数据源自适应。 • GetSchema • GetKillList • GetFieldOrder • Connected • NextDocument • BuildHits

  7. Sphinx 的部署 • 公开的最大的Shinx部署(2008) • 1,200,000,000+ documents (yes, that’s a billion) • 1.5 terabytes • 1+ million searches/day • 7 boxes x 2 dual-core CPUs = 28 cores • 国内 • Blogbus • ChinaUnix • 51CTO • YiCha • 金融街 • …….

  8. Sphinx VS. MySQL • 独立运行的全文检索引擎 • 由Indexer & Searchd 两部分构成 • 在某些应用中可以分担部分MySQL的工作 • 速度为MySQL 全文查询的 50~100倍 • 更好的相关度算法(BM25) • 限制结果在Max_match 个 VS 全取

  9. 改写SQL为Sphinx方式 • 将基本的单表SELECT改写为 Sphinx 风格 SELECT * FROM table WHERE a=1 AND b=2 ORDER BY c DESC LIMIT 60,20 $client->SetFilter ( “a”, array(1) ); $client->SetFilter ( “b”, array(2) ); $client->SetSortBy ( SPH_SORT_ATTR_DESC, “c” ); $client->SetLimit ( 60, 20 ); $result = $client->Query ( “”, “table” );

  10. Multi-query sample $client = new SphinxClient (); $q = “laptop”; // coming from website user $client->SetSortMode ( SPH_SORT_EXTENDED, “@weight desc”); $client->AddQuery ( $q, “products” ); $client->SetGroupBy ( SPH_GROUPBY_ATTR, “vendor_id” ); $client->AddQuery ( $q, “products” ); $client->ResetGroupBy (); $client->SetSortMode ( SPH_SORT_EXTENDED, “price asc” ); $client->SetLimit ( 0, 10 ); $result = $client->RunQueries ();

  11. 分布式介绍

  12. 两套软件包的中文高亮均有性能问题 • Coreseek通过配置只能选择切分方案,通过PySource可以实现自定义切分方案 • 欢迎指正

  13. Sphinx VSCoreseek • 类似 RedHat VS Ubuntu • Coreseek 关注 • 中文 • 大中华区的用户 • 异构数据源 • CJK问题 • Sphinx 关注 • 实时索引 • 性能

  14. 全文检索系统的实质? • 倒排表 • 排序公式 应用: • 权限模型 • 抄袭检测

  15. 中文搜索的注意事项 • Phrase Ranking • 同义词(义项) • 数据分区 • 词性的作用 • 统计切分的短板

  16. 未来特性的展望 • 定制查询解析器 • 文本分类器 • 关键词提取(识别) • 相关主题 • Sphinx 的介绍书籍 • Sphinx 的中文手册

  17. 可选主题(条件随机场分词) • 引用 黄昌宁 老师的 有字构词 • CRF的性能优化 • 数据分区 • Darts加速批量读取特征值 • Viterbi 解码的优化 • 问题 • 长词倾向 • 结果不稳定 • 内存/性能的 Trade Off

  18. HTTP://WWW.CORESEEK.COM

More Related