A simple command line full text search engine for your local plain text files.
Standard rust project. Git clone and
cargo build should work fine.
If you run Archlinux, you can install from the aur: searchr-git.
- Create a config file to configure what files you want indexed and where to store the indexes. (see configuration section below)
- Create the index:
mkdir <my index location> && searchr index
searchr search "foo bar"
See tantivy docs for the supported query syntax.
See example_config.toml for an example. The software searches for the configuration file in the following locations in order, and uses the first match:
- path passed to
-con the command line
If none are found, the software exits with an error.
- builds indexes and searches with tantivy. This also means that other tantivy-based tools can be used on the indexes, like tantivy-cli.
My note taking workflow involves a large number of plain text files loosely inspired by Zettelkasten and vimwiki. Since I generally avoid categories and hierarchies, various types of searches is the main method I use for finding a note. Currently there are two methods I use for finding a note:
The first method is perfect if I roughly know what what I'm looking for and know there's a note with that in the title. The second is great if I'm looking for a specific pattern or word. What's missing though is a general full text content search. Grepping doesn't work so well when you're looking for a set of keywords. So that's where this tool comes in! Now I have a third method for searching my notes that sits between a fuzzy title search and specific regex searches.
There are other full text search engines around, but so far I haven't found something that is small and simple. I wanted something that I could configure and set up by nothing more than editing a short config file and running a single command.
Copyright © 2019 Samuel Walladge
Dual licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.