Documentation ¶
Index ¶
- type IndexMappingFn
- type Indexer
- type KVStoreMarshal
- type KVStoreUnmarshal
- type ShardingDirStrategyFn
- type ShardingIndex
- func (i *ShardingIndex) Batch(ms map[string]interface{}) error
- func (i *ShardingIndex) Clear() error
- func (i *ShardingIndex) Close() error
- func (i *ShardingIndex) Count() (uint64, error)
- func (i *ShardingIndex) EnableKVStore()
- func (i *ShardingIndex) GetInternal(id string, v interface{}) error
- func (i *ShardingIndex) Index(id string, data interface{}) error
- func (i *ShardingIndex) Open() error
- func (i *ShardingIndex) Search(req *bleve.SearchRequest) (*bleve.SearchResult, error)
- func (i *ShardingIndex) SetIndexMapping(imfn IndexMappingFn)
- func (i *ShardingIndex) SetShardingDirStrategy(sdsfn ShardingDirStrategyFn)
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 KVStoreUnmarshal ¶
type ShardingDirStrategyFn ¶
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 ¶
func (i *ShardingIndex) Search(req *bleve.SearchRequest) (*bleve.SearchResult, error)
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
Click to show internal directories.
Click to hide internal directories.