
riot 分布式全文搜索引擎, 采用 Go 语言开发。功能特性:
示例代码:
packagemain import( "log" "github.com/go-ego/riot/engine" "github.com/go-ego/riot/types" ) var( //searcheriscoroutinesafe searcher=engine.Engine{} ) funcmain(){ //Initsearcher searcher.Init(types.EngineInitOptions{ Using: 5, SegmenterDict:"./dict/dictionary.txt"}) defersearcher.Close() //Addthedocumenttotheindex,docIdstartsat1 searcher.IndexDocument(1,types.DocIndexData{Content:"GoogleIsExperimentingWithVirtualRealityAdvertising"},false) searcher.IndexDocument(2,types.DocIndexData{Content:"GoogleaccidentallypushedBluetoothupdateforHomespeakerearly"},false) searcher.IndexDocument(3,types.DocIndexData{Content:"GoogleistestinganotherSearchresultslayoutwithroundedcards,newcolors,andthe4mysteriouscoloreddotsagain"},false) //Waitfortheindextorefresh searcher.FlushIndex() //Thesearchoutputformatisfoundinthetypes.SearchResponsestructure log.Print(searcher.Search(types.SearchRequest{Text:"googletesting"})) } 主要改进:
项目详情:
Github 在线源码: https://github.com/go-ego/riot
1 chankenvin 2017-10-25 03:46:19 +08:00 via Android 请问如何使用? |
2 qdwang 2017-10-25 06:33:21 +08:00 via iPhone 好强大 支持 |
3 anyforever 2017-10-25 09:06:19 +08:00 可以多些 API 出来,让其它语言方便调用 |
4 myself659410 2017-10-25 09:11:49 +08:00 相比较于 ES 有什么优势? |
5 Xrong 2017-10-25 09:12:09 +08:00 比较希望作者出份与 ES 的对比性质的文章 |
6 vway OP @chankenvin 中文文档里面有,可以通过部署工具创建 |
7 vway OP @anyforever 正在写,通过 grpc 来弄 |
9 vway OP @myself659410 简洁高效,部署方便,中文和拼音搜索支持更好 |
10 horsley 2017-10-25 09:33:16 +08:00 看到了悟空的痕迹 |
13 zts1993 2017-10-25 09:35:01 +08:00 持久化存储是外挂得? |
16 Morriaty 2017-10-25 10:06:21 +08:00 支持一个!先 clone 一个看看,有机会的话,混个 contributor |
17 solos 2017-10-25 11:57:07 +08:00 这是 fork 的悟空吧 |
20 NeinChn 2017-10-25 12:19:48 +08:00 看起来没有 two-phase search 之类的 feature 这表示在多 sharding 的情况下,基于 TF-IDF/BM25 以及其他基于全局 scoring 的 case 会有不精确的情况 如果数据量少,或者数据倾斜严重,会有错误排序的问题 不过也看使用场景,有的场景并不太关注这些问题 |
22 whyw 2017-10-25 17:00:24 +08:00 支持, 很好 |
24 alexapollo 2017-10-25 19:53:13 +08:00 TFIDF / BM25 只能得到一个很差的结果,想工业化还比较远的…… |
25 NeinChn 2017-10-25 20:04:16 +08:00 |
26 alexapollo 2017-10-25 22:52:29 +08:00 @NeinChn 搜索引擎不是仅仅用相关性就可以解决的 |
27 vway OP @alexapollo 看应用场景, 而且刚开源目前还在在完善中 |