riotsearch 介绍
riot 分布式全文搜索引擎, 采用 Go 语言开发。功能特性:
-
支持计算关键词在文本中的紧邻距离(token proximity)
-
支持计算BM25相关度
-
支持多种持久存储
-
支持 heartbeat
-
可实现分布式索引和搜索
-
采用对商业应用友好的Apache License v2发布
示例代码:
package main import ( "log" "github.com/go-ego/riot" "github.com/go-ego/riot/types" ) var ( // searcher is coroutine safe searcher = riot.Engine{} ) func main() { // Init searcher searcher.Init(types.EngineOpts{ Using: 4, SegmenterDict: "./dict/dictionary.txt"}) defer searcher.Close() text := "Google Is Experimenting With Virtual Reality Advertising" text1 := `Google accidentally pushed Bluetooth update for Home speaker early` text2 := `Google is testing another Search results layout with rounded cards, new colors, and the 4 mysterIoUs colored dots again` // Add the document to the index, docId starts at 1 searcher.IndexDoc(1, types.DocIndexData{Content: text}, false) searcher.IndexDoc(2, types.DocIndexData{Content: text1}, false) searcher.IndexDoc(3, types.DocIndexData{Content: text2}, false) // Wait for the index to refresh searcher.FlushIndex() // The search output format is found in the types.SearchResp structure log.Print(searcher.Search(types.SearchReq{Text: "google testing"})) }
主要改进:
项目详情:
-
Github在线源码:https://github.com/go-ego/riot
-
OSC@GIT:https://gitee.com/veni0/riot
riotsearch 官网
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。