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.
Permalink
Failed to load latest commit information.
examples
src
README.md

README.md

Trigram Search

DEMO: http://tokumine.github.com/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.

examples

cd examples
ruby spanish_municipalities.rb

There is a Javascript example which uses the generated search index here: http://tokumine.github.com/trigram_search/

benchmark (n=1000)

cd examples
ruby benchmark.rb

      user     system      total        real
  0.950000   0.010000   0.960000 (  0.959077)

1ms per search

Todo

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