navidocs/server
ggq-admin 5f6a7db3c2 Add keep-last-n script and clean up all but last 2 documents
Created utility script to keep only the N most recently uploaded documents
and removed 24 old test documents, keeping only the 2 newest.

Script Features:
- Keeps N most recent documents by created_at timestamp
- Deletes older documents from database, filesystem, and Meilisearch
- Transaction-safe database deletion with CASCADE
- Comprehensive summary report

Cleanup Results:
- Documents kept: 2 (Sumianda_Network_Upgrade, Liliane1 Prestige Manual EN)
- Documents deleted: 24 (all test/duplicate documents)
- Database entries removed: 24 documents + related pages/jobs
- Meilisearch entries cleaned: 24 documents worth of pages/images
- Filesystem folders deleted: 2 (others already cleaned)

Remaining Documents:
1. Sumianda_Network_Upgrade (2025-10-19T23:25:49.483Z)
2. Liliane1 Prestige Manual EN (2025-10-19T19:47:35.108Z)

Files Added:
- server/scripts/keep-last-n.js - Reusable cleanup utility

Usage:
node scripts/keep-last-n.js [N]  # Default: N=2

Testing:
Search verified working with clean index at http://172.29.75.55:8083

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 01:39:29 +02:00
..
config chore(debug): log tenant token parent uid for troubleshooting 2025-10-19 17:11:05 +02:00
db feat: NaviDocs MVP - Complete codebase extraction from lilian1 2025-10-19 01:55:44 +02:00
examples feat: NaviDocs MVP - Complete codebase extraction from lilian1 2025-10-19 01:55:44 +02:00
middleware feat: NaviDocs MVP - Complete codebase extraction from lilian1 2025-10-19 01:55:44 +02:00
migrations feat: Add image extraction design, database schema, and migration 2025-10-19 19:47:30 +02:00
routes Fix search, add PDF text selection, clean duplicates, implement auto-fill 2025-10-20 01:35:06 +02:00
scripts Add keep-last-n script and clean up all but last 2 documents 2025-10-20 01:39:29 +02:00
services feat: Add Google Cloud Vision API as primary OCR option 2025-10-19 09:08:38 +02:00
test/data chore: Local development environment setup 2025-10-19 04:42:55 +02:00
workers Implement PDF image extraction with OCR in OCR worker 2025-10-19 19:54:25 +02:00
.env.example feat: Complete frontend UI polish with Meilisearch-inspired design 2025-10-19 16:40:48 +02:00
API_SUMMARY.md feat: NaviDocs MVP - Complete codebase extraction from lilian1 2025-10-19 01:55:44 +02:00
check-doc-status.js Fix search, add PDF text selection, clean duplicates, implement auto-fill 2025-10-20 01:35:06 +02:00
fix-user-org.js Fix search, add PDF text selection, clean duplicates, implement auto-fill 2025-10-20 01:35:06 +02:00
index.js Fix search, add PDF text selection, clean duplicates, implement auto-fill 2025-10-20 01:35:06 +02:00
package.json Implement PDF image extraction with OCR in OCR worker 2025-10-19 19:54:25 +02:00
run-migration.js feat: Add image extraction design, database schema, and migration 2025-10-19 19:47:30 +02:00
test-full-pipeline.js Implement PDF image extraction with OCR in OCR worker 2025-10-19 19:54:25 +02:00
test-image-extraction.js Implement PDF image extraction with OCR in OCR worker 2025-10-19 19:54:25 +02:00
test-image-system-e2e.js Fix search, add PDF text selection, clean duplicates, implement auto-fill 2025-10-20 01:35:06 +02:00
test-routes.js feat: NaviDocs MVP - Complete codebase extraction from lilian1 2025-10-19 01:55:44 +02:00