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
1
chankenvin Oct 25, 2017 via Android
请问如何使用?
|
2
qdwang Oct 25, 2017 via iPhone 好强大 支持
|
3
anyforever Oct 25, 2017
可以多些 API 出来,让其它语言方便调用
|
4
myself659410 Oct 25, 2017
相比较于 ES 有什么优势?
|
5
Xrong Oct 25, 2017
比较希望作者出份与 ES 的对比性质的文章
|
6
vway OP @chankenvin 中文文档里面有,可以通过部署工具创建
|
7
vway OP @anyforever 正在写,通过 grpc 来弄
|
9
vway OP @myself659410 简洁高效,部署方便,中文和拼音搜索支持更好
|
10
horsley Oct 25, 2017
看到了悟空的痕迹
|
13
zts1993 Oct 25, 2017
持久化存储是外挂得?
|
16
Morriaty Oct 25, 2017
支持一个!先 clone 一个看看,有机会的话,混个 contributor
|
17
solos Oct 25, 2017
这是 fork 的悟空吧
|
20
NeinChn Oct 25, 2017
看起来没有 two-phase search 之类的 feature
这表示在多 sharding 的情况下,基于 TF-IDF/BM25 以及其他基于全局 scoring 的 case 会有不精确的情况 如果数据量少,或者数据倾斜严重,会有错误排序的问题 不过也看使用场景,有的场景并不太关注这些问题 |
22
whyw Oct 25, 2017 支持, 很好
|
24
alexapollo Oct 25, 2017
TFIDF / BM25 只能得到一个很差的结果,想工业化还比较远的……
|
25
NeinChn Oct 25, 2017
|
26
alexapollo Oct 25, 2017
@NeinChn 搜索引擎不是仅仅用相关性就可以解决的
|
27
vway OP @alexapollo 看应用场景, 而且刚开源目前还在在完善中
|