Files
sm-bm-plugin/models/material_file_text.go
Jakub Zych 412821ec56 feat: index the text of attached PDFs
- jz_bm_material_file_texts caches the pdftotext output per file
- the River job jz.bm.extract_material_text extracts and resyncs
- the management multipart attach queues it inside its transaction
- file_texts in the document and a file snippet with its name
2026-11-08 20:11:19 +01:00

19 lines
741 B
Go

package models
import "time"
// MaterialFileText is the text extracted from one PDF attached to a
// material. An empty Text means the file was extracted and held none (a
// scan or a broken PDF). Truncated is set when the text was cut at the
// extraction cap. The row goes with its file (foreign-key cascade).
type MaterialFileText struct {
FileID uint `gorm:"column:file_id;primaryKey;autoIncrement:false"`
MaterialID uint `gorm:"column:material_id"`
Text string `gorm:"column:text"`
Truncated bool `gorm:"column:truncated"`
ExtractedAt time.Time `gorm:"column:extracted_at"`
}
// TableName is the file text table.
func (MaterialFileText) TableName() string { return "jz_bm_material_file_texts" }