All Projects β†’ tinysearch β†’ Tinysearch

tinysearch / Tinysearch

Licence: other
πŸ” Tiny, full-text search engine for static websites built with Rust and Wasm

Programming Languages

rust
11053 projects
HTML
75241 projects
Dockerfile
14818 projects
Makefile
30231 projects

Projects that are alternatives of or similar to Tinysearch

Docs
Repository of Twilio SendGrid's product documentation.
Stars: ✭ 221 (-87.04%)
Mutual labels:  hacktoberfest, static-site
Modfy.video
A video transcoder and converter built using Web Assembly and FFMPEG to transcode and convert videos right in your browser while protecting your privacy
Stars: ✭ 283 (-83.4%)
Mutual labels:  hacktoberfest, wasm
Rhino3dm
Libraries based on OpenNURBS with a RhinoCommon style
Stars: ✭ 232 (-86.39%)
Mutual labels:  hacktoberfest, wasm
Statiq.framework
A flexible and extensible static content generation framework for .NET.
Stars: ✭ 251 (-85.28%)
Mutual labels:  hacktoberfest, static-site
Photon
⚑ Rust/WebAssembly image processing library
Stars: ✭ 963 (-43.52%)
Mutual labels:  hacktoberfest, wasm
Gatsby Theme Superstylin
πŸ’… A Gatsby Theme with styled-components
Stars: ✭ 165 (-90.32%)
Mutual labels:  hacktoberfest, static-site
Verless
A simple and lightweight Static Site Generator.
Stars: ✭ 276 (-83.81%)
Mutual labels:  hacktoberfest, static-site
Emberclear
Encrypted Chat. No History. No Logs.
Stars: ✭ 157 (-90.79%)
Mutual labels:  hacktoberfest, wasm
Uno
Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported.
Stars: ✭ 6,029 (+253.61%)
Mutual labels:  hacktoberfest, wasm
Awesome Privacy
πŸ’‘Limiting personal data leaks on the internet
Stars: ✭ 488 (-71.38%)
Mutual labels:  hacktoberfest, search-engine
Ant Design Blazor
🌈A set of enterprise-class UI components based on Ant Design and Blazor WebAssembly.
Stars: ✭ 3,890 (+128.15%)
Mutual labels:  hacktoberfest, wasm
Tutorialdb
A search πŸ”Ž engine for programming/dev tutorials, See it in action πŸ‘‰
Stars: ✭ 93 (-94.55%)
Mutual labels:  hacktoberfest, search-engine
Uno.ch9
Ch9 - Uno Reference Implementation project
Stars: ✭ 45 (-97.36%)
Mutual labels:  hacktoberfest, wasm
Scaffold Static
Scaffolding utility for vanilla-js
Stars: ✭ 111 (-93.49%)
Mutual labels:  hacktoberfest, static-site
Gitreflow
Reflow automatically creates pull requests, ensures the code review is approved, and squash merges finished branches to master with a great commit message template.
Stars: ✭ 1,488 (-12.73%)
Mutual labels:  hacktoberfest
Implicit Hie
Auto generate a stack or cabal multi component hie.yaml file
Stars: ✭ 114 (-93.31%)
Mutual labels:  hacktoberfest
Madelineproto
Async PHP client/server API for the telegram MTProto protocol
Stars: ✭ 1,776 (+4.16%)
Mutual labels:  hacktoberfest
U Root
A fully Go userland with Linux bootloaders! u-root can create a one-binary root file system (initramfs) containing a busybox-like set of tools written in Go.
Stars: ✭ 1,816 (+6.51%)
Mutual labels:  hacktoberfest
Search Online
πŸ”A simple extension for VSCode to search online easily using search engine.
Stars: ✭ 115 (-93.26%)
Mutual labels:  search-engine
Developer Community Stats
πŸš€ A repository to encourage beginners to contribute to open source and for all contributors to view their Github stats
Stars: ✭ 116 (-93.2%)
Mutual labels:  hacktoberfest

tinysearch

CI

tinysearch is a lightweight, fast, full-text search engine. It is designed for static websites.

tinysearch is written in Rust, and then compiled to WebAssembly to run in a browser.
It can be used together with static site generators such as Jekyll, Hugo, Zola, Cobalt, or Pelican.

Demo

Is it tiny?

The test index file of my blog with around 40 posts creates a WASM payload of 99kB (49kB gzipped, 40kB brotli).
That is smaller than the demo image above; so yes.

How it works

tinysearch is a Rust/WASM port of the Python code from the article "Writing a full-text search engine using Bloom filters". It can be seen as an alternative to lunr.js and elasticlunr, which are too heavy for smaller websites and load a lot of JavaScript.

Under the hood it uses a Xor Filter β€” a datastructure for fast approximation of set membership that is smaller than bloom and cuckoo filters. Each blog post gets converted into a filter that will then be serialized to a binary blob using bincode. Please note that the underlying technologies are subject to change.

Limitations

  • Only finds entire words. As a consequence there are no search suggestions (yet). This is a necessary tradeoff for reducing memory usage. A trie datastructure was about 10x bigger than the xor filters. New research on compact datastructures for prefix searches might lift this limitation in the future.
  • Since we bundle all search indices for all articles into one static binary, we recommend to only use it for small- to medium-size websites. Expect around 2 kB uncompressed per article (~1 kb compressed).

Installation

wasm-pack is required to build the WASM module. Install it with

cargo install wasm-pack

To optimize the JavaScript output, you'll also need terser:

npm install terser -g

If you want to make the WebAssembly as small as possible, we recommend to install binaryen as well. On macOS you can install it with homebrew:

brew install binaryen

Alternatively, you can download the binary from the release page or use your OS package manager.

After that, you can install tinysearch itself:

cargo install tinysearch

Usage

A JSON file, which contains the content to index, is required as an input. Please take a look at the example file.

Once you created the index, you can run

tinysearch fixtures/index.json

ℹ️ You can take a look at the code examples for different static site generators here.
ℹ️ The body field in the JSON document is optional and can be skipped to just index post titles.

This will create a WASM module and the JavaScript glue code to integrate it into your website. You can open the demo.html from any webserver to see the result.

For example, Python has a built-in webserver that can be used for a quick test:

python3 -m http.server 

then browse to http://0.0.0.0:8000/demo.html to run the demo.

Advanced Usage

For advanced usage options, run

tinysearch --help

Please check what's required to host WebAssembly in production -- you will need to explicitly set gzip mime types.

Docker

If you don't have a full Rust setup available, you can also use our nightly-built Docker images.

Here is how to quickly try tinysearch with Docker:

# Download a sample blog index from endler.dev
curl -O https://raw.githubusercontent.com/tinysearch/tinysearch/master/fixtures/index.json
# Create the WASM output
docker run -v $PWD:/tmp tinysearch/cli index.json

By default, the most recent stable Alpine Rust image is used. To get nightly, run

docker build --build-arg RUST_IMAGE=rustlang/rust:nightly-alpine -t tinysearch/cli:nightly .

Advanced Docker Build Args

  • WASM_REPO: Overwrite the wasm-pack repository
  • WASM_BRANCH: Overwrite the repository branch to use
  • TINY_REPO: Overwrite repository of tinysearch
  • TINY_BRANCH: Overwrite tinysearch branch

Users

The following websites use tinysearch:

Are you using tinysearch, too? Add your site here!

Maintainers

  • Matthias Endler (@mre)
  • Jorge-Luis Betancourt (@jorgelbg)
  • Mad Mike (@fluential)

License

tinysearch is licensed under either of

at your option.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].