couchbaselabs/bleve — pull request #86 by deoxxa (2014-08-24 07:09:14+00:00)
Title: add boltdb storage type

Does what it says. The tests all pass, but you'll need to tell them to actually use the new backend for them to mean anything. The following patch will do just that:

```
diff --git a/config.go b/config.go
index f93375f..1d24293 100644
--- a/config.go
+++ b/config.go
@@ -82,6 +82,7 @@ import (
_ "github.com/couchbaselabs/bleve/analysis/language/tr"

// kv stores
+	_ "github.com/couchbaselabs/bleve/index/store/boltdb"
_ "github.com/couchbaselabs/bleve/index/store/inmem"
_ "github.com/couchbaselabs/bleve/index/store/leveldb"
)
@@ -135,7 +136,7 @@ func init() {
Config.DefaultHighlighter = &htmlHighlighterName

// default kv store
-	Config.DefaultKVStore = "leveldb"
+	Config.DefaultKVStore = "boltdb"

bootDuration := time.Since(bootStart)
bleveExpVar.Add("bootDuration", int64(bootDuration))
diff --git a/index_meta_test.go b/index_meta_test.go
index b130b6d..a4cf99d 100644
--- a/index_meta_test.go
+++ b/index_meta_test.go
@@ -24,7 +24,7 @@ func TestIndexMeta(t *testing.T) {
}

// create meta
-	im := &indexMeta{Storage: "leveldb"}
+	im := &indexMeta{Storage: "boltdb"}
err = im.Save(testIndexPath)
if err != nil {
t.Error(err)
@@ -36,8 +36,8 @@ func TestIndexMeta(t *testing.T) {
if err != nil {
t.Error(err)
}
-	if im.Storage != "leveldb" {
-	t.Errorf("expected storage 'leveldb', got '%s'", im.Storage)
+	if im.Storage != "boltdb" {
+	t.Errorf("expected storage 'boltdb', got '%s'", im.Storage)
}

// save a meta that already exists
```