Skip to content

feat(search): include _rowid in lance_fts and lance_hybrid_search results - #257

Open
jackylee-ch wants to merge 1 commit into
lance-format:mainfrom
jackylee-ch:feat/search-rowid
Open

jackylee-ch wants to merge 1 commit into
lance-format:mainfrom
jackylee-ch:feat/search-rowid

Conversation

@jackylee-ch

Copy link
Copy Markdown
Contributor

lance_fts and lance_hybrid_search did not surface Lance's row id, so hits could not be joined back to the dataset. This adds _rowid (UInt64) next to the existing _score/_distance pseudo-columns.

The FTS schema and stream now enable with_row_id() and project _rowid; the hybrid path emits the row ids it already computes while ranking. The C++ binds read the Arrow schema dynamically, so no change is needed there.

Testing

GEN=ninja make test_release — search_functions.test covers _rowid on both functions (fails without the projection, passes with it).

…ults

lance_fts and lance_hybrid_search did not surface Lance's row id, so hits
could not be joined back to the dataset. Add _rowid (UInt64) next to the
existing _score/_distance pseudo-columns: the FTS scans enable with_row_id
and project it, and the hybrid path emits the row ids it already computes
while ranking.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-changes Latest Gatekeeper recommendation requests changes. label Sep 29, 2026
@jackylee-ch

Copy link
Copy Markdown
Contributor Author

Thanks! The direct-path _rowid here is ready. Carrying the same contract through the namespace (query_table) path needs _rowid added to the bind schema in src/lance_search.cpp, which an open PR is currently modifying — so I'm holding that piece to avoid a conflicting change and will extend this PR to cover namespace FTS/vector once that lands. Happy to split it out if you'd rather take the direct-path part first.

@lance-gatekeeper lance-gatekeeper Bot removed the K-changes Latest Gatekeeper recommendation requests changes. label Oct 3, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Gate recommendation: approve with a non-blocking risk.

Your sequencing note prompted me to recalibrate the earlier namespace requirement. This patch can be accepted independently: the direct FTS and hybrid paths return row IDs that join back correctly, and the namespace omission predates this diff.

The non-blocking limitation is that namespace-backed FTS still cannot expose _rowid. I’m withdrawing the requirement to include that extension before merge; namespace support can follow separately.

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. labels Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant