Skip to navigation

Full-Text Search

BM25-based full-text search with configurable tokenization, stemming, and multi-language support.

Overview

turbopuffer implements BM25 full-text search over string attributes. Enable it in your schema, then rank documents using the BM25 operator.

Set fullTextSearch: true (or pass a configuration object) when defining your schema:

await client.namespaces.write("my-namespace", {
schema: {
content: {
type: "string",
fullTextSearch: {
language: "english",
stemming: true,
removeStopwords: true,
},
},
},
upsertRows: [{ id: "1", attributes: { content: "turbopuffer vector search" } }],
});

Query with BM25

const results = await client.namespaces.query("my-namespace", {
rankBy: ["content", "BM25", "vector search engine"],
topK: 10,
});

Configuration options

OptionDefaultDescription
languageenglishTokenization language for stemming and stopword removal
stemmingfalseReduce words to their root form
removeStopwordstrueFilter common words (the, a, is, …)
asciiFoldingfalseNormalize accented characters (à → a)
caseSensitivefalseCase-sensitive matching
k11.2BM25 term saturation parameter
b0.75BM25 document length normalization

Supported languages

arabic, danish, dutch, english, finnish, french, german, greek, hungarian, italian, norwegian, portuguese, romanian, russian, spanish, swedish, tamil, turkish