Go Spotlight is a command-line file search engine that does automatic indexing, and supports quries in different format.
And thanks to the power of bleve, gsp
does query analysis before execution, such that the query term you input need not be super accurate (eg. water = watering = watered)
brew install peco
if you have go
installed and want to build from source
got get githun.com/DrakeW/go-spotlight
cd
into the directorygo build -o gsp
ln -s $(pwd)/fdb /usr/local/bin/gsp
otherwise
- Download the binary release
cd
into the dir of the downloaded binarychmod 700 ./gsp
to grant user right to execute programln -s $(pwd)/fdb /usr/local/bin/gsp
There are two kinds of queries that are supported:
- fuzzy query syntax:
gsp q <whatever word in your mind>
- strict query syntax:
gsp sq --extension txt --time -3~-1 --words "<make sure you put words inside double quote>"
More information can be found by running gsp help
or gsp help <command>
Since gsp
recursively indexes file information including part of the file content into the index, it takes about 1 second to index 1000 files. Therefore be cautious when you try to index a directory with lots of files. (But the search will be always fast after the indexing phase)