Documentation
¶
Overview ¶
Command search is a sample architecture (docs/examples/search): on top of what preview-server does (convert and cache every document as bdf, and a thumbnail), it also extracts each document's text with bdf.Document.SearchText and indexes it in Meilisearch, one document per page (a sheet is one entry, without a page number — see bdf.Document.SearchText's doc comment). /search proxies a query to Meilisearch and the browser opens a hit at its exact page, no server-side rendering involved: only the bdf and a JSON search response ever cross the wire.
Needs a running Meilisearch (any search engine with an HTTP API would do the same job; Meilisearch's is small enough to call with net/http alone, so this example adds no dependency):
docker run --rm -p 7700:7700 getmeili/meilisearch:v1.12 \ meilisearch --master-key=dev-key --no-analytics cd examples/search && node web/build.mjs && go run . -meili-key dev-key open http://127.0.0.1:8083/