Skip to content

pitbot: local FTS5 search mirror so our index makes the cut (0.13.1) - #92

Merged
sh1pt-actions-fleet[bot] merged 1 commit into
mainfrom
feat/crawler-local-index
Nov 2, 2026
Merged

sh1pt-actions-fleet[bot] merged 1 commit into
mainfrom
feat/crawler-local-index

Conversation

@sh1pt-actions-fleet

Copy link
Copy Markdown
Contributor

Follow-up to #91. Live, the pit engine never made it into results: nichedb's full-text search takes 1 to 3.8 s (it matches against the GIN index of its whole items table; restricting to the crawler's source still took 1.0 s on 27.8k rows), and pit.world gives a slow engine 2.5 s.

  • The publish job also writes each batch into a SQLite FTS5 mirror (/data/index.db on a compose volume); the crawler answers nichedb's /api/v1/search shape on loopback in milliseconds. Any input is a valid query (quoted tokens), all words first then any word, bm25 with title weighted most, re-crawls replace pages.
  • pit engine defaults to that mirror (127.0.0.1:8807); PIT_INDEX_URL=https://nichedb.dev or off still work. nichedb stays the open published store.
  • /status shows the searchable page count.

Tests: 250 pass with Redis (4 new for the mirror: punctuation-proof queries, AND→OR, upsert, publish fills the mirror with nichedb off). Typecheck and ThreatCrush clean.

🤖 Generated with Claude Code

Live, the 'pit' engine never appeared in results: nichedb's full-text
search runs against the GIN index of its whole items table, 1 s for a
two-word query and 3.8 s for three, and pit.world waits 2.5 s for a slow
engine. Restricting to the crawler's source did not help (1.0 s on
27.8k rows) because the cost is the global match, and re-indexing that
table in production is the thing that has stalled it before.

So the publish job now also writes each batch into a SQLite FTS5 mirror
(/data/index.db, a compose volume) and the crawler answers nichedb's
/api/v1/search shape on loopback: quoted tokens (any input is a valid
query), all words first then any word, bm25 with title weighted most, a
re-crawl replaces the page. pit.world's 'pit' engine reads it by default
(PIT_INDEX_URL still selects nichedb or off). nichedb stays the published
store. /status shows how many pages are searchable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sh1pt-actions-fleet
sh1pt-actions-fleet Bot merged commit 71b95a9 into main Nov 2, 2026
4 checks passed
@sh1pt-actions-fleet
sh1pt-actions-fleet Bot deleted the feat/crawler-local-index branch November 2, 2026 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant