Export creators and full abstracts in library.json #66

Closed
opened 2026-03-21 19:27:39 +00:00 by kert · 0 comments
Owner

Problem

The library export truncates abstracts to 300 chars and omits creator/author data entirely. This limits search quality:

  • Users can't search by author name
  • Full-text search misses content beyond the first 300 chars of abstracts

Fix

export_library.py changes:

  1. Remove the 300-char truncation — export full abstracts
  2. Add creators to each item:
# In store.get() or list_items(), load creators:
creator_rows = con.execute(
    'SELECT c.last_name, c.first_name FROM item_creators ic '
    'JOIN creators c ON ic.creator_id = c.id '
    'WHERE ic.item_id = ? ORDER BY ic.sort_order', (item_id,)
).fetchall()
  1. Add to serialized item: "creators": ["Last, First", ...]

library.tsx changes:

  1. Add creators to LibraryItem interface
  2. Include creators in search filter: i.creators.some(c => c.toLowerCase().includes(q))
  3. Display creators in table (optional new column or below title)

Files

  • docs/scripts/export_library.py
  • docs/src/pages/library.tsx
  • src/bib/store.py (if creators aren't already on Item)
## Problem The library export truncates abstracts to 300 chars and omits creator/author data entirely. This limits search quality: - Users can't search by author name - Full-text search misses content beyond the first 300 chars of abstracts ## Fix ### export_library.py changes: 1. Remove the 300-char truncation — export full abstracts 2. Add creators to each item: ```python # In store.get() or list_items(), load creators: creator_rows = con.execute( 'SELECT c.last_name, c.first_name FROM item_creators ic ' 'JOIN creators c ON ic.creator_id = c.id ' 'WHERE ic.item_id = ? ORDER BY ic.sort_order', (item_id,) ).fetchall() ``` 3. Add to serialized item: `"creators": ["Last, First", ...]` ### library.tsx changes: 1. Add `creators` to `LibraryItem` interface 2. Include creators in search filter: `i.creators.some(c => c.toLowerCase().includes(q))` 3. Display creators in table (optional new column or below title) ## Files - `docs/scripts/export_library.py` - `docs/src/pages/library.tsx` - `src/bib/store.py` (if creators aren't already on Item)
kert added this to the P13: Docs Search — local search, library data, broken links, tests milestone 2026-03-21 19:27:39 +00:00
kert added the docsbib labels 2026-03-21 19:27:39 +00:00
kert closed this issue 2026-03-21 19:34:14 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: homelab/stack#66