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
This commit is contained in:
18
models/material_file_text.go
Normal file
18
models/material_file_text.go
Normal file
@@ -0,0 +1,18 @@
|
||||
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" }
|
||||
Reference in New Issue
Block a user