Go · 2026
search-engine-go
A small, thread-safe document search engine in Go, built on an inverted index.
The smallest search engine that is still honest about concurrency: an
in-memory inverted index behind a sync.RWMutex, so searches run in
parallel while documents are added, updated and removed.
How it works
- Text is lowercased and split on whitespace.
- Each word maps to the documents that contain it.
- A match in the title scores two points, one in the body scores one.
- Results come back sorted by score.
It came before sift: the same question, answered with words instead of vectors.