Closed thomasmodeneis closed 8 years ago
Sure,
So, let's assume you already have a working bleve program, but it uses the default KV store which is boltdb. To use leveldb (the C version) you would do the following:
Add import for "github.com/blevex/leveldb"
Change line saying:
index, err := bleve.New(path, mapping)
to
index, err := bleve.NewUsing(path, mapping, bleve.Config.DefaultIndexType, leveldb.Name, nil)
If your code later opens existing indexes, it can use the standard Open() call and it should detect "leveldb" automatically, but, you still need to always include the "leveldb" package above to ensure that functionality is linked into the application.
Let me know if any of this isn't clear.
Hi @mschoch
Thanks for your great help, I will be working on this during the weekend and will get back to you here in case I find any complications during the implementation :)
Thank you again, Thomas.
HI,
I know this maybe obvious for you, but I'm struggling a bit to manage to make sense of this project, by that I mean how to I use it ?
I would like to test the leveldb extension, but I'm not sure how to start with.
would you mind giving a quick heads up here with steps to use it ?
Thanks