package
0.0.1
Repository: https://github.com/peterwilliams97/blevex.git
Documentation: pkg.go.dev

# README

Preload

The preload KV store is a wrapper KV store which will first load a set of KV pairs from an external source prior to opening the KV store.

Preparing the KV pairs

Assuming you have an existing bleve index named search.bleve:

$ bleve_export search.bleve search.blexport

This creates a new file search.blexport which is a gzipped sequence of KV pairs.

Preloading a KV store with these KV pairs

Create a new in-memory index with the NewUsing() method as follows:

i, err := bleve.NewUsing(
  "",
  bleve.NewIndexMapping(),
  bleve.Config.DefaultIndexType,
  preload.Name,
  map[string]interface{}{
    "kvStoreName_actual": gtreap.Name,
    "preloadpath":        pathToBleveExport,
  })

Why?

Why would you want to use this? Unfortunately, all of the KV stores supported by bleve either use the syscall or the unsafe package. This means they aren't suitable for environments like Google App Engine. By exporting the KV pairs of an existing bleve index into a simple format, we can then package them up, and preload them into a in-memory index.

# Packages

No description provided by the author

# Functions

ExportBleve will dump all the index rows from the provided index and serialize them to the provided Writer.
Import reads KVPairs from the Reader and sets them in the KVStore all work is done in batches of the requested size.
No description provided by the author
NewReader creates a new KVPair reader that reads from the provided reader.
NewWriter returns a KVPair Writer which writes to the provided Writer.

# Constants

No description provided by the author

# Variables

No description provided by the author

# Structs

No description provided by the author
Reader reads KVPairs.
No description provided by the author
Writer writes KVPairs.