bbadger icon indicating copy to clipboard operation
bbadger copied to clipboard

example

Open ghost opened this issue 7 years ago • 10 comments

could you add a reasonable full example please ?

ghost avatar Nov 03 '18 20:11 ghost

There is no example needed for that, you must know blevesearch to get started.

alash3al avatar Nov 03 '18 20:11 alash3al

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.

ghost avatar Nov 03 '18 20:11 ghost

Blast essentially makes bleve a HA cluster.

ghost avatar Nov 03 '18 20:11 ghost

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)
}

alash3al avatar Nov 03 '18 20:11 alash3al

thanks. Ok i will give it a whirl to merge the two.

Are you planning to add more to yours ?

ghost avatar Nov 03 '18 21:11 ghost

More like what? if you have any thoughts, just tell me

alash3al avatar Nov 03 '18 21:11 alash3al

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 ?

ghost avatar Nov 03 '18 21:11 ghost

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.

alash3al avatar Nov 03 '18 21:11 alash3al

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

ghost avatar Nov 04 '18 07:11 ghost

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.

ghost avatar Nov 04 '18 07:11 ghost