Inspired by Local Search Engine in Rust from @tsoding made a similar project in Golang.
go build -tags "sqlite_math_functions" -o <PROGRAM> .
Usage: <PROGRAM> <SUBCOMMAND> <FLAGS>
SUBCOMMANDS:
- build: for building index db on documents present in a given directory
- query: for finding closest matching document for a given query using tf-idf
- serve: for serving index db on web
- help: see help
Usage of build:
-db string
Path of db to store the index. Supported formats: [.db, .json] (default "index.db")
-dir string
Directory containing the files
Usage of query:
-db string
Path of db to store the index. Supported formats: [.db, .json] (default "index.db")
-query string
Search query
-topN uint
Top N results to show (default 10)
Usage of serve:
-addr string
Address to serve the server on (default "127.0.0.1:6969")
-db string
Path of db to store the index. Supported formats: [.db, .json] (default "index.db")
-
Stolen saxlike from @kokardy/saxlike
-
@tsoding's Playlist "Search Engine in Rust"
-
Stopwords taken from: https://www.ranks.nl/stopwords (Long Stopword List)
-
Snowball Stemmer taken from: snowballstem/snowball. I have modified the generated code as per my need
Licensed under @MIT