tinysearch's documented install omits the feature its own binary requires
🔍 Tiny, full-text search engine for static websites built with Rust and Wasm
At a glance
- What is it?
- A full-text search engine for static sites, written in Rust and compiled to WebAssembly, with two index formats, a schema file that decides what is searchable, and a container that ships the crate source so it can build the engine at run time. The default feature set contains no command line parser, and the published install command does not enable the feature that provides one.
- Who is it for?
- tinysearch suits a static site with tens to a few hundred documents that wants search with no server, no dependency and a payload measured in kilobytes rather than hundreds of kilobytes of JavaScript. It does not suit a larger site, which the project says so itself, and it does not suit someone who wants prefix matching over body text with the smaller index.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 70 days ago.
- What is it written in?
- Mainly Rust, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.
Star history
- tinysearch/tinysearch2,978 ★ · +5
| Repository | 2026-09-24 | 2026-11-22 |
|---|---|---|
| tinysearch/tinysearch | 3k | 3k |
5 Stars in the last 59 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The install line omits the feature the binary requires
The quickest way to see this project's structure is to compare three places where the same build is described.
The documentation says to install it with the Rust package tool, one command with no flags. The container recipe builds with the locked lockfile, the release profile, and the binary feature named explicitly. The local install target in the build file also names that feature, and forces the install.
The reason is in the manifest. There are two targets. One is a library, declared with no conditions. The other is the executable, and it declares that it requires a feature before it will build at all.
That feature is not in the default set. The default set is empty, and the feature is what pulls in the argument parser, the logger, the error handling library, the temporary file helper, the string enumeration helper, and both halves of the TOML reader.
So the documented one-liner installs a package whose executable target is gated behind a feature that install does not enable. Depending on how the published crate was configured for release, that produces either a build error or a package with no working command line entry point.
For reference, this is what the documentation asks for, next to the two index modes the same page explains:
cargo install tinysearch
tinysearch --release -m wasm -p wasm_output fixtures/index.json
tinysearch --indexer xor8 -m wasm -p wasm_output fixtures/index.jsonEverything else in the project is careful about the same flag. The test target runs the library with the feature on, the debug and release builds pass it, and the container passes it too. The documentation line is the outlier.
The default build has no command line, no config file and no logging
Turning that feature on is not a formality. It is the difference between a usable tool and a library.
With the default feature set, what remains is a handful of pure dependencies: a binary serialisation format with its trait support, a JSON parser, a Markdown stripper, the serialisation derive, and the XOR filter library with its trait support. No argument parser, no logger, no TOML reader, no error type.
The optional ones are exactly the things you interact with. The argument parser is the command line. The two TOML packages are the configuration file that decides which fields are indexed and which come back as metadata. The logger is how the tool tells you what it is doing. The error library is how it reports failure. The temporary file helper is for writing output.
So the library surface is a clean, dependency-light core that another Rust program can call, and everything a human at a terminal needs is bolted on behind one flag.
That is a defensible split, and the manifest states it honestly with an empty default list. The cost is that the boundary between the two is invisible until you read the manifest, and the documentation for installation does not mention the flag at all.
Only one of the two indexers searches prefixes in body text
The engine has two index formats and the choice between them changes what your users can type.
The default builds one sorted vocabulary with exact posting lists mapping each word to the articles containing it. Document identifiers are delta-encoded and then variable-length encoded, which is what keeps the index compact enough to compress well. Exact search and prefix search use that same index, and the documentation is explicit that this path introduces no probabilistic false positives.
The optional smaller format builds probabilistic filters per article. It is smaller, and it behaves differently: it supports title prefixes, but body and metadata searches require complete words. Indexes previously generated with an earlier XOR filter implementation are read through this same path, which is a useful compatibility note for anyone with an existing index.
There are two related limits on prefixes. With the default indexer, prefix matching only starts once a query term reaches three characters; anything shorter needs an exact match. With the smaller indexer, prefixes work in titles only.
So the practical rule is: if your users expect to type the first few letters of a word appearing in body text and get results, you need the default indexer, and you need to accept the size.
Size is the whole pitch, and it is measured on the author's own site
The documentation answers the question of whether it is tiny with one measurement, taken from the author's own site.
That index covers 73 posts, and produces an optimised WebAssembly payload of 179 kilobytes, which is 83 kilobytes gzipped and 72 kilobytes with Brotli compression. The comparison the documentation makes is with a demo image above it rather than with a competitor, and then answers its own question in one word.
The alternative being displaced is named twice: a JavaScript search library and a port of it, both described as too heavy for smaller websites because they load a lot of JavaScript. The project positions itself as a Rust and WebAssembly port of some Python code from an article about building a full-text search engine with Bloom filters, so the lineage is a filter-based index rather than a term-frequency library.
The size budget is where the design has to give. The documentation states that all search indices for all articles are bundled into a single static binary, by which it means one static WebAssembly module, and recommends the engine only for small to medium sites. The per-document cost is quoted as around two kilobytes uncompressed, or about one kilobyte compressed.
At 73 documents that is roughly 73 kilobytes of the 179. The number scales linearly, which is what makes the recommendation a recommendation rather than a prohibition.
The container ships the crate source so it can build the engine at run time
The container recipe is unusual, and the reason is stated in a comment.
The build stage compiles the executable on a pinned Rust image, installing the C library headers and adding the WebAssembly target, with the locked lockfile so the dependency versions cannot drift.
The runtime stage then does something no ordinary image would do. It installs the WebAssembly optimiser, copies the compiled executable into place, and copies the manifest, the lockfile, the readme, the assets directory and the entire source directory into a second location in the image. Then it warms the cache by generating a throwaway index from a minimal JSON document and deleting the output.
The entry point runs the tool with an option telling it where that second copy lives.
So this image is a build environment that happens to produce an engine on demand. When you run it, it compiles the search engine to WebAssembly on the fly, which is why the optimiser and the WebAssembly target have to be present at run time rather than only at build time, and why the warm-up step exists: without it, the first real invocation would pay the whole compile.
The trade is image size for a self-contained tool that can index and serve without a separate build stage.
Unsafe code is forbidden and a missing doc comment is a hard error
The manifest's lint section says more about how this project is maintained than the changelog does.
Four rules are set at deny level: warnings, missing documentation, and the 2018 edition idiom group. The fifth is stronger than a deny, which is that unsafe code is forbidden outright rather than merely warned about.
For a project that parses untrusted input, builds filter data structures and compiles to WebAssembly, forbidding unsafe code is a meaningful constraint rather than a formality, and it is enforced in the manifest so it applies to every build including a contributor's.
A Clippy section follows, with a comment explaining the shape of it: the generally applicable lint groups are all raised to error level, and the specific restriction lints are selected individually because enabling the whole restriction group would turn on rules that conflict with each other.
That comment is the kind of thing that saves an afternoon. The full restriction group is exactly the setting that produces a hundred errors on the first run, and a manifest that enabled it would be a project nobody could build.
The manifest's links point at a different account than the repository does
A few small things in the manifest and the tree are worth knowing before you file anything or link to this project.
The homepage and repository fields both point at an account and a repository name that differ from the one hosting this code, and the documentation field points at the documentation host for the package, which is correct. So two of three links resolve to a different path than the one you cloned from.
The licence is a dual one, expressed as either of two licences, and the tree carries a matching pair of licence files rather than a single one. That is the correct packaging for it, and it is worth noticing because a scanner that reads only one of them will report a partial answer.
The published contents are listed explicitly: the source directory, the assets directory, the readme, and the licence files. The examples, the fixtures and the tests are not published, so the crate on the registry is smaller than the repository.
There is also a configuration file committed at the repository root, and an example configuration file inside the examples directory, which is the same file in two places. That is harmless unless you edit the wrong one, and the documentation says the file has to sit beside the JSON index file, which is neither of those two locations.
Editorial conclusion
tinysearch suits a static site with tens to a few hundred documents that wants search with no server, no dependency and a payload measured in kilobytes rather than hundreds of kilobytes of JavaScript. It does not suit a larger site, which the project says so itself, and it does not suit someone who wants prefix matching over body text with the smaller index. Before you adopt it, check three things: how many documents you have, since the per-document cost is quoted at around two kilobytes uncompressed and the whole index is bundled into one module; which indexer you want, since only the exact one searches prefixes in body text; and whether your build can supply the feature the binary needs, because the install line in the documentation leaves it off while both the container build and the local install target turn it on.
Frequently asked questions
What is tinysearch?
A full-text search engine for static websites, written in Rust and compiled to WebAssembly so it runs in the browser, with no server and no JavaScript dependencies. It works with static site generators including Jekyll, Hugo, Zola, Cobalt and Pelican. The index for 73 posts on the author's own site produces an optimised module of 179 kB, or 83 kB gzipped. It is licensed under either Apache-2.0 or MIT.
How do I install and run tinysearch?
The documentation gives a single install command for the Rust package tool, but the executable target in the manifest requires a feature that command does not enable, and the default feature set is empty. The container build and the local install target both pass that feature explicitly. Running it needs a JSON file of documents to index, plus optionally a configuration file beside it that names which fields are indexed, which come back as metadata, and which holds the URL.
Does tinysearch support prefix search?
With the default indexer, yes, but only once a query term reaches three characters; shorter terms need an exact match. The default indexer uses one sorted vocabulary with exact posting lists and introduces no probabilistic false positives. The optional smaller probabilistic indexer supports title prefixes only, so body and metadata searches require complete words.
How many documents can tinysearch handle?
The project recommends small to medium sites, because all indices for all articles are bundled into one static module. The quoted cost is around 2 kB uncompressed per article, roughly 1 kB compressed, measured against a 73-post index that produced 179 kB optimised, 83 kB gzipped, or 72 kB with Brotli compression.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/tinysearch-tinysearch)Star history chart for your README
[](https://hysenlabs.com/projects/tinysearch-tinysearch)Was this useful?