Fix full-text-search recipe: correct /v1/search response shape - #571
Merged
Conversation
The documented search response showed a 'data' object holding the requested 'path' column and 'matches' as a plain string. The runtime returns 'matches' as an array per column, and 'data' carries only additional_columns that are not part of the primary key — so requesting 'path' (the row_id) produces no 'data' object at all. Documented what 'data' does contain. Also refreshed the SQL example output, which showed 3 rows for a LIMIT 5 query and cited vectors/README.md, a path that no longer exists. Verified by running the recipe end to end on Spice v2.1.4.
|
@copilot review |
lukekim
approved these changes
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ran the
full-text-searchrecipe end to end on current stable. The configuration and thetext_search()SQL path are correct, but the documented/v1/searchresponse does not matchwhat the endpoint returns.
What the recipe said — a
dataobject holding the requestedpath, andmatchesas a string:{ "matches": { "content": "... Follow these steps to get started with ..." }, "data": { "path": "postgres/rds/README.md" }, "primary_key": { "path": "postgres/rds/README.md" }, "_score": 1.41, "dataset": "cookbook_files" }What the endpoint returns — no
datakey at all for this request, andmatchesmaps eachindexed column to an array of matching text:
{ "matches": { "content": ["# AWS RDS for PostgreSQL\n\nWorks with `v1.0+`\n\nFollow these steps to ge..."] }, "primary_key": { "path": "postgres/rds/README.md" }, "_score": 1.12, "dataset": "cookbook_files" }The reason is worth documenting rather than just patching the JSON:
datacarries only thoseadditional_columnsthat are not part of the primary key. Becausepathis this dataset'sfull_text_search.row_id, requesting it returns the value underprimary_keyand emits nodataobject. Requesting non-key columns does produce one — confirmed with"additional_columns": ["size", "name"], which returns"data": { "name": "README.md", "size": 2437 }. Added a short field-by-field list covering this.Also corrected in the same pass:
LIMIT 5but showed only 3 result rows, and its top hit wasvectors/README.md— a path that does not exist in the repo (the recipe isvectors/s3).Replaced with the real five-row result and relabelled it "paths and scores vary", since the
indexed source is the live cookbook repo.
show tables;and the search result table now include the data-type row thatspice sqlprints.Verified against
spiceai/spiceai at
v2.1.4(current stable)Evidence
Ran with
GITHUB_TOKENset, per the recipe's prerequisites:The
text_search()SQL examples all ran successfully and_scoreis correct throughout.