wukongd is a search engine working as a standalone service, based on wukong

Hui Chen 64d9394605 给悟空引擎添加持久存储(persistent storage) %!s(int64=12) %!d(string=hai) anos
core d956874197 允许在悟空引擎外部对索引的文档进行分词。 %!s(int64=12) %!d(string=hai) anos
data 77121830e9 第一发 %!s(int64=12) %!d(string=hai) anos
docs 25c266b484 Update feedback.md %!s(int64=12) %!d(string=hai) anos
engine 64d9394605 给悟空引擎添加持久存储(persistent storage) %!s(int64=12) %!d(string=hai) anos
examples 64d9394605 给悟空引擎添加持久存储(persistent storage) %!s(int64=12) %!d(string=hai) anos
testdata 77121830e9 第一发 %!s(int64=12) %!d(string=hai) anos
types 64d9394605 给悟空引擎添加持久存储(persistent storage) %!s(int64=12) %!d(string=hai) anos
utils 2ee88e43ce 添加KV数据库操作工具 %!s(int64=12) %!d(string=hai) anos
README.md edfa41c03a Update README.md %!s(int64=12) %!d(string=hai) anos
license.txt 77121830e9 第一发 %!s(int64=12) %!d(string=hai) anos
wukong.go 77121830e9 第一发 %!s(int64=12) %!d(string=hai) anos

README.md

悟空全文搜索引擎

微博搜索演示 http://soooweibo.com

安装/更新

先安装依赖包

go get -u github.com/huichen/sego
go get -u github.com/huichen/murmur
go get -u github.com/cznic/kv

然后安装悟空引擎

go get -u github.com/huichen/wukong

需要Go版本至少1.1.1

使用

先看一个例子(来自examples/simplest_example.go

package main

import (
	"github.com/huichen/wukong/engine"
	"github.com/huichen/wukong/types"
	"log"
)

var (
	// searcher是协程安全的
	searcher = engine.Engine{}
)

func main() {
	// 初始化
	searcher.Init(types.EngineInitOptions{
		SegmenterDictionaries: "github.com/huichen/wukong/data/dictionary.txt"})

	// 将文档加入索引
	searcher.IndexDocument(0, types.DocumentIndexData{Content: "此次百度收购将成中国互联网最大并购"})
	searcher.IndexDocument(1, types.DocumentIndexData{Content: "百度宣布拟全资收购91无线业务"})
	searcher.IndexDocument(2, types.DocumentIndexData{Content: "百度是中国最大的搜索引擎"})

	// 等待索引刷新完毕
	searcher.FlushIndex()

	// 搜索输出格式见types.SearchResponse结构体
	log.Print(searcher.Search(types.SearchRequest{Text:"百度中国"}))
}

是不是很简单!

然后看看一个入门教程,教你用不到200行Go代码实现一个微博搜索网站。

其它