import "github.com/blevesearch/bleve"

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

Bleve

full-text search and indexing for Go

  • Simple top-level API
  • Index any object in your data model
  • Override default mapping to customize behavior
  • Rich set of interfaces for extending the capabilities

Upcoming Events (See All)


Simple

Import one package, build an index with three lines of code, query for documents with another three lines.

Text Analysis

Bleve includes general-purpose analyzers as well as pre-built text analyzers for the following languages:

  • Danish, Dutch, English, Finnish, French, German, Hungarian, Italian, Norwegian, Persian, Portuguese, Romanian, Russian, Sorani, Spanish, Swedish, Thai, Turkish

Faceting

Support for aggregating facet information across search results. Supported facet types:

  • Terms Facet
  • Numeric Range Facet
  • Date Range Facet

Powerful

By indexing your data with bleve you gain the ability to compose the following query types:

  • Term, Phrase, Match, Match Phrase, Prefix
  • Conjunction, Disjunction, Boolean
  • Numeric and Date Ranges
  • Query String (see Syntax)

Scoring

Industry standard tf-idf scoring with query time boosting.

Result Highlighting

Includes support for highlighting matching text within document fragments.

Open Source

The bleve source is available on github and distributed under the Apache License, Version 2.0.