riot

package module
v0.0.0-...-111ab80 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

README

riot full text search engine

CircleCI Status Build Status Go Report Card GoDoc Release

简体中文

Requirements

Go version >= 1.8

Installation/Update

go get -u github.com/go-ego/riot

Build-tools

go get -u github.com/go-ego/re 
re riot

To create a new riot application

$ re riot my-riotapp
re run

To run the application we just created, you can navigate to the application folder and execute:

$ cd my-riotapp && re run

Usage:

Look at an example(simplest_example.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.Init(types.EngineInitOptions{
		NotUsingSegmenter: true})
	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"}))
}

It is very simple!

Donate

Supporting riot, buy me a coffee.

Paypal

Donate money by paypal to my account vzvway@gmail.com

License

Riot is primarily distributed under the terms of the Apache License (Version 2.0), base on wukong.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package core is riot core
Package core is riot core
Package engine is riot engine
Package engine is riot engine
examples
benchmark
riot 性能测试
riot 性能测试
codelab
一个微博搜索的例子。
一个微博搜索的例子。
net
Package net is riot net
Package net is riot net
com
grpc/riot-pb
Package doc is a generated protocol buffer package.
Package doc is a generated protocol buffer package.
Package types is riot types
Package types is riot types

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL