-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck-chunks.js
More file actions
36 lines (29 loc) · 976 Bytes
/
check-chunks.js
File metadata and controls
36 lines (29 loc) · 976 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const { PrismaClient } = require('@prisma/client')
const prisma = new PrismaClient()
async function checkChunks() {
// 查找最新的文件
const file = await prisma.file.findFirst({
where: { filename: '高灯科技简介.pdf' },
orderBy: { createdAt: 'desc' }
})
if (!file) {
console.log('❌ File not found')
return
}
console.log('📄 File:', file.filename)
console.log(' ID:', file.id)
console.log(' Status:', file.status)
console.log(' Text length:', file.extractedText?.length || 0)
// 查找对应的chunks
const chunks = await prisma.fileChunk.findMany({
where: { fileId: file.id }
})
console.log('\n📦 FileChunks:', chunks.length)
if (chunks.length > 0) {
console.log(' First chunk preview:', chunks[0].content.substring(0, 100))
} else {
console.log(' ⚠️ NO CHUNKS FOUND! This means MemMachine indexing failed.')
}
await prisma.$disconnect()
}
checkChunks().catch(console.error)