Skip to content

FTA5 search reads rank from wrong column index (importance instead of rank) #975

Closed

Description

@ajianaz

Problem

fts5.rs:119 — row.get(14) reads column index 14 which is m.importance, not f.rank.

The SQL SELECT has 20 columns before f.rank:

m.id(0), m.content(1), ..., m.importance(16), m.pinned(17), m.content_type(18), m.source(19), m.source_type(20), f.rank(21)

Wait — count: id, content, embedding, tags, metadata, created_at, updated_at, namespace, access_count, last_accessed, deprecated, valid_from, valid_until, memory_type, importance, pinned, content_type, source, source_type, f.rank = 21 columns (0-20). So rank is at index 20, not 14.

Fix

Change row.get(14) → row.get(20) at fts5.rs:119 and fts5.rs:135 (both namespace branches).

Severity: MAJOR (search ranking broken)

Activity

  1. added
    bug
    scope:core
    on Aug 10, 2026
  2. ajianaz commented on Aug 10, 2026

    @ajianaz
    CollaboratorAuthor

    Fixed in #983 (merged to develop)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugscope:core

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions