-
Efficient indexing and search (1M blog 500M data 28 seconds index finished, 1.65 ms search response time, 19K search QPS)
-
Support for logical search
-
Support Chinese word segmentation (use gse word segmentation package concurrent word, speed 27MB / s)
-
Support the calculation of the keyword in the text close to the distance(token proximity)
-
Support calculation BM25 correlation
-
Support add online, delete index
-
Support heartbeat
-
Support multiple persistent storage
-
Support distributed index and search
-
Can be achieved distributed index and search
Go version >= 1.8
go get -u github.com/go-ego/riot
go get -u github.com/go-ego/re
To create a new riot application
$ re riot my-riotapp
To run the application we just created, you can navigate to the application folder and execute:
$ cd my-riotapp && re run
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.Init(types.EngineInitOptions{
Using: 4,
NotUsingSegmenter: true})
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.SearchResponse structure
log.Print(searcher.Search(types.SearchRequest{Text:"google testing"}))
}
It is very simple!
Supporting riot, buy me a coffee.
Donate money by paypal to my account [email protected]
Riot is primarily distributed under the terms of the Apache License (Version 2.0), base on wukong.