Trigram inverted search index generator/client in Ruby + JS client
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Trigram Search


A Ruby class to generate a trigram substring inverted index for a set of strings provided in a CSV.

The index generated could be used for high speed text matching, such as in autocompletes, or in search services. You could, for example, dump the indexes to JSON and use them client side.


cd examples
ruby spanish_municipalities.rb

There is a Javascript example which uses the generated search index here:

benchmark (n=1000)

cd examples
ruby benchmark.rb

      user     system      total        real
  0.950000   0.010000   0.960000 (  0.959077)

1ms per search


Graduate the JS example to a real library Add localstorage to the JS demo to store generated search index so only the source strings are downloaded