Skip to content

Comments

fix: Move title and snippet columns above content_hash in documents . #22

Merged
Digvijay-x1 merged 1 commit intomainfrom
udp/title-and-snippet
Dec 10, 2025
Merged

fix: Move title and snippet columns above content_hash in documents . #22
Digvijay-x1 merged 1 commit intomainfrom
udp/title-and-snippet

Conversation

@Digvijay-x1
Copy link
Owner

@Digvijay-x1 Digvijay-x1 commented Dec 10, 2025

closes : #21 Update the database schema to include title and snippet columns. This is a prerequisite for updating the Indexer to extract this information and the Ranker to serve it.

Summary by CodeRabbit

  • New Features
    • Enhanced database schema to store document titles and snippet previews, enabling improved document presentation and browsing experience.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 10, 2025

Walkthrough

Adds two new columns (title and snippet) to the documents table in the database schema to store page titles and preview snippets.

Changes

Cohort / File(s) Change Summary
Database Schema
data/init.sql
Added title TEXT and snippet TEXT columns to the documents table after the doc_length column

Estimated Code Review Effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Two new columns hop into place,
Title and snippet, a schema embrace,
Documents dressed in their finest attire,
With previews that sparkle and inspire! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding title and snippet columns to the documents table in the schema.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch udp/title-and-snippet

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
data/init.sql (1)

2-14: Schema evolution strategy should be established before production deployment.

The current approach using init.sql only handles greenfield setup (Docker PostgreSQL executes scripts in /docker-entrypoint-initdb.d/ only on first container startup). The CREATE TABLE IF NOT EXISTS pattern is appropriate for initial setup, but once the database is initialized, future schema changes won't be applied. Since the ARCHITECTURE.md roadmap shows progressive development phases (crawler integration, indexer connection), establish a migration strategy (separate migration files with ALTER TABLE or a versioning system) before moving toward Phase 2-3 to avoid schema drift between environments.

🧹 Nitpick comments (1)
data/init.sql (1)

11-12: Consider adding constraints to new columns.

The title and snippet columns currently allow NULL values with no defaults. Depending on your Indexer and Ranker behavior, you may want to:

  • Add NOT NULL if these should always be populated for new documents
  • Add a DEFAULT '' (empty string) for backward compatibility with existing rows
  • Or explicitly document that NULL is acceptable and handle it in application logic

This ensures consistency and prevents unexpected null-pointer issues downstream.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6d14f88 and 4be9bca.

📒 Files selected for processing (1)
  • data/init.sql (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: docker-build

@Digvijay-x1 Digvijay-x1 merged commit 75aeef8 into main Dec 10, 2025
7 checks passed
@Digvijay-x1 Digvijay-x1 deleted the udp/title-and-snippet branch December 10, 2025 16:34
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.

Missing Metadata for Rich Search Results

1 participant