v0.3.0
Adds fully local keyword search over converted documents.
curl -sS --get --data-urlencode 'q=operational risk' \
http://127.0.0.1:8000/v1/documents/doc_xxxxxxxxxxxx/search
docsift search doc_xxxxxxxxxxxx "operational risk"
Successful API conversions index their chunks in SQLite FTS5. Search returns ranked chunks with section path, page numbers and token counts — never the document's complete Markdown. Quoted phrases are supported.
Controls. limit (default 5, max 20) sets direct matches; context (0–2) includes adjacent chunks, marked separately from direct matches; max_tokens (default 5000) caps the whole response. Queries are capped at 1024 characters and 64 terms.
Also in this release
- Invalid search syntax returns a stable 422 that never exposes SQLite details and never echoes the submitted query back.
- Genuine database faults surface as server errors rather than being reported to the caller as an invalid query.
- A document with no index rows returns
409telling you to re-upload it, instead of an empty result set indistinguishable from no matches. - FTS matching is scoped to the requested document, so search cost no longer grows with the rest of the corpus.
- The search endpoint uses the metadata row for its existence check rather than parsing the whole stored document — roughly half the previous latency.
- If a SQLite build lacks the FTS5 module, search returns
503and the rest of the service still runs. - Deletion removes a document's index rows together with its record; failed and cancelled jobs are never indexed.
Upgrading from 0.2.0. The index is created automatically — no migration step. But documents converted before this release are not in it and will return 409; re-upload them to index them. The version bump also invalidates 0.2.x cache entries, so the first conversion of each document after upgrading reconverts.
Read Known limitations before deploying. Search is lexical, not semantic — it does not understand synonyms. It is scoped to one document at a time. Page-number filtering is not supported. Scores order results within one response and are not comparable across requests. The API still has no authentication, rate limiting or multi-tenancy — run it behind your own access control. The bundled Dockerfile remains untested by a real build.