Skip to content

docs(fts): document full-text search shipped in v5.3.0 - #326

Open
CaffeinatedCoder wants to merge 1 commit into
EntglDb:mainfrom
CaffeinatedCoder:docs/fts-readme
Open

CaffeinatedCoder wants to merge 1 commit into
EntglDb:mainfrom
CaffeinatedCoder:docs/fts-readme

Conversation

@CaffeinatedCoder

Copy link
Copy Markdown
Collaborator

Refs #70 (closed; shipped in 5.3.0 by #177).

Problem

Full-text search with BM25 ranking shipped in 5.3.0, but only CHANGELOG.md mentions it. The README has no section for it, so HasFullTextIndex, FullTextMatch and FullTextSearchAsync are undocumented.

Change

README.md only:

  • One line under Key Features → Advanced Indexing: Full-Text Search (BM25).
  • A Full-Text Search (v5.3.0) section after the geospatial one, in the same shape:
    • HasFullTextIndex(x => x.Body) and its default name idx_fts_{Property};
    • LINQ filtering with FullTextMatch;
    • ranked search with FullTextSearchAsync(indexName, query, k, matchAllTerms) returning FullTextSearchResult<T> (Document, Score);
    • CreateFullTextIndexAsync(x => ...) at runtime;
    • the DynamicCollection form: CreateFullTextIndexAsync("field") (default name idx_fts_{field}) and FullTextSearchAsync.
  • A short note on ranking and limitations, each point taken from the code or its doc comments:
    • BM25 with k1 = 1.2, b = 0.75 (FullTextIndex), and scores compare only within one search (FullTextSearchResult);
    • when FullTextMatch uses the index (IndexOptimizer, and the planner tests in FullTextSearchTests);
    • whole-term matching with no segmentation of CJK scripts (FullTextAnalyzer);
    • BLQL has no full-text operator (BlqlFilterParser);
    • write cost and the compatibility rule for BLite < 5.3 (doc comments on HasFullTextIndex and CreateFullTextIndexAsync).

No other files touched. There is no roadmap row or per-version table for full-text to update, and docs/ has no per-feature guides, so there is no new guide.

Tests

The README samples were compiled and run in a scratch console app (net10.0, referencing BLite.Core, BLite.Bson and the source generator as an analyzer, as tests/BLite.Shared does). The app contained both code blocks verbatim and an Article model with a generated DocumentDbContext:

  • typed: FullTextMatch("quick fox") returned the two documents containing both terms. FullTextSearchAsync(..., k: 10) returned them ranked by score. With matchAllTerms: false it also returned a document containing only fox, with a lower score.
  • "Café, au lait!".FullTextMatch("cafe LAIT") is true, and the same filter in LINQ returned that document.
  • CreateFullTextIndexAsync(x => x.Title) created idx_fts_Title next to idx_fts_Body.
  • dynamic: CreateFullTextIndexAsync("text") created idx_fts_text, and FullTextSearchAsync with TryGetString("title", ...) printed the matching note.

No compiler warnings came from the sample code.

🤖 Generated with Claude Code

Full-text search with BM25 ranking (EntglDb#70, EntglDb#177) shipped in 5.3.0 but the
README did not mention it. Adds a section next to the spatial one covering
HasFullTextIndex, LINQ FullTextMatch, the ranked FullTextSearchAsync on
typed and dynamic collections, CreateFullTextIndexAsync, and a note on
ranking and limitations, plus one line under Advanced Indexing.

Refs EntglDb#70

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Production — ea79c6f8 Deployed Oct 19, 2026 by CaffeinatedCoder via build_and_publish #794
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant