Giter Site home page Giter Site logo

shuni64 / tinysearch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tinysearch/tinysearch

3.0 0.0 0.0 326 KB

A tiny, static, full-text search engine for your website using Bloom filters and WebAssembly

License: Apache License 2.0

Rust 82.69% Makefile 3.15% C 1.94% JavaScript 7.96% HTML 4.27%

tinysearch's Introduction

tinysearch

Build Status

This is a lightweight, fast, full-text search engine for static websites. I'm using it on my homepage if you like to see a quick demo.

It is a Rust/WASM port of the Python code from the article "Writing a full-text search engine using Bloom filters". This can be seen as an alternative to lunr.js and elasticlunr.

The idea is to generate a small, self-contained WASM module from a list of articles of a website and ship it to browsers. tinysearch could be integrated into the build process of generators like Jekyll, Hugo, zola, or Cobalt.

Installation

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

cargo install wasm-pack

To optimize JavaScript, you'll also need terser:

npm install terser -g

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

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

As an input, we require a JSON file, which contains a list of your blog posts (see file format).

tinysearch fixtures/index.json

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

For example, if you have Python installed, you can try the following:

python -m SimpleHTTPServer

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

For advanced usage options, try

tinysearch --help

Maintainers

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

License

tinysearch is licensed under either of

at your option.

tinysearch's People

Contributors

jorgelbg avatar mh84 avatar mre avatar shuni64 avatar

Stargazers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.