| Crates.io | simsearch |
| lib.rs | simsearch |
| version | 0.3.0 |
| created_at | 2019-04-15 15:04:26.018477+00 |
| updated_at | 2025-08-21 09:22:46.080416+00 |
| description | A simple and lightweight fuzzy search engine that works in memory, searching for similar strings (a pun here). |
| homepage | https://github.com/andylokandy/simsearch-rs |
| repository | https://github.com/andylokandy/simsearch-rs |
| max_upload_size | |
| id | 128118 |
| size | 46,314 |
simsearchA simple and lightweight fuzzy search engine that works in memory, searching for similar strings (a pun here).
Add the following to your Cargo.toml:
[dependencies]
simsearch = "0.3"
use simsearch::SimSearch;
let mut engine: SimSearch<u32> = SimSearch::new();
engine.insert(1, "Things Fall Apart");
engine.insert(2, "The Old Man and the Sea");
engine.insert(3, "James Joyce");
let results: Vec<u32> = engine.search("thngs");
assert_eq!(results, &[1]);
By default, Jaro-Winkler distance is used. An alternative Levenshtein distance,
which is SIMD-accelerated but only works for ASCII byte strings, can be specified
with custom SearchOptions:
use simsearch::{SimSearch, SearchOptions};
let options = SearchOptions::new().levenshtein(true);
let mut engine: SimSearch<u32> = SimSearch::new_with(options);
Also try the interactive demo by:
$ cargo run --release --example books
All kinds of contribution are welcomed.
Licensed under MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)