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:
@@ -251,13 +251,21 @@ func (h *Handlers) ManagedMaterials(w http.ResponseWriter, r *http.Request) {
|
||||
writeOpaque500(w)
|
||||
return
|
||||
}
|
||||
var files map[uint][]models.IndexedFile
|
||||
if cands != nil {
|
||||
files, err = snippetFiles(db, materialIDs(rows), cands.Hits)
|
||||
if err != nil {
|
||||
writeOpaque500(w)
|
||||
return
|
||||
}
|
||||
}
|
||||
mcp := viaMCP(r)
|
||||
out := make([]any, 0, len(rows))
|
||||
for _, m := range rows {
|
||||
row := newManagedMaterialJSON(m, people)
|
||||
if cands != nil {
|
||||
if hit, ok := cands.Hits[m.ID]; ok {
|
||||
row.Snippet = snippetValue(pickSnippet(hit, m), mcp)
|
||||
row.Snippet = snippetValue(pickSnippet(hit, m, files[m.ID]), mcp)
|
||||
}
|
||||
}
|
||||
out = append(out, managedMaterialView(row, mcp, includeBody(r)))
|
||||
|
||||
Reference in New Issue
Block a user