This repository was archived by the owner on Oct 13, 2021. It is now read-only.
Description
Riot version (or commit ref): 0.10.0
Go version: 1.14.2
Operating system and bit: windows amd64
Provide example code:
package main
import (
"log"
"github.com/go-ego/riot"
"github.com/go-ego/riot/types"
"github.com/oldfeel/ofutils"
)
var (
// searcher 是协程安全的
searcher = riot.Engine {}
)
func main () {
// 初始化
searcher .Init (types.EngineOpts {
Using : 3 ,
GseDict : "zh" ,
// GseDict: "your gopath"+"/src/github.com/go-ego/riot/data/dict/dictionary.txt",
})
defer searcher .Close ()
text := "《复仇者联盟3:无限战争》是全片使用IMAX摄影机拍摄"
text1 := "在IMAX影复仇院放映时者"
// 将文档加入索引,docId 从1开始
searcher .Index ("你好,世界" , types.DocData {Content : text })
searcher .Index ("2" , types.DocData {Content : text1 }, false )
// 等待索引刷新完毕
searcher .Flush ()
// engine.FlushIndex()
// 搜索输出格式见 types.SearchResp 结构体
log .Print (ofutils .ToJson (searcher .Search (types.SearchReq {Text : "复仇者大联盟" })))
log .Print (ofutils .ToJson (searcher .Search (types.SearchReq {Text : "《复仇者联盟3:无限战争》是全片使用IMAX摄影机拍摄" })))
}
Description
I want to use Big Avengers to search for Avengers, can it?
...
Reactions are currently unavailable
Description
I want to use Big Avengers to search for Avengers, can it?
...