Skip to content

6.3.0

Choose a tag to compare

@gfreezy gfreezy released this 21 Sep 10:12

Full-text relevance ordering

search and matching now accept orderByRank: true on both entities and Query:

let articles = try Article.search("database indexing", orderByRank: true)
    .order(by: \.createdAt, ascending: false)
    .limit(20)
    .all(connection)

The default remains false. When enabled, FTS5 rank sorts ascending before ordinary ordering; existing and subsequent .order(by:) calls break relevance ties. If multiple searches enable rank ordering, the last rank takes precedence.

Rank queries use the library's identity mapping and bound parameters, supporting UUID and composite keys, sparse business rowids, named indexes, ordinary filters, projections, and pagination. Configured FTS rank functions are respected. Count, aggregate, and batch-write behavior remains unchanged.

Rank is evaluated for matching candidates before the outer sort and pagination; this API does not use FTS5's direct ORDER BY rank LIMIT optimization.

Validation

Before the release request, 46 related tests passed, including six new rank tests. No local tests, builds, linting, or other validation were run for this release. The release workflow verifies CloudKit synchronization, builds the macOS arm64 CLI, and downloads and verifies its archive and SHA256SUMS.

Full Changelog: 6.2.1...6.3.0