modern text indexing in go – blevesearch.com

Try out bleve live by searching the bleve website.

Features

Discussion

Discuss usage and development of bleve in the google group.

Indexing

message := struct{ Id string From string Body string }{ Id: "example", From: "[email protected]", Body: "bleve indexing is easy", } mapping := bleve.NewIndexMapping() index, err := bleve.New("example.bleve", mapping) if err ! = nil { panic(err) } index.Index(message.Id, message)Copy the code

Querying

index, _ := bleve.Open("example.bleve")
query := bleve.NewQueryStringQuery("bleve")
searchRequest := bleve.NewSearchRequest(query)
searchResult, _ := index.Search(searchRequest)Copy the code

License

The Apache License Version 2.0