store

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2019 License: Apache-2.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IndexMappingFn

type IndexMappingFn func() mapping.IndexMapping

type Indexer

type Indexer interface {
	Open() error
	Index(id string, data interface{}) error
	Batch(ms map[string]interface{}) error
	Count() (uint64, error)
	Search(req *bleve.SearchRequest) (*bleve.SearchResult, error)
	SetShardingDirStrategy(ShardingDirStrategyFn)
	SetIndexMapping(imfn IndexMappingFn)
	GetInternal(id string, v interface{}) error
	EnableKVStore()
	Close() error
	Clear() error
}

type KVStoreMarshal

type KVStoreMarshal func(data interface{}) ([]byte, error)

type KVStoreUnmarshal

type KVStoreUnmarshal func(data []byte, v interface{}) error

type ShardingDirStrategyFn

type ShardingDirStrategyFn func(string) string

type ShardingIndex

type ShardingIndex struct {
	// contains filtered or unexported fields
}

ShardingIndex represents the indexing engine.

func NewShardingIndex

func NewShardingIndex(path string) *ShardingIndex

New returns a new indexer.

func (*ShardingIndex) Batch

func (i *ShardingIndex) Batch(ms map[string]interface{}) error

func (*ShardingIndex) Clear

func (i *ShardingIndex) Clear() error

func (*ShardingIndex) Close

func (i *ShardingIndex) Close() error

func (*ShardingIndex) Count

func (i *ShardingIndex) Count() (uint64, error)

Count returns the total number of documents indexed.

func (*ShardingIndex) EnableKVStore

func (i *ShardingIndex) EnableKVStore()

EnableKVStore enable kv store option

func (*ShardingIndex) GetInternal

func (i *ShardingIndex) GetInternal(id string, v interface{}) error

GetInternal get kv store, need enable kvStore.

func (*ShardingIndex) Index

func (i *ShardingIndex) Index(id string, data interface{}) error

Index indexes the given docs, dividing the docs evenly across the shards. Blocks until all documents have been indexed.

func (*ShardingIndex) Open

func (i *ShardingIndex) Open() error

Open opens the indexer, preparing it for indexing.

func (*ShardingIndex) Search

Search query form index

func (*ShardingIndex) SetIndexMapping

func (i *ShardingIndex) SetIndexMapping(imfn IndexMappingFn)

SetIndexMapping set indexMapping

func (*ShardingIndex) SetShardingDirStrategy

func (i *ShardingIndex) SetShardingDirStrategy(sdsfn ShardingDirStrategyFn)

SetShardingDirStrategy set ShardingDirStrategyFn

Jump to

Keyboard shortcuts

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