bbadger
bbadger copied to clipboard
example
could you add a reasonable full example please ?
There is no example needed for that, you must know blevesearch to get started.
I have used bleve for a project and know it reasonably well. The reason i asked is because i want to fork this https://github.com/mosuka/blast, and add yours into it.
Blast essentially makes bleve a HA cluster.
There is no special operation needed, here is an example that is the same as the official bleve documentation
package main
import (
"fmt"
"github.com/alash3al/bbadger"
"github.com/blevesearch/bleve"
)
func main() {
// create/open bleveIndex
index, err := bbadger.BleveIndex("/tmp/badger/indexName", bleve.NewIndexMapping())
// index some data
err = index.Index(identifier, your_data)
// search for some text
query := bleve.NewMatchQuery("text")
search := bleve.NewSearchRequest(query)
searchResults, err := index.Search(search)
}
thanks. Ok i will give it a whirl to merge the two.
Are you planning to add more to yours ?
More like what? if you have any thoughts, just tell me
gthere was a major issue with using badger with bleve until recently regarding snapshots. I can drag up the github issue if you want, but have to checked its working ok ? For background the main dev at dgraph made a change to the snapshotting that allowed bleve to work with badger.
also have you run this in prod and data race tested it all all ?
I tried to run the test cases of the original package including the ReaderIsolation and it succeeded, it will be perfect if any dgraph/bleve developer can help and confirm this too.
thanks. that does address the main concern i had. I will see how much i can do but i don't have much bandwidth to spare right now.
If you really want bleve devs to dog food this then post on bleve issues directly. I think it would be welcomed. The original badger issue inside the bleve repo: https://github.com/blevesearch/bleve/issues/591
I added to the bleve / badger issue over at the blast repo at: https://github.com/mosuka/blast/issues/17
Matching blast with bbadger is the best outcome for scaling as it utilises alias and computation spread and HA all in one hit.