微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

riotsearch 分布式全文搜索引擎

程序名称:riotsearch

授权协议: Apache

操作系统: 跨平台

开发语言: Google Go

riotsearch 介绍

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

示例代码

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"}))
}

主要改进:

项目详情:

riotsearch 官网

https://gitee.com/veni0/riot

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐