go 分布式全文搜索引擎 RiotSearch

2017-10-25 01:31:08 +08:00
 vway

riot 分布式全文搜索引擎, 采用 Go 语言开发。功能特性:

示例代码:

package main

import (
	"log"

	"github.com/go-ego/riot/engine"
	"github.com/go-ego/riot/types"
)

var (
	// searcher is coroutine safe
	searcher = engine.Engine{}
)

func main() {
	// Init searcher
	searcher.Init(types.EngineInitOptions{
		Using:             5,
		SegmenterDict: "./dict/dictionary.txt"})
	defer searcher.Close()

	// Add the document to the index, docId starts at 1
	searcher.IndexDocument(1, types.DocIndexData{Content: "Google Is Experimenting With Virtual Reality Advertising"}, false)
	searcher.IndexDocument(2, types.DocIndexData{Content: "Google accidentally pushed Bluetooth update for Home speaker early"}, false)
	searcher.IndexDocument(3, types.DocIndexData{Content: "Google is testing another Search results layout with rounded cards, new colors, and the 4 mysterious colored dots again"}, false)

	// Wait for the index to refresh
	searcher.FlushIndex()

	// The search output format is found in the types.SearchResponse structure
	log.Print(searcher.Search(types.SearchRequest{Text: "google testing"}))
}

主要改进:

项目详情:

Github 在线源码: https://github.com/go-ego/riot

6930 次点击
所在节点    程序员
27 条回复
chankenvin
2017-10-25 03:46:19 +08:00
请问如何使用?
qdwang
2017-10-25 06:33:21 +08:00
好强大 支持
anyforever
2017-10-25 09:06:19 +08:00
可以多些 API 出来,让其它语言方便调用
myself659410
2017-10-25 09:11:49 +08:00
相比较于 ES 有什么优势?
Xrong
2017-10-25 09:12:09 +08:00
比较希望作者出份与 ES 的对比性质的文章
vway
2017-10-25 09:27:01 +08:00
@chankenvin 中文文档里面有,可以通过部署工具创建
vway
2017-10-25 09:27:51 +08:00
@anyforever 正在写,通过 grpc 来弄
vway
2017-10-25 09:28:43 +08:00
@Xrong 功能完善后会对比测试
vway
2017-10-25 09:29:37 +08:00
@myself659410 简洁高效,部署方便,中文和拼音搜索支持更好
horsley
2017-10-25 09:33:16 +08:00
看到了悟空的痕迹
vway
2017-10-25 09:33:21 +08:00
@qdwang 感谢支持
vway
2017-10-25 09:34:50 +08:00
@horsley 悟空已经一年不活跃了,基于悟空大幅度改进,还持续在改进和完善
zts1993
2017-10-25 09:35:01 +08:00
持久化存储是外挂得?
vway
2017-10-25 09:39:34 +08:00
@zts1993 实时储存程序启动恢复到内存中,全 disk 和缓存还在计划中,外挂指插件式?
vway
2017-10-25 09:53:03 +08:00
@zts1993 通过接口,扩展很简单
Morriaty
2017-10-25 10:06:21 +08:00
支持一个!先 clone 一个看看,有机会的话,混个 contributor
solos
2017-10-25 11:57:07 +08:00
这是 fork 的悟空吧
vway
2017-10-25 11:58:56 +08:00
@Morriaty 感谢支持
vway
2017-10-25 11:59:34 +08:00
@solos 大幅度改进,主要改进内容上面已提到
NeinChn
2017-10-25 12:19:48 +08:00
看起来没有 two-phase search 之类的 feature
这表示在多 sharding 的情况下,基于 TF-IDF/BM25 以及其他基于全局 scoring 的 case 会有不精确的情况
如果数据量少,或者数据倾斜严重,会有错误排序的问题
不过也看使用场景,有的场景并不太关注这些问题

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/400415

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX