bleve README

The project's README from github.com/blevesearch/bleve. As one markdown file: README.md.

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: "[email protected]",
    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

bleve (blevesearch/bleve)

Searching Database…

11.2K ·GitHub
这是什么?Bleve 是一个用 Go 编写的现代全文、数值、地理空间和向量索引与搜索库,灵感来自 Apache Lucene。
这是一个库还是独立的搜索服务器?它是一个可以直接嵌入你应用程序的 Go 库,同时也附带一个用于基本索引操作的命令行工具。
怎样把它加入项目?在你的 Go 代码中导入 bleve 包,即可创建索引和执行查询;如需使用命令行工具,也可以安装最新版本的独立二进制文件。
使用它除了 Go 之外还需要别的东西吗?不需要外部数据库或服务器;bleve 使用自带的存储引擎 scorch 直接将数据索引保存在磁盘上,因此你只需要一个 Go 环境即可。
它支持把关键词搜索和向量搜索结合起来吗?支持。它可以把精确的(关键词)匹配与语义(向量)匹配结合起来进行混合搜索,并使用 RRF 或 RSF 方式融合结果。
bleve 支持哪些字段和查询类型?它支持文本、数字、日期时间、布尔值、地理点、地理形状、IP 和向量字段;查询类型包括 term、phrase、match、fuzzy、range、wildcard、布尔组合查询以及查询字符串语法。
bleve 能进行地理空间搜索和最近邻搜索吗?可以。它支持地理空间搜索,并能通过向量搜索进行近似 k 最近邻查询,此外还支持同义词搜索和层级嵌套搜索。
文本分析支持哪些语言?bleve 内置了约 30 种语言的分析器,包括英语、中日韩文、阿拉伯语、俄语、德语、法语、印地语等,同时也支持可自定义的通用分析器。
bleve 支持排序和高亮显示吗?支持。它提供 tf-idf 和 BM25 评分模型、查询时加权、结果分页,以及带文档片段的匹配高亮显示。
Size
18.1 MB
Stars
11.2K
Age
12y
Commits · 90 Days