Skip to content

Search: Fall back to last_updated in sitemap reader#3103

Closed
reakaleek wants to merge 1 commit intomainfrom
olive-spade
Closed

Search: Fall back to last_updated in sitemap reader#3103
reakaleek wants to merge 1 commit intomainfrom
olive-spade

Conversation

@reakaleek
Copy link
Copy Markdown
Member

@reakaleek reakaleek commented Apr 14, 2026

What

Fall back to last_updated when content_last_updated is missing in the sitemap reader.

Why

Documents indexed before the content date pipeline existed don't have content_last_updated, causing the sitemap reader to skip every hit and fail with "No documents found."

How

The sitemap reader now tries content_last_updated first, then falls back to last_updated. The _source filter fetches both fields.

Test plan

  • Verify sitemap generation succeeds against an index with documents that only have last_updated

🤖 Generated with Claude Code

@reakaleek reakaleek requested a review from a team as a code owner April 14, 2026 11:00
@reakaleek reakaleek requested a review from technige April 14, 2026 11:00
Documents indexed before the content date pipeline existed don't have
content_last_updated. The sitemap reader now falls back to last_updated
so sitemap generation succeeds during the transition period.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai coderabbitai bot added the fix label Apr 14, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c98106c7-3372-4b27-8602-2cb6574539aa

📥 Commits

Reviewing files that changed from the base of the PR and between 4cd08b5 and a684d71.

📒 Files selected for processing (1)
  • src/services/Elastic.Documentation.Assembler/Building/EsSitemapReader.cs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/services/Elastic.Documentation.Assembler/Building/EsSitemapReader.cs

📝 Walkthrough

Walkthrough

The changes modify EsSitemapReader to improve handling of last-updated timestamps. The ReadAllAsync method now attempts to use content_last_updated first, falling back to last_updated if the former is absent. The BuildSearchBody method adds last_updated to the list of _source fields requested from Elasticsearch, ensuring the fallback field is available during parsing. Entries are skipped only when both fields are missing.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: implementing a fallback to last_updated in the sitemap reader when content_last_updated is missing.
Description check ✅ Passed The description clearly explains what changed (fallback logic), why it's needed (legacy documents lack content_last_updated), and how it works (tries content_last_updated first, then last_updated).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch olive-spade

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

@reakaleek reakaleek changed the title Search: Fix content date enrichment for existing environments Search: Fall back to last_updated in sitemap reader Apr 14, 2026
@reakaleek reakaleek closed this Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants