Skip to main content
Version: V1.3.0

Full-text index

A full-text index is an index structure for efficient text retrieval. It lets you find documents quickly using keywords, phrases, or natural-language-style queries. Unlike classic database indexes (such as B-trees), full-text indexes target text: fuzzy matching, synonym-style behavior, tokenization, weighting, and other advanced search features.

Use cases​

pyseekdb fits typical scenarios such as:

  • Enterprise knowledge bases: Large organizations store project docs, meeting notes, research reports, and similar material. Full-text search helps staff find information faster and more accurately.

  • Online libraries and e-book platforms: Users can search by title, author, or passages inside books; the index returns matching content quickly.

  • News portals and social sites: High daily volume of articles, posts, and comments. Full-text search filters the feed by topic, event, or people users care about.

  • Legal document retrieval: Contracts, judgments, statutes, and other dense text. Strong full-text search speeds review and helps locate precedents, cited clauses, and related law.

  • Healthcare information systems: Clinicians look up patient history, recent papers, and reference material. Full-text indexes make that access easier and support better clinical decisions.

Field reference​

In pyseekdb, configure full-text indexes with FulltextIndexConfig.

FulltextIndexConfig fields:

FieldTypeDefaultDescription
analyzerstr / FulltextAnalyzer"ik"Tokenizer: space, ngram, ngram2, beng, ik, and others
propertiesdictNoneKeys are strings; values are str, int, float, or bool

Different analyzer values support different properties. The following analyzer property types exist:

  • IKProperties
  • SpaceProperties
  • NgramProperties
  • Ngram2Properties
  • BengProperties

Supported properties by analyzer:

analyzerSupported propertiesDefaultDescription
ikik_mode"smart"smart or max_word.
spacemin_token_size3Range: [1 - 16]
spacemax_token_size84Range: [10 - 84]
ngramngram_token_size2Range: [1 - 10]
ngram2min_ngram_sizeRange: [1 - 16]
ngram2max_ngram_sizeRange: [1 - 16]
bengmin_token_size3Range: [1 - 16]
bengmax_token_size84Range: [10 - 84]

Usage​

To use a full-text index in pyseekdb, configure it through Schema when you create a collection. If you do not set any schema fields, the collection defaults to a full-text index with the IK tokenizer.

Prerequisites​

Install pyseekdb V1.2.0 or later.

pip install -U pyseekdb

Usage example​

from pyseekdb import (
Client, Schema,
FulltextIndexConfig,
)

client = Client(host="127.0.0.1", port=2881, database="test")

schema = Schema(
fulltext_index=FulltextIndexConfig(analyzer="ik", properties={"ik_mode": "smart"})
)

collection = client.create_collection("my_collection", schema=schema)