A modern text indexing library for go

iRedMail d352a815fa Update bbolt v1.3.7. (#1824) 2 weeks ago
.github cde1967587 Update go.mod version to 1.19, workflows to [1.18, 1.19, 1.20] (#1798) 3 months ago
analysis 8d5bd9b70e Add english plural stemmer as a new token filter (#1808) 2 months ago
cmd c89ad3ffc6 bleve index operations not applicable to cobra's completion commands (#1817) 1 month ago
config 78caf678e5 go fmt ./... fixes config/config.go (#1637) 1 year ago
data d89c6c0a68 Fix the IOStats computation (#1710) 10 months ago
docs 2332455bd2 nicer formatting of license header 6 years ago
document 1643dc3a8b Returning bytesRead as part of searchResult (#1752) 6 months ago
geo ec0d3aa138 Support `store` option for the geoshape field (#1714) 10 months ago
http 837c10f742 Replacing deprecated io/ioutil functions (#1781) 4 months ago
index 3bd70beb9d perf: Use pointer-based `sync.Pool` for optimized memory management (#1797) 2 months ago
mapping 0c48a9e6c2 Inheriting the correct analyzer when default mapping is in use (#1807) 2 months ago
numeric 7740f389de MB-33455: improve ComputeGeoRange() performance 4 years ago
registry bc7a7b554a allow custom analyzers (#1729) 7 months ago
search b43d984062 Fix typo in error message while parsing IP (#1784) 4 months ago
size 06f7c58a35 Include missing initialization for size entry of integers 5 years ago
test 837c10f742 Replacing deprecated io/ioutil functions (#1781) 4 months ago
.gitignore 17d02632cc optimize TermFacets (#1404) 1 year ago
.travis.yml 314af13184 Update .travis.yml to include testing on go version 1.14.x 3 years ago
CONTRIBUTING.md 2807a2c8bd adding CONTRIBUTING.md to repo 7 years ago
LICENSE 6e7aa57b52 adding license file 9 years ago
README.md 02285120a5 Update readme (#1782) 4 months ago
SECURITY.md 47021eed92 Adding README to the bleve/http package (#1692) 1 year ago
builder.go 89234a626e bleve v2.0.0 proposal PR (#1494) 2 years ago
builder_test.go 837c10f742 Replacing deprecated io/ioutil functions (#1781) 4 months ago
config.go 89234a626e bleve v2.0.0 proposal PR (#1494) 2 years ago
config_app.go c4a3c9e6e1 go fmt ./... updates a few files 1 year ago
config_disk.go c4a3c9e6e1 go fmt ./... updates a few files 1 year ago
doc.go 837c10f742 Replacing deprecated io/ioutil functions (#1781) 4 months ago
error.go 89234a626e bleve v2.0.0 proposal PR (#1494) 2 years ago
examples_test.go 17d02632cc optimize TermFacets (#1404) 1 year ago
go.mod d352a815fa Update bbolt v1.3.7. (#1824) 2 weeks ago
go.sum d352a815fa Update bbolt v1.3.7. (#1824) 2 weeks ago
index.go 837c10f742 Replacing deprecated io/ioutil functions (#1781) 4 months ago
index_alias.go 2332455bd2 nicer formatting of license header 6 years ago
index_alias_impl.go 1643dc3a8b Returning bytesRead as part of searchResult (#1752) 6 months ago
index_alias_impl_test.go 89234a626e bleve v2.0.0 proposal PR (#1494) 2 years ago
index_impl.go 1643dc3a8b Returning bytesRead as part of searchResult (#1752) 6 months ago
index_meta.go 837c10f742 Replacing deprecated io/ioutil functions (#1781) 4 months ago
index_meta_test.go 2332455bd2 nicer formatting of license header 6 years ago
index_stats.go 2332455bd2 nicer formatting of license header 6 years ago
index_test.go 837c10f742 Replacing deprecated io/ioutil functions (#1781) 4 months ago
mapping.go 135ba33769 Add NewGeoShapeFieldMapping() method to mapping.go (#1741) 7 months ago
query.go 6ab7a1107d IPRangeQuery to search for IPs which are members of a subnet. (#1546) 1 year ago
query_bench_test.go 7e6d848fb8 Adding benchmark tests over some popular queries (#1755) 6 months ago
search.go a8beab1f5f Display 0 bytesRead in search responses (#1788) 3 months ago
search_test.go 0c48a9e6c2 Inheriting the correct analyzer when default mapping is in use (#1807) 2 months ago

README.md

bleve bleve

Tests Coverage Status GoDoc codebeat Go Report Card Sourcegraph License

modern text indexing in go - blevesearch.com

Features

  • Index any go data structure (including JSON)
  • Intelligent defaults backed up by powerful configuration
  • Supported field types:
    • Text, Numeric, Datetime, Boolean
  • Supported query types:
    • Term, Phrase, Match, Match Phrase, Prefix, Fuzzy
    • Conjunction, Disjunction, Boolean (must/should/must_not)
    • Term Range, Numeric Range, Date Range
    • Geo Spatial
    • Simple query string syntax for human entry
  • tf-idf Scoring
  • Boosting
  • Search result match highlighting
  • Aggregations/faceting support:
    • Terms Facet
    • Numeric Range Facet
    • Date Range Facet

Indexing

message := struct{
	Id   string
	From string
	Body string
}{
	Id:   "example",
	From: "marty.schoch@gmail.com",
	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)

Querying

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

Command Line Interface

To install the CLI for the latest release of bleve, run:

$ go install github.com/blevesearch/bleve/v2/cmd/bleve@latest
$ bleve --help
Bleve is a command-line tool to interact with a bleve index.

Usage:
  bleve [command]

Available Commands:
  bulk        bulk loads from newline delimited JSON files
  check       checks the contents of the index
  count       counts the number documents in the index
  create      creates a new index
  dictionary  prints the term dictionary for the specified field in the index
  dump        dumps the contents of the index
  fields      lists the fields in this index
  help        Help about any command
  index       adds the files to the index
  mapping     prints the mapping used for this index
  query       queries the index
  registry    registry lists the bleve components compiled into this executable
  scorch      command-line tool to interact with a scorch index

Flags:
  -h, --help   help for bleve

Use "bleve [command] --help" for more information about a command.

Text Analysis Wizard

bleveanalysis.couchbase.com

Discussion/Issues

Discuss usage/development of bleve and/or report issues here:

License

Apache License Version 2.0