1# ![bleve](docs/bleve.png) bleve 2 3[![Build Status](https://travis-ci.org/blevesearch/bleve.svg?branch=master)](https://travis-ci.org/blevesearch/bleve) [![Coverage Status](https://coveralls.io/repos/github/blevesearch/bleve/badge.svg?branch=master)](https://coveralls.io/github/blevesearch/bleve?branch=master) [![GoDoc](https://godoc.org/github.com/blevesearch/bleve?status.svg)](https://godoc.org/github.com/blevesearch/bleve) 4[![Join the chat at https://gitter.im/blevesearch/bleve](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/blevesearch/bleve?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 5[![codebeat](https://codebeat.co/badges/38a7cbc9-9cf5-41c0-a315-0746178230f4)](https://codebeat.co/projects/github-com-blevesearch-bleve) 6[![Go Report Card](https://goreportcard.com/badge/blevesearch/bleve)](https://goreportcard.com/report/blevesearch/bleve) 7[![Sourcegraph](https://sourcegraph.com/github.com/blevesearch/bleve/-/badge.svg)](https://sourcegraph.com/github.com/blevesearch/bleve?badge) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) 8 9modern text indexing in go - [blevesearch.com](http://www.blevesearch.com/) 10 11Try out bleve live by [searching the bleve website](http://www.blevesearch.com/search/?q=bleve). 12 13## Features 14 15* Index any go data structure (including JSON) 16* Intelligent defaults backed up by powerful configuration 17* Supported field types: 18 * Text, Numeric, Date 19* Supported query types: 20 * Term, Phrase, Match, Match Phrase, Prefix 21 * Conjunction, Disjunction, Boolean 22 * Numeric Range, Date Range 23 * Simple query [syntax](http://www.blevesearch.com/docs/Query-String-Query/) for human entry 24* tf-idf Scoring 25* Search result match highlighting 26* Supports Aggregating Facets: 27 * Terms Facet 28 * Numeric Range Facet 29 * Date Range Facet 30 31## Discussion 32 33Discuss usage and development of bleve in the [google group](https://groups.google.com/forum/#!forum/bleve). 34 35## Indexing 36 37```go 38message := struct{ 39 Id string 40 From string 41 Body string 42}{ 43 Id: "example", 44 From: "marty.schoch@gmail.com", 45 Body: "bleve indexing is easy", 46} 47 48mapping := bleve.NewIndexMapping() 49index, err := bleve.New("example.bleve", mapping) 50if err != nil { 51 panic(err) 52} 53index.Index(message.Id, message) 54``` 55 56## Querying 57 58```go 59index, _ := bleve.Open("example.bleve") 60query := bleve.NewQueryStringQuery("bleve") 61searchRequest := bleve.NewSearchRequest(query) 62searchResult, _ := index.Search(searchRequest) 63``` 64 65## License 66 67Apache License Version 2.0 68