rupture: Index | Files

package rupture

import ""


Package Files

flushing_batch.go metadata.go sharded_index.go

func WriteIndexMetadata Uses

func WriteIndexMetadata(path string, meta *IndexMetadata) error

WriteIndexMetadata writes metadata for the index at the specified path.

type FlushingBatch Uses

type FlushingBatch interface {
    // Index adds the specified index operation batch, possibly triggering a
    // flush.
    Index(id string, data interface{}) error
    // Remove adds the specified delete operation to the batch, possibly
    // triggering a flush.
    Delete(id string) error
    // Flush flushes the batch's contents.
    Flush() error

FlushingBatch is a batch of operations that automatically flushes to the underlying index once it reaches a certain size.

func NewFlushingBatch Uses

func NewFlushingBatch(index bleve.Index, maxBatchSize int) FlushingBatch

NewFlushingBatch creates a new flushing batch for the specified index. Once the number of operations in the batch reaches the specified limit, the batch automatically flushes its operations to the index.

func NewShardedFlushingBatch Uses

func NewShardedFlushingBatch(index ShardedIndex, maxBatchSize int) FlushingBatch

NewShardedFlushingBatch creates a flushing batch with the specified batch size for the specified sharded index.

type IndexMetadata Uses

type IndexMetadata struct {
    // The version of the data in the index. This can be useful for tracking
    // schema changes or data migrations.
    Version int `json:"version"`

IndexMetadata contains metadata about a bleve index.

func ReadIndexMetadata Uses

func ReadIndexMetadata(path string) (*IndexMetadata, error)

ReadIndexMetadata returns the metadata for the index at the specified path. If no such index metadata exists, an empty metadata and a nil error are returned.

type ShardedIndex Uses

type ShardedIndex interface {
    // contains filtered or unexported methods

ShardedIndex an index that is built onto of multiple underlying bleve indices (i.e. shards). Similar to bleve's index aliases, some methods may not be supported.

func NewShardedIndex Uses

func NewShardedIndex(path string, mapping mapping.IndexMapping, numShards int) (ShardedIndex, error)

NewShardedIndex creates a sharded index at the specified path, with the specified mapping and number of shards.

func OpenShardedIndex Uses

func OpenShardedIndex(path string) (ShardedIndex, error)

OpenShardedIndex opens a sharded index at the specified path.

Package rupture imports 10 packages (graph) and is imported by 21 packages. Updated 2018-11-27. Refresh now. Tools for package owners.