MCPcopy Index your code
hub / github.com/blevesearch/bleve

github.com/blevesearch/bleve @v2.6.0 sqlite

repository ↗ · DeepWiki ↗ · release v2.6.0 ↗
4,924 symbols 20,854 edges 668 files 777 documented · 16% 8 cross-repo links
README

bleve bleve

Tests Coverage Status Go Reference Join the chat Go Report Card Sourcegraph License

A modern indexing + search library in GO

Features

Indexing

message := struct {
    Id   string
    From string
    Body string
}{
    Id:   "example",
    From: "xyz@couchbase.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

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

Arabic (ar), Bulgarian (bg), Catalan (ca), Chinese-Japanese-Korean (cjk), Kurdish (ckb), Danish (da), German (de), Greek (el), English (en), Spanish - Castilian (es), Basque (eu), Persian (fa), Finnish (fi), French (fr), Gaelic (ga), Spanish - Galician (gl), Hindi (hi), Croatian (hr), Hungarian (hu), Armenian (hy), Indonesian (id, in), Italian (it), Dutch (nl), Norwegian (no), Polish (pl), Portuguese (pt), Romanian (ro), Russian (ru), Swedish (sv), Turkish (tr)

Text Analysis Wizard

bleveanalysis.couchbase.com

Discussion/Issues

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

License

Apache License Version 2.0

Extension points exported contracts — how you extend this code

Query (Interface)
A Query represents a description of the type and parameters for a query into the index. [30 implementers]
search/query/query.go
TokenFilter (Interface)
A TokenFilter adds, transforms or removes tokens from a token stream. [58 implementers]
analysis/type.go
Builder (Interface)
Builder is a limited interface, used to build indexes in an offline mode. Items cannot be updated or deleted, and the ca [5 …
index.go
Classifier (Interface)
A Classifier is an interface describing any object which knows how to identify its own type. Alternatively, if a struct [5 …
mapping/mapping.go
Searcher (Interface)
(no doc) [15 implementers]
search/search.go
FragmentScorer (Interface)
(no doc) [6 implementers]
search/highlight/highlighter.go
State (Interface)
States codify the classes that the parser recognizes. [4 implementers]
analysis/token/camelcase/states.go
Field (Interface)
(no doc) [11 implementers]
document/field.go

Core symbols most depended-on inside this repo

Fatalf
called by 678
search/searcher/search_geoshape_points_test.go
Close
called by 402
index.go
AddField
called by 285
document/document.go
NewDocument
called by 278
document/document.go
Search
called by 255
index.go
Next
called by 228
search/search.go
AddFieldMappingsAt
called by 199
mapping/document.go
NewSearchRequest
called by 157
search.go

Shape

Function 2,228
Method 2,105
Struct 421
TypeAlias 67
Interface 60
FuncType 43

Languages

Go100%

Modules by API surface

index/upsidedown/row.go114 symbols
search/sort.go81 symbols
index/scorch/snapshot_index.go66 symbols
index.go65 symbols
index/scorch/scorch.go64 symbols
index_test.go63 symbols
index/scorch/scorch_test.go62 symbols
geo/geo_s2plugin_impl.go60 symbols
search_test.go59 symbols
index_alias_impl.go58 symbols
index_impl.go57 symbols
search.go55 symbols

Dependencies from manifests, versioned

github.com/bits-and-blooms/bitsetv1.24.2 · 1×
github.com/blevesearch/bleve_index_apiv1.3.11 · 1×
github.com/blevesearch/geov0.2.5 · 1×
github.com/blevesearch/go-faissv1.1.0 · 1×
github.com/blevesearch/go-metricsv0.0.0-2020122707383 · 1×
github.com/blevesearch/go-porterstemmerv1.0.3 · 1×
github.com/blevesearch/goleveldbv1.0.1 · 1×
github.com/blevesearch/gtreapv0.1.1 · 1×
github.com/blevesearch/mmap-gov1.2.0 · 1×
github.com/blevesearch/scorch_segment_api/v2v2.4.7 · 1×
github.com/blevesearch/segmentv0.9.1 · 1×

For agents

$ claude mcp add bleve \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact