Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsApr 30, 2026·3 min de lecture

Bleve — Full-Text Search and Indexing Library for Go

Bleve is a modern text, numeric, geo-spatial, and vector indexing library for Go that provides full-text search capabilities without external dependencies.

Introduction

Bleve is a pure Go library for full-text indexing and search, designed to bring Lucene-like capabilities to the Go ecosystem. It supports text analysis, scoring, faceting, highlighting, and geo queries, all embedded directly in a Go application without needing an external search server.

What Bleve Does

  • Indexes and searches text, numeric, boolean, geo-point, and vector fields
  • Supports match, phrase, fuzzy, prefix, regexp, and geo-distance queries
  • Provides faceted search for category-based navigation and filtering
  • Includes built-in analyzers for multiple languages with stemming and stop words
  • Offers result highlighting and snippet extraction from matched documents

Architecture Overview

Bleve stores indexes using pluggable key-value backends (Scorch is the default). The Scorch storage engine uses an LSM-tree inspired approach with in-memory segments that are periodically merged to disk. Text analysis pipelines tokenize, filter, and stem input using configurable analyzer chains. At query time, Bleve evaluates queries against an inverted index, scores results using TF-IDF or BM25, and supports concurrent searches across segments. The library uses Go interfaces extensively, allowing custom tokenizers, storage backends, and scoring functions.

Self-Hosting & Configuration

  • Add bleve as a Go module dependency with go get github.com/blevesearch/bleve/v2
  • Define index mappings programmatically or via JSON configuration
  • Choose storage backend: Scorch (default), BoltDB, or custom implementations
  • Configure analyzers per field for language-specific text processing
  • Index data is stored on local disk as a directory of segment files

Key Features

  • Pure Go implementation with no CGo dependencies for easy cross-compilation
  • Scorch storage engine provides efficient segment merging and compaction
  • Vector search support for similarity queries on embedding fields
  • Used as the search engine inside Couchbase FTS (Full-Text Search)
  • Composable query types support complex boolean and nested search expressions

Comparison with Similar Tools

  • Tantivy — Rust equivalent with similar embedded approach, different language ecosystem
  • Apache Lucene — the reference implementation in Java, more features but requires JVM
  • MeiliSearch — search server with REST API, not an embeddable Go library
  • ZincSearch — Go search server built on Bleve, adds REST API and web UI
  • Elasticsearch — distributed search platform, orders of magnitude more complex

FAQ

Q: Is Bleve a search server? A: No. Bleve is a library you embed in Go applications. For a server built on Bleve, see ZincSearch or Couchbase FTS.

Q: What storage backends does Bleve support? A: The default is Scorch, an optimized segment-based engine. BoltDB is available as an alternative, and custom backends can be implemented via the KVStore interface.

Q: Can Bleve handle large datasets? A: Bleve works well for single-node datasets in the millions of documents. For distributed search across billions of documents, a server layer like Couchbase FTS is needed.

Q: Does Bleve support real-time indexing? A: Yes. Documents are searchable immediately after indexing within the same process, though batch indexing improves throughput.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires