com

package
v0.0.0-...-ff1c243 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDocInx

func AddDocInx(docId string, data types.DocData, forceUpdate bool)

AddDocInx add index document

func Delete

func Delete(docid string, forceUpdate bool)

Delete delete document

func Flush

func Flush()

Flush flsuh the Searcher engine

func InitEngine

func InitEngine(conf Config)

InitEngine init engine

func Search(sea SearchArgs) types.SearchResp

Search search

Types

type Config

type Config struct {
	Engine Engine
	Etcd   Etcd
	Rpc    Rpc

	// Has  [][]string
	Url []string
}

Config search config options

var (
	// Searcher is coroutine safe
	Searcher = riot.Engine{}
	// Conf is config
	Conf Config
)

type Engine

type Engine struct {
	Mode  string
	Using int

	StoreShards int    `toml:"store_shards"`
	StoreEngine string `toml:"store_engine"`
	StoreFolder string `toml:"store_folder"`

	NumShards    int `toml:"num_shards"`
	OutputOffset int `toml:"output_offset"`
	MaxOutputs   int `toml:"max_outputs"`

	GseDict       string `toml:"gse_dict"`
	GseMode       string `toml:"gse_mode"`
	StopTokenFile string `toml:"stop_token_file"`

	Relation string
	Time     string
	Ts       int64
}

Engine search engine options

type Etcd

type Etcd struct {
	Addr     string
	SverName string `toml:"sver_name"`
	Port     []int  `toml:"port"`
}

Etcd search etcd options

type Rpc

type Rpc struct {
	GrpcPort []string `toml:"grpc_port"`
	// GrpcPort []int    `toml:"grpc_port"`
	DistPort []string `toml:"dist_port"`
	Port     string
}

Rpc search rpc options

type SearchArgs

type SearchArgs struct {
	Id, Query, Time          string
	OutputOffset, MaxOutputs int
	DocIds                   map[string]bool
	Logic                    types.Logic
}

SearchArgs search args

Jump to

Keyboard shortcuts

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