import "github.com/blevesearch/bleve/v2"
func main() {
// open a new index
mapping := bleve.NewIndexMapping()
index, err := bleve.New("example.bleve", mapping)
// 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)
}
Import one package, build an index with three lines of code, query for documents with another three lines.
Bleve includes general-purpose analyzers as well as pre-built text analyzers for the following languages:
Support for aggregating facet information across search results. Supported facet types:
By indexing your data with bleve you gain the ability to compose the following query types:
Industry standard tf-idf scoring with query time boosting.
Includes support for highlighting matching text within document fragments.
Here's a playground where you can demo various text analysis components.
The bleve source is available on github and distributed under the Apache License, Version 2.0.