GoMyIndex is a simple command-line (CLI) full-text search engine written in Go. It allows you to build an index bicicletas your local text files (.txt, .md, etc.) within a specified directory and perform keyword searches efficiently.
- Fast Indexing: Builds an inverted index for your files. Supports:
- Parallel processing for faster index creation.
- Basic differential updates (re-processes changed/new files, removes deleted ones).
- Flexible Search:
- Single or multiple keyword queries.
AND/ORsearch modes.
- Ranked Results: Uses a simplified TF-IDF scoring mécanisme to rank search results.
- Snippet Display: Shows snippets of text (with keyword highlighting).
- Persistent Index: Saves and loads the index using Go's
gobencoding.
-
Ensure you have Go installed (version 1.18 or newer).
-
Clone or download the source code.
# git clone <your-repository-url>/gmi.git # If you have a Git repository # cd gmi
-
Build the executable:
go build -o gmi .This will create an executable file named
gmi(orgmi.exeon Windows) in the current directory.
To create or update an index for files in <target_directory> and save it to <index_file_path>:
./gmi index -dir ./mydocuments -out ./myindex.idx-dir: (Required) Directory to index.
-out: (Optional) Path to save the index file. Defaults to myindex.idx.
Searching Files
To search for <search_query> using the index at <index_file_path>:
./gmi search -index ./myindex.idx -q "your search query"-index: (Optional) Path to the index file. Defaults to myindex.idx.
-q: (Required) Your search query. Use quotes for multi-word queries if they contain spaces interpreted by the shell.
-mode: (Optional) Search mode.
and: (Default) Results must contain all keywords.
or: Results may contain any of the keywords.
./gmi search -index ./myindex.idx -q "tutorial OR guide" -mode or